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
This commit is contained in:
Sharpened Blade
2023-07-28 15:59:43 +05:30
committed by sharpenedblade
parent 2cf2e71d38
commit 27e1e6ea51
2 changed files with 10 additions and 10 deletions
+2 -4
View File
@@ -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: |
+8 -6
View File
@@ -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