# HG changeset patch # User Aleksej Bobylev # Date 1512649888 -7200 # Node ID f92f75dce828f38e472f26cf928165d89833d6f5 # Parent 6907a43402f61d9357d1a942eb0a5516cf0edb28 cook: add fix() to use '--as-needed' linker flag in compile_rules(); cookit(): make QA fail on empty vars / bad values; remove_already_packed(): fix bug when $PACKAGE not listed in $SPLIT and we use this function for the default set. lighttpd/index.cgi: sort orphans. modules/precheck: separate error message by empty lines. diff -r 6907a43402f6 -r f92f75dce828 cook --- a/cook Fri Dec 01 16:22:12 2017 +0200 +++ b/cook Thu Dec 07 14:31:28 2017 +0200 @@ -527,6 +527,26 @@ } +# Misc fix functions + +fix() { + case $1 in + # https://bugzilla.gnome.org/show_bug.cgi?id=655517 + # https://wiki.gentoo.org/wiki/Project:Quality_Assurance/As-needed + ld) + export LDFLAGS="$LDFLAGS -Wl,-Os,--as-needed" + ;; + libtool) + if [ -e 'libtool' ]; then + sed -i 's| -shared | -Wl,-Os,--as-needed\0|g' libtool + else + echo "fix libtool: warning: libtool absent, nothing to fix." + fi + ;; + esac +} + + # The main cook function. cookit() { @@ -571,7 +591,7 @@ ;; esac - [ -n "$QA" ] && @@PREFIX@@/libexec/cookutils/precheck $receipt # former receipt_quality() + @@PREFIX@@/libexec/cookutils/precheck $receipt || exit 1 # former receipt_quality() cd $pkgdir [ -z "$continue" ] && rm -rf source 2>/dev/null @@ -775,7 +795,7 @@ echo [ -d "$install" ] && rm -r $install - mkdir -p $install + #mkdir -p $install compile_rules $@ || { broken; exit 1; } @@ -1321,8 +1341,10 @@ remove_already_packed() { local i j + # $pkg is the name of the main package; $PACKAGE is the name of the current one + # $pkg may (or may not) be included in the $SPLIT neighbors=$( - echo $SPLIT" " \ + echo $pkg $SPLIT" " \ | awk -F$'\t' -vpkg="$PACKAGE" ' BEGIN { RS = " "; FS = ":"; } { set[$1] = $2; } diff -r 6907a43402f6 -r f92f75dce828 lighttpd/index.cgi --- a/lighttpd/index.cgi Fri Dec 01 16:22:12 2017 +0200 +++ b/lighttpd/index.cgi Thu Dec 07 14:31:28 2017 +0200 @@ -1585,7 +1585,7 @@ if (! files_pkg[i]) print i; } } - ' "$all_files" "$packaged" > $orphans + ' "$all_files" "$packaged" | sort > $orphans if [ -d "$install" -a -s "$orphans" ]; then echo echo "" diff -r 6907a43402f6 -r f92f75dce828 modules/precheck --- a/modules/precheck Fri Dec 01 16:22:12 2017 +0200 +++ b/modules/precheck Thu Dec 07 14:31:28 2017 +0200 @@ -7,6 +7,8 @@ . /usr/lib/slitaz/libcook.sh +# Return immediately if QA is not used +[ -n "$QA" ] || return 0 receipt="$(realpath $1)" @@ -22,8 +24,10 @@ CATEGORY) valid="$(echo $PKGS_CATEGORIES)" # avoid newlines if ! echo " $valid " | grep -q " $value "; then + newline _ 'QA: unknown category "%s"' "$value" - die 'Please, use one of: %s' "$valid" + longline "Please, use one of: $valid" + die fi ;; WEB_SITE)