tazwok rev 285
no clean-chroot into get-src; allow to get-src in an existing directory when using --target (needed in few receipts)
author | Antoine Bodin <gokhlayeh@slitaz.org> |
---|---|
date | Tue Feb 15 01:27:35 2011 +0100 (2011-02-15) |
parents | be865f7b8e97 |
children | 71f7a961521a |
files | tazwok |
line diff
1.1 --- a/tazwok Mon Feb 14 19:27:33 2011 +0100 1.2 +++ b/tazwok Tue Feb 15 01:27:35 2011 +0100 1.3 @@ -434,7 +434,7 @@ 1.4 check_for_tarball() 1.5 { 1.6 [ "$WGET_URL" ] || return 0 1.7 - report step "Checking for source tarball" 1.8 + report step "Checking for source tarball: $PACKAGE" 1.9 local repack_src TARBALL 1.10 if [ "$repack_src" = yes ] && look_for_cookopt !repack_src; then 1.11 repack_src=no 1.12 @@ -552,21 +552,29 @@ 1.13 1.14 if [ "$nounpack" ]; then 1.15 [ -d "$tmp_src" ] && rm -r $tmp_src 1.16 + report end-step 1.17 return 1.18 fi 1.19 - if [ ! -d "$src" ]; then 1.20 - if ! check_for_var_modification src _pkg; then 1.21 - src="${src%/*}/$(ls $tmp_src)" 1.22 + if [ ! -d "$src" ]|| [ "$target" ]; then 1.23 + # Permissions settings. 1.24 + chown -R root.root "$tmp_src" 1.25 + if [ -d "$src" ]; then 1.26 + mkdir -p $src 1.27 + for f in $tmp_src/*/*; do 1.28 + cp -a $f $src || { report end-step; rm -r $tmp_src; return 1; } 1.29 + done 1.30 + else 1.31 + if ! check_for_var_modification src _pkg && ! [ "$target" ]; then 1.32 + src="${src%/*}/$(ls $tmp_src)" 1.33 + fi 1.34 + mv $(echo $tmp_src/*) "$src" || { report end-step; rm -r $tmp_src; return 1; } 1.35 fi 1.36 - mv $(echo $tmp_src/*) "$src" 1.37 rm -r $tmp_src 1.38 - 1.39 - # Permissions settings. 1.40 - chown -R root.root "$src" 1.41 else 1.42 [ -d "$tmp_src" ] && rm -r $tmp_src 1.43 echo "There's already something at $src. Abort." >&2 1.44 fi 1.45 + report end-step 1.46 } 1.47 1.48 # Log and execute compile_rules function if it exists, to configure and 1.49 @@ -720,7 +728,7 @@ 1.50 if [ "${WGET_URL%$TARBALL}" = "$WGET_URL" ] && [ "$file" = "$WGET_URL" ]; then 1.51 wget -q --no-check-certificate -O $TARBALL $file && break 1.52 else 1.53 - wget -q $file && break 1.54 + wget -q --no-check-certificate $file && break 1.55 fi 1.56 else 1.57 tazwok_warning "Needs wget to download the source tarball from $file, please add it as build-depend." 1.58 @@ -2900,7 +2908,6 @@ 1.59 source_lib report 1.60 report start 1.61 check_for_tarball 1.62 - [ -x /usr/bin/clean-chroot ] && clean-chroot 1.63 else 1.64 echo "No tarball to download for $PACKAGE" 1.65 fi