diff options
author | davidovski <david@davidovski.xyz> | 2022-02-06 00:40:22 +0000 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-02-06 00:40:22 +0000 |
commit | 2c82b81fcd8fc723712ac605041da5142f765730 (patch) | |
tree | da3ebf0f981d9f6e6bf4ccecef4ba55c044ae0a3 /xibuild/build_all.sh | |
parent | 0b0913a10d6714015f1d1afa1a737086e20bac41 (diff) |
moved src files to xibuild files
Diffstat (limited to 'xibuild/build_all.sh')
-rwxr-xr-x | xibuild/build_all.sh | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/xibuild/build_all.sh b/xibuild/build_all.sh new file mode 100755 index 0000000..275e50b --- /dev/null +++ b/xibuild/build_all.sh @@ -0,0 +1,73 @@ +#!/bin/bash + +ERROR="\033[0;31m" +INFO="\033[0;34m" +PASS="\033[0;32m" +NEUTRAL="\033[0;33m" +RESET="\033[0m" + +build_package () { + name=$(echo $line | cut -d"+" -f1) + buildfile=$(find $XIB_BUILDFILES -wholename "*/$name.xibuild" | head -1) + + if [ -f "$buildfile" ]; then + printf $INFO + printf "Building$NEUTRAL %s$INFO:\n$RESET" $name + ./build_package.sh $buildfile || return 1 + + # Install the package if it is needed for other builds + if echo $line | grep -q '+'; then + printf "$INFO\tInstalling..." + exported_pkg=$(find $XIB_EXPORT -wholename "*/$name.xipkg" | head -1 | xargs realpath) + if [ -f $exported_pkg ]; then + tar -h --no-overwrite-dir -xf $exported_pkg -C $XIB_CHROOT + + postinstall="$XIB_CHROOT/var/lib/xipkg/postinstall" + if [ -d $postinstall ]; then + for file in "$postinstall/*.sh"; do + f=$(basename $file) + chmod 755 $file + xichroot "$XIB_CHROOT" "/var/lib/xipkg/postinstall/$f" + rm $file + printf "$PASS run postinstall for $f!\n" + done + rmdir $postinstall + fi + fi + + printf "$PASS installed to chroot!\n" + fi + + printf $RESET + printf "Finished building %s!\n" $name + else + printf "$ERROR$name does not exist\n" + fi + + # configure shadow here + if [ "$name" = "shadow" ]; then + xichroot "$XIB_CHROOT" "/usr/sbin/pwconv" + xichroot "$XIB_CHROOT" "/usr/sbin/grpconv" + xichroot "$XIB_CHROOT" "mkdir -p /etc/default" + xichroot "$XIB_CHROOT" "/usr/sbin/useradd -D --gid 999" + fi +} + +build_all () { + for line in $(perl build_order.pm); do + build_package $line || return 1 + done + +} + +if build_all; then + printf "\n${PASS}Built all packages!" + exit 0 +else + printf "$ERROR Something went wrong!$NEUTRAL Press enter to view recent log" + read; + + f=$(ls -1 --sort time $XIB_EXPORT/repo/*/*.log | head -1 | xargs realpath) + less $f + exit 1 +fi |