From: Travis Cross Date: Thu, 21 Mar 2013 21:00:12 +0000 (+0000) Subject: Allow setting compression level for dpkg-source X-Git-Tag: v1.3.17-final~59 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8df04fc4b191c7166b91b9658d3a13880f1c875;p=thirdparty%2Ffreeswitch.git Allow setting compression level for dpkg-source Apparently the Raspberry Pi blows up (out of memory) if you call dpkg-source -z9 as it implicitly calls xz -9. Thanks to Ken Rice for running headlong into this. Also note that while xz takes -0, dpkg-source won't take -z0, so we check for this and make sure we call dpkg-source correctly. --- diff --git a/debian/util.sh b/debian/util.sh index 4b8b37b25b..ca160c846c 100755 --- a/debian/util.sh +++ b/debian/util.sh @@ -205,12 +205,13 @@ EOF create_dsc () { { set -e - local OPTIND OPTARG modules_conf="" modules_list="" speed="normal" - while getopts 'f:m:s:' o "$@"; do + local OPTIND OPTARG modules_conf="" modules_list="" speed="normal" zl=9 + while getopts 'f:m:s:z:' o "$@"; do case "$o" in f) modules_conf="$OPTARG";; m) modules_list="$OPTARG";; s) speed="$OPTARG";; + z) zl="$OPTARG";; esac done shift $(($OPTIND-1)) @@ -233,11 +234,12 @@ create_dsc () { reckless) sed -i ./debian/rules \ -e '/\.stamp-build:/{:l2 n; /make/{s/$/ -j/; :l3 n; b l3}; b l2};' ;; esac + [ "$zl" -ge "1" ] || zl=1 git add debian/rules git rm -rf --ignore-unmatch libs/libg722_1 libs/ilbc dch -b -m -v "$dver" --force-distribution -D "$suite" "Nightly build." git add debian/changelog && git commit -m "nightly v$orig_ver" - dpkg-source -i.* -Zxz -z9 -b . + dpkg-source -i.* -Zxz -z${zl} -b . dpkg-genchanges -S > ../$(dsc_base)_source.changes local dsc="../$(dsc_base).dsc" git reset --hard HEAD^ && git clean -fdx @@ -325,7 +327,7 @@ build_all () { o) orig="$OPTARG";; s) dsc_opts="$dsc_opts -s$OPTARG";; v) orig_opts="$orig_opts -v$OPTARG";; - z) orig_opts="$orig_opts -z$OPTARG";; + z) orig_opts="$orig_opts -z$OPTARG"; dsc_opts="$dsc_opts -z$OPTARG";; esac done shift $(($OPTIND-1)) @@ -414,6 +416,7 @@ commands: Choose custom list of modules to build -s [ paranoid | reckless ] Set FS bootstrap/build -j flags + -z Set compression level create-orig