# HG changeset patch # User Aleksej Bobylev # Date 1502417358 -10800 # Node ID 11e28a8b9e5a08191af6fb9afa7a887417ea9cce # Parent 7cdd0d3b59b7a52f804ef5073229eeb36671c34b cooker: add command 'outgoing'; modules/deps: add option '--incl'; modules/compressor: skip empty *.a diff -r 7cdd0d3b59b7 -r 11e28a8b9e5a cooker --- a/cooker Sat Aug 05 04:41:24 2017 +0300 +++ b/cooker Fri Aug 11 05:09:18 2017 +0300 @@ -44,6 +44,7 @@ -a | all Find and cook all unbuilt packages. -T | tasks List existing cooker tasks. -t | task Executing specified task. + -o | outgoing Find changes in wok that we can move to wok-hg. EOT exit 0 @@ -303,6 +304,59 @@ } +# Compare wok and wok-hg file $1, display signs: +# '+' file added, '-' file removed, '~' file changed, '=' file not changed + +compare_wok_file() { + local f1='n' f2='n' # n: not exists, e: exists + [ -e "$wok/$1" ] && f1='e' + [ -e "$wok-hg/$1" ] && f2='e' + case "$f1$f2" in + en) echo "+ $1";; + ne) [ -n "$del" ] && echo "- $1";; + ee) + if cmp -s "$wok/$1" "$wok-hg/$1"; then + [ -n "$eq" ] && echo "= $1" + else + echo "~ $1" + fi + ;; + esac +} + + +# Compare wok and wok-hg folder $1; process only: +# receipt, description.*txt, all files in the stuff folder + +compare_wok_folder() { + IFS=$'\n' + { + for i in $wok $wok-hg; do + ls $i/$1/receipt 2>/dev/null + ls $i/$1/description.*txt 2>/dev/null + [ -d $i/$1/stuff ] && find $i/$1/stuff -type f + done + } | sed "s|$wok/$1/||; s|$wok-hg/$1/||" | sort -u | \ + while read file; do + compare_wok_file "$1/$file" + done +} + + +# Compare entire wok + +compare_wok() { + { + cd $wok; ls + cd $wok-hg; ls + } | sort -u | \ + while read folder; do + result="$(compare_wok_folder $folder)" + [ -n "$result" ] && echo -e "$result\n" + done +} + + # # Commands # @@ -524,6 +578,11 @@ . $tasks/$task; task footer "Task $task finished" ;; + outgoing|-o) + # Find changes in wok that we can move to wok-hg + compare_wok + ;; + *) # Default is to cook all commits if not yet running. [ -n "$1" ] && usage diff -r 7cdd0d3b59b7 -r 11e28a8b9e5a modules/compressor --- a/modules/compressor Sat Aug 05 04:41:24 2017 +0300 +++ b/modules/compressor Fri Aug 11 05:09:18 2017 +0300 @@ -565,8 +565,9 @@ find $fs -name '*.a' -exec $STRIP -d '{}' 2>/dev/null \; # Nullify timestamps of files in ar archives + # Skip empty 8-byte archives (hi, musl-libc package) whereami=$(pwd) - find $fs -name '*.a' -type f | \ + find $fs -name '*.a' -type f -size +8c | \ while read i; do tempdir=$(mktemp -d); cd $tempdir ar -x $i; ar -crD $(basename $i) * diff -r 7cdd0d3b59b7 -r 11e28a8b9e5a modules/deps --- a/modules/deps Sat Aug 05 04:41:24 2017 +0300 +++ b/modules/deps Fri Aug 11 05:09:18 2017 +0300 @@ -113,7 +113,7 @@ *ld-linux.so*);; *linux-gate.so*);; *) - echo "$pkgs" | awk ' + echo "$pkgs" | awk -vincl="$incl" ' # if both packages exist in list, return the first one only function s(pkg1, pkg2) { if (index(" "$0" ", " "pkg1" ") && index(" "$0" ", " " pkg2 " ")) @@ -151,7 +151,10 @@ s("xorg-xcb-util-renderutil-dev", "xcb-util-renderutil-dev"); s("eudev-dev", "udev-dev"); - if (! index($0, "glibc-base") && + # if called with "--incl": show all deps including glibc-base, + # gcc-lib-base, glibc-dev and gcc; otherwise hide them + if (incl == "yes" || + ! index($0, "glibc-base") && ! index($0, "gcc-lib-base") && ! index($0, "glibc-dev") && $0 != "gcc")