tazwok diff tazwok @ rev 550
Merge hotfixes from default branch
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Sat Dec 10 03:42:32 2011 +0100 (2011-12-10) |
parents | fcc1dc4dd1af c7c055498940 |
children | adadf23b46bc |
line diff
1.1 --- a/tazwok Sat Nov 26 12:55:25 2011 +0000 1.2 +++ b/tazwok Sat Dec 10 03:42:32 2011 +0100 1.3 @@ -303,7 +303,7 @@ 1.4 # Don't remove sources if a package uses src variable in its 1.5 # genpkg_rules: it maybe needs something inside. 1.6 for i in $PACKAGE $(look_for_rwanted); do 1.7 - sed -n '/^genpkg_rules\(\)/','/}/'p $WOK/$i/receipt | \ 1.8 + sed -n '/^genpkg_rules\(\)/','/^}/'p $WOK/$i/receipt | \ 1.9 fgrep -q '$src' && tazwok_warning "Sources will not be removed \ 1.10 because $i uses \$src in its receipt." && return 1.11 done 1.12 @@ -508,8 +508,7 @@ 1.13 1.14 remove_previous_package() 1.15 { 1.16 - [ "$prev_VERSION" ] || return 1.17 - if [ "$VERSION$EXTRAVERSION" != "$prev_VERSION" ]; then 1.18 + if [ "$prev_VERSION" ] && [ "$VERSION$EXTRAVERSION" != "$prev_VERSION" ]; then 1.19 rm -f $1/$PACKAGE-$prev_VERSION.tazpkg 1.20 fi 1.21 return 0 1.22 @@ -701,19 +700,22 @@ 1.23 if grep -q ^compile_rules $RECEIPT; then 1.24 echo "executing compile_rules" >> $LOG 1.25 report step "Executing compile_rules" 1.26 - cd $WOK/$PACKAGE 1.27 + if [ -d "$src" ]; then 1.28 + cd "$src" 1.29 + else 1.30 + cd $WOK/$PACKAGE 1.31 + fi 1.32 rm -f /tmp/config.site 1.33 ulimit -d unlimited 1.34 ulimit -m unlimited 1.35 1.36 - # Free some RAM by cleaning cache if option is enabled. 1.37 - freeram=$(free | fgrep '/+ buffers' | tr -s ' ' | cut -f 4 -d ' ') 1.38 + freeram=$(free -m | fgrep 'Mem:' | tr -s ' ' | cut -f 4 -d ' ') 1.39 1.40 - # Disable -pipe in CFLAGS/CXXFLAGS if less than 512Mb of free 1.41 + # Disable -pipe in CFLAGS/CXXFLAGS if less than 512MB of free 1.42 # RAM are available. 1.43 - if [ "$freeram" -lt 524288 ] && [ "$CFLAGS" != "${CFLAGS/-pipe}" -o \ 1.44 + if [ "$freeram" -lt 512 ] && [ "$CFLAGS" != "${CFLAGS/-pipe}" -o \ 1.45 "$CXXFLAGS" != "${CXXFLAGS/-pipe}" ]; then 1.46 - tazwok_warning "Disabling -pipe compile flag because only ${freeram}b of RAM is available." 1.47 + tazwok_warning "Disabling -pipe compile flag because of low memory: $freeram MB available." 1.48 CFLAGS="${CFLAGS/-pipe}" 1.49 CXXFLAGS="${CXXFLAGS/-pipe}" 1.50 fi