# HG changeset patch # User Christophe Lincoln # Date 1304784649 -7200 # Node ID 81fad49137198948098b3bcdc253b880ad936f10 # Parent af6305b2076b40b49dd059ecf8ece340c6ebdbc5 cook: remove Python compiled files (may we discuss that Godane) diff -r af6305b2076b -r 81fad4913719 cook --- a/cook Sat May 07 17:51:48 2011 +0200 +++ b/cook Sat May 07 18:10:49 2011 +0200 @@ -237,7 +237,7 @@ cookdate=$(date "+%Y-%m-%d %H:%M") gettext "Summary for:"; echo " $PACKAGE $VERSION" separator - [ "$prod" ] && echo "Produced : $prod" + [ "$prod" ] && echo "Produced : $prod" cat << EOT Packed : $fs Compressed : $size @@ -310,10 +310,11 @@ fi } -# Find and strip : --strip-all (-s) or --strip-debug on static libs. +# Find and strip : --strip-all (-s) or --strip-debug on static libs as well +# as removing unusuff files lik in Python packages. strip_package() { - gettext "Executing strip on all files" + gettext "Executing strip on all files..." for dir in $fs/bin $fs/sbin $fs/usr/bin $fs/usr/sbin $fs/usr/games do if [ -d "$dir" ]; then @@ -323,6 +324,16 @@ find $fs -name "*.so*" -exec strip -s '{}' 2>/dev/null \; find $fs -name "*.a" -exec strip --strip-debug '{}' 2>/dev/null \; status + + # Remove .pyc, .pyo, perllocal.pod and .packlist files from packages. + if echo "$DEPENDS" | fgrep "python"; then + gettext "Removing Python compiled files..." + find $fs -type f -name "*.pyc" -delete 2>/dev/null + find $fs -type f -name "*.pyo" -delete 2>/dev/null + find $fs -type f -name "perllocal.pod" -delete 2>/dev/null + find $fs -type f -name ".packlist" -delete 2>/dev/null + status + fi } # Remove installed deps.