cookutils rev 67
cook: remove Python compiled files (may we discuss that Godane)
author | Christophe Lincoln <pankso@slitaz.org> |
---|---|
date | Sat May 07 18:10:49 2011 +0200 (2011-05-07) |
parents | af6305b2076b |
children | 67e279a35515 |
files | cook |
line diff
1.1 --- a/cook Sat May 07 17:51:48 2011 +0200 1.2 +++ b/cook Sat May 07 18:10:49 2011 +0200 1.3 @@ -237,7 +237,7 @@ 1.4 cookdate=$(date "+%Y-%m-%d %H:%M") 1.5 gettext "Summary for:"; echo " $PACKAGE $VERSION" 1.6 separator 1.7 - [ "$prod" ] && echo "Produced : $prod" 1.8 + [ "$prod" ] && echo "Produced : $prod" 1.9 cat << EOT 1.10 Packed : $fs 1.11 Compressed : $size 1.12 @@ -310,10 +310,11 @@ 1.13 fi 1.14 } 1.15 1.16 -# Find and strip : --strip-all (-s) or --strip-debug on static libs. 1.17 +# Find and strip : --strip-all (-s) or --strip-debug on static libs as well 1.18 +# as removing unusuff files lik in Python packages. 1.19 strip_package() 1.20 { 1.21 - gettext "Executing strip on all files" 1.22 + gettext "Executing strip on all files..." 1.23 for dir in $fs/bin $fs/sbin $fs/usr/bin $fs/usr/sbin $fs/usr/games 1.24 do 1.25 if [ -d "$dir" ]; then 1.26 @@ -323,6 +324,16 @@ 1.27 find $fs -name "*.so*" -exec strip -s '{}' 2>/dev/null \; 1.28 find $fs -name "*.a" -exec strip --strip-debug '{}' 2>/dev/null \; 1.29 status 1.30 + 1.31 + # Remove .pyc, .pyo, perllocal.pod and .packlist files from packages. 1.32 + if echo "$DEPENDS" | fgrep "python"; then 1.33 + gettext "Removing Python compiled files..." 1.34 + find $fs -type f -name "*.pyc" -delete 2>/dev/null 1.35 + find $fs -type f -name "*.pyo" -delete 2>/dev/null 1.36 + find $fs -type f -name "perllocal.pod" -delete 2>/dev/null 1.37 + find $fs -type f -name ".packlist" -delete 2>/dev/null 1.38 + status 1.39 + fi 1.40 } 1.41 1.42 # Remove installed deps.