20438436 gznew script calling python causes indentation error s11u2-sru
authorJiri Kukacka <jiri.kukacka@oracle.com>
Wed, 18 Mar 2015 13:54:20 +0100
branchs11u2-sru
changeset 4040 e2a56338b7c1
parent 4039 515806511ebc
child 4041 da985d6374c2
20438436 gznew script calling python causes indentation error
components/gzip/patches/znew.patch
--- a/components/gzip/patches/znew.patch	Tue Mar 17 18:42:25 2015 +0100
+++ b/components/gzip/patches/znew.patch	Wed Mar 18 13:54:20 2015 +0100
@@ -90,7 +90,7 @@
  
  for arg
  do
[email protected]@ -116,26 +92,32 @@ if test -n "$opt"; then
[email protected]@ -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"