# HG changeset patch # User Jan Noha # Date 1422548575 28800 # Node ID 6e696f960e14f28d6938558893ceb134d438dd83 # Parent eb8d6ce0657e493077691be4a17f09b09b3cbcae 20438436 gznew script calling python causes indentation error diff -r eb8d6ce0657e -r 6e696f960e14 components/gzip/patches/znew.patch --- a/components/gzip/patches/znew.patch Fri Feb 13 16:34:03 2015 -0800 +++ b/components/gzip/patches/znew.patch Thu Jan 29 08:22:55 2015 -0800 @@ -90,7 +90,7 @@ for arg do -@@ -116,26 +92,32 @@ if test -n "$opt"; then +@@ -116,26 +92,33 @@ if test -n "$opt"; then fi for i do @@ -107,12 +107,13 @@ # Copy file attributes from old file to new one, if possible. - test -n "$cpmod" && $cpmod $cpmodarg "$n.Z" "$n$ext" 2> /dev/null + touch -r"$n.Z" -- "$n$ext" 2>/dev/null -+ python -c ' -+ import os -+ import sys -+ mode = os.stat(sys.argv[1]).st_mode & 07777 -+ os.chmod(sys.argv[2], mode) -+ ' "$n.Z" "$n$ext" ++ python - "$n.Z" "$n$ext" <<-EOF ++ import os ++ import sys ++ import stat ++ mode = stat.S_IMODE(os.stat(sys.argv[1]).st_mode) ++ os.chmod(sys.argv[2], mode) ++ EOF else - echo error while recompressing $n.Z + echo "error while recompressing $n.Z"