summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidovski <david@davidovski.xyz>2022-08-16 21:50:03 +0100
committerdavidovski <david@davidovski.xyz>2022-08-16 21:50:03 +0100
commit4487c34c52b0ba66121468c64a80a5d77afc8e1f (patch)
tree755153238c1720c874de7da6dfdd6597a2e6b11a
parent389111a187b7b88819d5984b02dab76360f2b356 (diff)
Added ability to select which subpacakage to build
-rw-r--r--xi_buildscript.sh12
-rw-r--r--xibuild.sh9
2 files changed, 17 insertions, 4 deletions
diff --git a/xi_buildscript.sh b/xi_buildscript.sh
index b465c74..4c22a5b 100644
--- a/xi_buildscript.sh
+++ b/xi_buildscript.sh
@@ -2,6 +2,7 @@
PKG_NAME=$1
cd $2
+SUBPKG=${3:-all}
. ./xi_profile.sh
@@ -37,7 +38,14 @@ echo "Build file for $1, to build at root $2"
builds="$(ls *.xibuild | grep -v "$PKG_NAME.xibuild")"
-for xibuild in $PKG_NAME.xibuild $(ls *.xibuild | grep -v "^$PKG_NAME.xibuild$"); do
+
+[ "$SUBPKG" == "all" ] && {
+ pkgs=$($PKG_NAME.xibuild $(ls *.xibuild | grep -v "^$PKG_NAME.xibuild$"))
+} || {
+ pkgs="$SUBPKG"
+}
+
+for xibuild in $pkgs; do
cd $2
SUBPKG_NAME=$(basename $xibuild .xibuild)
mkdir -p ./xipkg/$SUBPKG_NAME
@@ -46,7 +54,7 @@ for xibuild in $PKG_NAME.xibuild $(ls *.xibuild | grep -v "^$PKG_NAME.xibuild$")
echo "============$SUBPKG_NAME============="
- # read only the static variables fromt the primary
+ # read only the static variables from the primary
. ./$PKG_NAME.xibuild
unset -f prepare
unset -f build
diff --git a/xibuild.sh b/xibuild.sh
index 312068d..7c30292 100644
--- a/xibuild.sh
+++ b/xibuild.sh
@@ -19,6 +19,7 @@ doinstall=false
dostrip=true
doclean=false
checkopt=""
+subpkg="all"
root="/"
@@ -43,6 +44,8 @@ ${BLUE}Avaiable Options:
${LIGHT_CYAN}specify a non-default xi_profile script, to run inside the chroot ${LIGHT_WHITE}[default: /etc/xibuild_profile.conf]
${BLUE}-k ${LIGHT_BLUE}[file]
${LIGHT_CYAN}specify an openssl private key to sign packages with${LIGHT_WHITE}
+ ${BLUE}-u ${LIGHT_BLUE}[subpackage]
+ ${LIGHT_CYAN}specify which subpackage should be built ${LIGHT_WHITE }[default: all]
${BLUE}-v
${LIGHT_CYAN}verbose: print logs to stdout
@@ -133,9 +136,9 @@ xibuild_build () {
mkdir -p $root/$export_dir
[ "$root" = "/" ] && {
- sh $build_dir/xi_buildscript.sh $NAME $build_dir $checkopt 2>&1 || return 1
+ sh $build_dir/xi_buildscript.sh $NAME $build_dir $subpkg $checkopt 2>&1 || return 1
} || {
- xichroot "$root" "$build_dir/xi_buildscript.sh $NAME $build_dir $checkopt" 2>&1 || return 1
+ xichroot "$root" "$build_dir/xi_buildscript.sh $NAME $build_dir $subpkg $checkopt" 2>&1 || return 1
}
}
@@ -266,6 +269,8 @@ while getopts ":r:l:C:k:p:b:o:vcinsh" opt; do
key_file=$(realpath ${OPTARG});;
p)
xibuild_profile=$(realpath ${OPTARG});;
+ u)
+ subpkg=${OPTARG};;
v)
textout=/dev/stdout;;
i)