From 358b3a25343d97edd3d2e74f8ba03e2f5ffcecca Mon Sep 17 00:00:00 2001 From: davidovski Date: Wed, 4 May 2022 23:53:02 +0100 Subject: fixed postinstall issues --- xib_env | 2 +- xibuild/build_all.sh | 12 ++++++++---- xibuild/build_package.sh | 4 ++-- xibuild/build_profile | 8 ++++++++ xibuild/make_infos.sh | 14 +++++++------- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/xib_env b/xib_env index 44cf70d..2b6418b 100755 --- a/xib_env +++ b/xib_env @@ -5,7 +5,7 @@ export INFOCHAR=" ~ " export MAKEFLAGS="-j$(grep "processor" /proc/cpuinfo | wc -l)" -export XIB_DIR="/xilinux/var/lib/xib" +export XIB_DIR="/var/lib/xib" export XIB_BUILDFILES="$XIB_DIR/buildfiles" export XIB_CHROOT="$XIB_DIR/chroot" export XIB_EXPORT="$XIB_DIR/export" diff --git a/xibuild/build_all.sh b/xibuild/build_all.sh index a0adbbc..ffa6c03 100755 --- a/xibuild/build_all.sh +++ b/xibuild/build_all.sh @@ -24,8 +24,7 @@ run_postinstall () { # chmod 755 $file xichroot "$XIB_CHROOT" "/var/lib/xipkg/postinstall/$f" - echo $? - if [ "$?" == "0" ]; then + if [ "$?" = "0" ]; then rm $file printf "${PASS}${CHECKMARK}" else @@ -34,18 +33,23 @@ run_postinstall () { done printf ")\n" - [ "$(ls $postinstall | wc -w)" == 0 ] && + [ "$(ls $postinstall | wc -w)" = 0 ] && \ rmdir $postinstall fi } +extract () { + tar -h -p -vvxf $1 -C ${SYSROOT} 2>${LOG_FILE} | grep ^- | tr -s " " | cut -d" " -f6 | cut -c2- +} + + # build a package by its name # build_package () { local name=$(echo $1 | cut -d"+" -f1) local install=$(echo $line | grep -q '+' && echo "true" || echo "false") - local buildfile=$(find $XIB_BUILDFILES -wholename "*/$name.xibuild" | head -1) + local buildfile=$(find $XIB_BUILDFILES/repo/ -wholename "*/$name.xibuild" | head -1) if [ -f "$buildfile" ]; then printf "${INFO}%s\n${RESET}" $name diff --git a/xibuild/build_package.sh b/xibuild/build_package.sh index b430738..fcdf881 100755 --- a/xibuild/build_package.sh +++ b/xibuild/build_package.sh @@ -86,7 +86,7 @@ fetch_source () { http*) ;; *) - url="file://${XIB_BUILDFILES}/extra/$NAME/$url" + url="file://${XIB_BUILDFILES}/repo/$REPO/$NAME/$url" ;; esac @@ -231,7 +231,7 @@ build_pkg () { printf "${GREEN}${CHECKMARK}\n" printf "${BLUE}${TABCHAR}clean " - strip_dest > $log_file 2>&1 || return 1 + strip_dest >> $log_file 2>&1 || return 1 printf "${GREEN}${CHECKMARK}\n" printf "${BLUE}${TABCHAR}package " diff --git a/xibuild/build_profile b/xibuild/build_profile index 04c2ceb..b1ddb89 100644 --- a/xibuild/build_profile +++ b/xibuild/build_profile @@ -1,4 +1,5 @@ export PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin:/tools/sbin +export LIBRARY_PATH=/lib:/usr/lib/:/tools/lib:/tools/lib64 apply_patches () { for p in *.patch; do @@ -14,5 +15,12 @@ export MAKEFLAGS="-j$JOBS" export XORG_PREFIX="/usr" export XORG_CONFIG="--prefix=/usr --sysconfdir=/etc --localstatedir=/var --disable-static" +export BUILD_ROOT="/build/source" +export RUST_TARGET="x86_64-unknown-linux-musl" +#command -v clang && +# export CC="clang" + +#command -v clang++ && +# export CXX="clang++" ldconfig diff --git a/xibuild/make_infos.sh b/xibuild/make_infos.sh index d720500..7d76c86 100755 --- a/xibuild/make_infos.sh +++ b/xibuild/make_infos.sh @@ -5,7 +5,7 @@ XIPKG_INFO_VERSION='03' get_info() { - local name=$(basename -s ".xipkg" $1) + local name=$(basename $1 ".xipkg") local pkg_ver=$PKG_VER [ -z "$pkg_ver" ] && pkg_ver=$BRANCH @@ -19,7 +19,7 @@ get_info() { echo "CHECKSUM=$(md5sum $1 | awk '{ print $1 }')" echo "VERSION=$pkg_ver" echo "SOURCE=$SOURCE" - echo "DATE=$(date -r $1)" + echo "DATE=$(stat -t $1 | cut -d' ' -f13 | xargs date -d)" echo "DEPS=${DEPS}" echo "MAKE_DEPS=${MAKE_DEPS}" } @@ -33,10 +33,10 @@ sign () { list_line() { local pkg_file=$1 - local name=$(basename -s ".xipkg" $pkg_file) + local name=$(basename $pkg_file ".xipkg" ) local filecount=$(gzip -cd $pkg_file | tar -tvv | grep -c ^-) local checksum=$(md5sum $pkg_file | awk '{ print $1 }') - local size=$(stat -c %s $pkg_file) + local size=$(stat -t $pkg_file | cut -d" " -f2) echo $name.xipkg $checksum $size $filecount } @@ -44,7 +44,7 @@ list_line() { list_deps() { local info_file=$1 local deps=$(grep "^DEPS=" $info_file | sed -rn 's/DEPS=(.*)/\1/p') - local name=$(basename -s ".xipkg.info" $info_file) + local name=$(basename $info_file ".xipkg.info" ) echo "$name: $deps" } @@ -66,11 +66,11 @@ hbar -t -T "removing old repos" $i $total graph_file="$XIB_EXPORT"/repo/deps.graph [ -f $graph_file ] && rm $graph_file -list=$(ls "$XIB_EXPORT"/repo/*/*.xipkg) +list=$(find "$XIB_EXPORT"/repo/ -name "*.xipkg") total=$(echo $list | wc -w) i=0 for pkg in $list; do - name=$(basename -s ".xipkg" $pkg) + name=$(basename $pkg ".xipkg") repo=$(echo $pkg | rev | cut -d/ -f2 | rev) info_file="$XIB_EXPORT/repo/$repo/$name.xipkg.info" build_file="$XIB_EXPORT/repo/$repo/$name.xibuild" -- cgit v1.2.1