mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 14:20:07 +00:00
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.
This commit is contained in:
parent
cfaf1949ff
commit
8885f97909
@ -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>
|
||||
|
||||
|
@ -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'
|
||||
|
Loading…
Reference in New Issue
Block a user