diff options
author | Gaël Bonithon <trash.paradise@protonmail.com> | 2020-10-02 10:49:06 +0200 |
---|---|---|
committer | Gaël Bonithon <trash.paradise@protonmail.com> | 2020-10-03 09:14:06 +0200 |
commit | 3e01e2136b0cb687987345cd19e0458e46e2d5b9 (patch) | |
tree | eb41cd0057989876a8d42ccde9a9c928738fe4db /scripts | |
parent | bf575df6b316d860b922b952a2c0645257cb1993 (diff) | |
download | xfce4-dev-tools-3e01e2136b0cb687987345cd19e0458e46e2d5b9.tar.gz |
xdt-autogen: Use sed instead of tr to replace strings
The purpose of the current code seems to be to replace the strings
'\t', '\n' and '\\' by a single space ' ', not the characters
"horizontal tab", "line feed" and "backslash" by a single space.
So the right command to do this is sed, not tr, which doesn't do the
job expected here.
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/xdt-autogen.in | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/scripts/xdt-autogen.in b/scripts/xdt-autogen.in index 0a25093..bbf9527 100644 --- a/scripts/xdt-autogen.in +++ b/scripts/xdt-autogen.in @@ -51,7 +51,9 @@ fi ## parse_configure_subdirs() { - test -f "$1" && cat "$1" | tr '\\n\\t\\\\' ' ' | sed -ne 's|.*AC_CONFIG_SUBDIRS(\[\{0,1\}\([[:alnum:]_ @/-]\{1,\}\).*|\1|p' + test -f "$1" && sed -n -e 's|\\[\\nt]| |g' \ + -e 's|.*AC_CONFIG_SUBDIRS(\[\{0,1\}\([[:alnum:]_ @/-]\{1,\}\).*|\1|p' \ + "$1" } ## @@ -231,7 +233,11 @@ if test x"$1" = x"clean"; then echo "Cleaning generated files in ${directory}..." # determine the output files used in this package directory - output_files=`tr '\\n\\t\\\\' ' ' < ${configure_ac_file} | sed -ne 's|.*AC_OUTPUT(\[\{0,1\}\([[:alnum:]_@/\. -]\{1,\}\).*|\1|p'`; + output_files=$( + sed -n -e 's|\\[\\nt]| |g' \ + -e 's|.*AC_OUTPUT(\[\{0,1\}\([[:alnum:]_@/\. -]\{1,\}\).*|\1|p' \ + "${configure_ac_file}" + ) for output_file in $output_files; do if test x`basename $output_file` = x"Makefile"; then rm -f "${directory}/${output_file}.in"; @@ -260,7 +266,11 @@ if test x"$1" = x"clean"; then fi) # determine translations used in this package directory -# translations=`tr '\\n\\\\' ' ' < ${configure_ac_file} | sed -ne 's/.*XDT_I18N(\[\{0,1\}\([a-zA-Z_@ ]\{1,\}\).*/\1/p'`; +# translations=$( +# sed -n -e 's|\\[\\nt]| |g' \ +# -e 's|.*XDT_I18N(\[\{0,1\}\([a-zA-Z_@ ]\{1,\}\).*|\1|p') \ +# "${configure_ac_file}" +# ) # for translation in $translations; do # rm -f "${directory}/po/${translation}.gmo"; # done |