From 27e1e6ea510cb37bc07bb4261b75d63a0742944f Mon Sep 17 00:00:00 2001 From: Sharpened Blade Date: Fri, 28 Jul 2023 15:31:49 +0530 Subject: [PATCH] Accept package as an argument to build-packages.sh The build script will not build the package specified in $PACKAGE. The script will only build the first specified package, any other arguments will be ignored. Merges https://github.com/t2linux/t2linux-fedora-kernel/pull/11 --- .github/workflows/build.yml | 6 ++---- build-packages.sh | 14 ++++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 245cbef..1f405d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -32,11 +32,9 @@ jobs: mkdir -p _output docker run -t --privileged \ -v "$PWD":/repo \ - -e PACKAGE \ ghcr.io/t2linux/fedora-dev:latest \ - /repo/build-packages.sh - env: - PACKAGE: ${{ matrix.package }} + /repo/build-packages.sh \ + ${{ matrix.package }} - name: "Check Build Artifacts" run: | diff --git a/build-packages.sh b/build-packages.sh index 6c84970..f945d33 100755 --- a/build-packages.sh +++ b/build-packages.sh @@ -1,17 +1,19 @@ #!/usr/bin/bash source /repo/util.sh -if [[ -z "$PACKAGE" ]]; then - PACKAGE="" +if [[ -z "$1" ]]; then + package="" echo "Available packages: t2linux-config, t2linux-repo, t2linux-config, or kernel" - read -p "Name of package to build: " PACKAGE + read -p "Name of package to build: " package +else + package="$1" fi cd /repo -if [ "$PACKAGE" == "kernel" ]; then +if [ "$package" == "kernel" ]; then /repo/kernel/kernel.sh fi -cd /repo/$PACKAGE -build_package $PACKAGE.spec +cd /repo/$package +build_package $package.spec