Re: [patch] Keep executability of config.status-ed files v4

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Wed, 10 Dec 2003 23:50:02 +0100, Eric Sunshine wrote:
...
> composite output file.  Of course, that fails with this above scheme since  
> the net result is that it clones only the execute permission of the very last  
> file in the ac_file_inputs list.  It would probably make more sense to  
> instead copy the permission of just the first file in the list

I did not differentiate between 'first', 'last' or 'any' at all.
I just was out of ideas which one of the zillion methods restricting the shell
block execution to a single file would be enough cross-UNIX compatible.

I found out now that 'break' is documented by "Limitations of Shell Builtins"
as compatible, therefore here is a patch copying the permissions of the FIRST
file of $ac_file_inputs.

I always thought I am able to code shell scripts...



Regards,
Lace
diff -u -ru autoconf-2.57-orig/lib/autoconf/status.m4 autoconf-2.57/lib/autoconf/status.m4
--- autoconf-2.57-orig/lib/autoconf/status.m4	Tue Nov 12 11:54:46 2002
+++ autoconf-2.57/lib/autoconf/status.m4	Thu Dec 11 07:35:34 2003
@@ -1026,11 +1026,18 @@
 dnl    mv $tmp/out $ac_file
 dnl  fi
   if test x"$ac_file" != x-; then
-    mv $tmp/out $ac_file
+    rm -f $ac_file
+dnl Keep 'executable' attribute.
+    for f in $ac_file_inputs; do
+      cp $f $ac_file
+      chmod u+w $ac_file
+      break
+    done
+    cat $tmp/out >$ac_file
   else
     cat $tmp/out
-    rm -f $tmp/out
   fi
+  rm -f $tmp/out
 
 m4_ifset([AC_LIST_FILES_COMMANDS],
 [  # Run the commands associated with the file.

[Index of Archives]     [GCC Help]     [Kernel Discussion]     [RPM Discussion]     [Red Hat Development]     [Yosemite News]     [Linux USB]     [Samba]

  Powered by Linux