This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-386-g8885f97


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  8885f979096f46afd30188e92cefd492c3620787 (commit)
      from  cfaf1949ff1f8336b54c43796d0e2531bc8a40a2 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8885f979096f46afd30188e92cefd492c3620787

commit 8885f979096f46afd30188e92cefd492c3620787
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Nov 18 18:22:09 2016 +0000

    Quote shell commands in logs from build-many-glibcs.py.
    
    As requested in
    <https://sourceware.org/ml/libc-alpha/2016-11/msg00664.html>, this
    patch makes the commands recorded in build-many-glibcs.py quote words
    so they can be cut-and-pasted back into a shell.  (Note that these
    logs are generated by the wrapper script generated to run commands
    with logs, hence the needs for quoting logic to be implemented in that
    shell script.)
    
    	* scripts/build-many-glibcs.py (Context.write_files): Make wrapper
    	script quote words in command output to log suitably for input to
    	the shell.

diff --git a/ChangeLog b/ChangeLog
index 619111f..2232d45 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-18  Joseph Myers  <joseph@codesourcery.com>
+
+	* scripts/build-many-glibcs.py (Context.write_files): Make wrapper
+	script quote words in command output to log suitably for input to
+	the shell.
+
 2016-11-18  Matthew Fortune  <Matthew.Fortune@imgtec.com>
 	    Maciej W. Rozycki  <macro@imgtec.com>
 
diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
index b0e0f5e..517dec4 100755
--- a/scripts/build-many-glibcs.py
+++ b/scripts/build-many-glibcs.py
@@ -423,7 +423,17 @@ class Context(object):
             'date > "$this_log"\n'
             'echo >> "$this_log"\n'
             'echo "Description: $desc" >> "$this_log"\n'
-            'echo "Command: $*" >> "$this_log"\n'
+            'printf "%s" "Command:" >> "$this_log"\n'
+            'for word in "$@"; do\n'
+            '  if expr "$word" : "[]+,./0-9@A-Z_a-z-]\\\\{1,\\\\}\\$" > /dev/null; then\n'
+            '    printf " %s" "$word"\n'
+            '  else\n'
+            '    printf " \'"\n'
+            '    printf "%s" "$word" | sed -e "s/\'/\'\\\\\\\\\'\'/"\n'
+            '    printf "\'"\n'
+            '  fi\n'
+            'done >> "$this_log"\n'
+            'echo >> "$this_log"\n'
             'echo "Directory: $dir" >> "$this_log"\n'
             'echo "Path addition: $path" >> "$this_log"\n'
             'echo >> "$this_log"\n'

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog                    |    6 ++++++
 scripts/build-many-glibcs.py |   12 +++++++++++-
 2 files changed, 17 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]