20438436 gznew script calling python causes indentation error
authorJan Noha <jan.noha@oracle.com>
Thu, 29 Jan 2015 08:22:55 -0800
changeset 3799 c3e697abd23b
parent 3798 c0f7a9f723ca
child 3800 0c839d3b92f0
20438436 gznew script calling python causes indentation error
components/gzip/patches/znew.patch
--- a/components/gzip/patches/znew.patch	Thu Feb 12 08:27:28 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"