# HG changeset patch # User Aleksej Bobylev # Date 1517525470 -7200 # Node ID 7d37b282b4fb2284067dc51e905199b94bb430ed # Parent c51331bcb61779f3d62d736b8f8e28052e6ea743 cook: remove old package in /home/slitaz/packages and upgrade chroot package when $ARCH is used; provide overstriked "Failed" for prepared packages; cook.site: remove redundant first part, fix ${sysconfdir} and ${docdir}; lighttpd/index.cgi: support for overstriked "Failed"; modules/compressor: strip_package(): consider *.dbg files (from glibc and gcc packages); make deterministic *.a archives in the simpler way. diff -r c51331bcb617 -r 7d37b282b4fb cook --- a/cook Sat Jan 27 11:55:42 2018 +0200 +++ b/cook Fri Feb 02 00:51:10 2018 +0200 @@ -1084,9 +1084,9 @@ # Find and remove old package only if "release checksum" has changed if [ "$rsum" != "$rsumold" ]; then - old_file=$(awk -F$'\t' -vname="$PACKAGE" '{ - if ($1 == name) printf("%s-%s.tazpkg", $1, $2); - }' $pi) # -.tazpkg + old_file=$(awk -F$'\t' -vname="$PACKAGE" -varch="$arch" '{ + if ($1 == name) printf("%s-%s%s.tazpkg", $1, $2, arch); + }' $pi) # -<-arch>.tazpkg if [ -f "$PKGS/$old_file" ]; then action 'Removing old package "%s"' "$old_file" rm -f "$PKGS/$old_file" @@ -1181,7 +1181,7 @@ _ 'Updating %s chroot environment...' "$ARCH" _ 'Updating chroot: %s' "$i ($VERSION$EXTRAVERSION$arch)" | log cd $PKGS - tazpkg install $PKGS/$i-$VERSION$EXTRAVERSION$arch.tazpkg --forced --root=$root + tazpkg -i "$PKGS/$i-$VERSION$EXTRAVERSION$arch.tazpkg" --forced --root=$root fi done } @@ -1192,17 +1192,21 @@ install_package() { set_paths case "$ARCH" in - arm*|x86_64) + arm*) arch="-$ARCH" - root="$CROSS_TREE/sysroot" ;; + root="$CROSS_TREE/sysroot" + ;; + x86_64) + arch="-$ARCH" + ;; esac # Install package if requested but skip install if target host doesn't # match build system or it will break the build chroot. build=$(echo $BUILD_SYSTEM | cut -d- -f1) if [ -n "$inst" -a "$build" == "$ARCH" ]; then - if [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION.tazpkg" ]; then + if [ -f "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg" ]; then cd $PKGS - tazpkg install $PACKAGE-$VERSION$EXTRAVERSION.tazpkg --forced + tazpkg -i "$PKGS/$PACKAGE-$VERSION$EXTRAVERSION$arch.tazpkg" --forced else broken die 'Unable to install package, build has failed.' @@ -1563,6 +1567,10 @@ put_status() { # $1: package, $2: status, one of 'Done', 'Failed' sed -i "s|>$1$|& [ $2 ]|" $activity + if [ "$2" == 'Done' ]; then + # overstrike all previous 'Failed' to indicate package is OK now + sed -i "/>$1<\/a>/ s|\[ Failed \]|[ -Failed ]|" $activity + fi } diff -r c51331bcb617 -r 7d37b282b4fb cook.site --- a/cook.site Sat Jan 27 11:55:42 2018 +0200 +++ b/cook.site Fri Feb 02 00:51:10 2018 +0200 @@ -4,24 +4,25 @@ # handles CONFIG_SITE and will source this file automatically. # # If you want to use your own cook.site, you can use: -# export CONFIG_SITE=config.site in compile_rules of a receipt. +# export CONFIG_SITE=config.site in compile_rules() of a receipt. # -# Some old configure(s) use "${prefix}" instead of "${datarootdir}". -if echo "$localedir" | grep -q \${prefix}; then - localedir=$( echo "$localedir" | sed 's/${prefix}/${datarootdir}/') -fi -if echo "$infodir" | grep -q \${prefix}; then - infodir=$( echo "$infodir" | sed 's/${prefix}/${datarootdir}/') -fi -if echo "$mandir" | grep -q \${prefix}; then - mandir=$( echo "$mandir" | sed 's/${prefix}/${datarootdir}/') -fi +# Find receipt (backward recursively from current dir) +receiptpath=$(realpath .) +until [ -z "$receiptpath" -o -e "$receiptpath/receipt" ]; do + receiptpath="${receiptpath%/*}" +done + # Default options. -prefix=/usr -datarootdir=$prefix/share -datadir=$datadir -localedir=$datarootdir/locale -infodir=$datarootdir/info -mandir=$datarootdir/man +prefix="/usr" +sysconfdir="/etc" +localstatedir="/var" +datarootdir="$prefix/share" +datadir="$datarootdir" +infodir="$datarootdir/info" +localedir="$datarootdir/locale" +mandir="$datarootdir/man" +docdir="$datarootdir/doc/$(. $receiptpath/receipt; echo $PACKAGE-$VERSION)" + +unset receiptpath diff -r c51331bcb617 -r 7d37b282b4fb lighttpd/index.cgi --- a/lighttpd/index.cgi Sat Jan 27 11:55:42 2018 +0200 +++ b/lighttpd/index.cgi Fri Feb 02 00:51:10 2018 +0200 @@ -871,6 +871,7 @@ tac $CACHE/$list | sed 's|cooker.cgi?pkg=||; s|%2B|+|g; s|\[ Done|Done|; s|\[ Failed|Failed|; + s|\[ -Failed|Failed|; s| \]||' | mktable $list echo '' done @@ -1028,6 +1029,7 @@ tac $activity | head -n12 | sed 's|cooker.cgi?pkg=||; s|\[ Done|Done|; s|\[ Failed|Failed|; + s|\[ -Failed|Failed|; s| \]||; s|%2B|\+|g' | \ section $activity 12 "Activity|More activity" diff -r c51331bcb617 -r 7d37b282b4fb modules/compressor --- a/modules/compressor Sat Jan 27 11:55:42 2018 +0200 +++ b/modules/compressor Fri Feb 02 00:51:10 2018 +0200 @@ -691,28 +691,35 @@ time0=$(get_time) oldsize=$(sizes strip) - # Strip executable files & shared libraries + + # GNU strip (GNU Binutils) + # -p --preserve-dates Copy modified/access timestamps to the output + # -s --strip-all Remove all symbol and relocation information + # --strip-unneeded Remove all symbols not needed by relocations + # -D --enable-deterministic-archives Produce deterministic output when stripping archives + # -g -S -d --strip-debug Remove all debugging symbols & sections + + # Strip executable files while read i; do - $STRIP -s "$i" 2>/dev/null + $STRIP -ps "$i" 2>/dev/null done </dev/null;; + esac + done </dev/null \; + # See also: https://wiki.debian.org/ReproducibleBuilds/TimestampsInStaticLibraries + find $fs -name '*.a' -exec $STRIP -pdD '{}' 2>/dev/null \; - # Nullify timestamps of files in ar archives - # Skip empty 8-byte archives (hi, musl-libc package) - # Using ar from binutils (ar from Busybox isn't enough) as ${TOOLPREFIX}ar - whereami=$(pwd) - find $fs -name '*.a' -type f -size +8c | \ - while read i; do - tempdir=$(mktemp -d); cd $tempdir - ${TOOLPREFIX}ar -x $i; ${TOOLPREFIX}ar -crD $(basename $i) * - mv -f $tempdir/$(basename $i) $i - rm -rf $tempdir - done - cd $whereami; unset whereami # Remove Python *.pyc and *.pyo find $fs -type f \( -name '*.pyc' -o -name '*.pyo' \) -delete 2>/dev/null