mirror of
https://github.com/squid-cache/squid.git
synced 2025-04-18 22:04:07 +03:00
Portability: use printf(1) instead of echo -n (#1676)
MacOS' implementation of echo(1) does not support the -n flag.
This commit is contained in:
parent
adcdd24517
commit
9732312566
@ -56,16 +56,19 @@ $(TRANSLATE_LANGUAGES): $(ERROR_TEMPLATES)
|
||||
NOTIDY=`$(PO2HTML) --help | grep -o "[-]-notidy"`
|
||||
|
||||
.po.lang:
|
||||
if test "$(PO2HTML)" != "" && test "$(PO2HTML)" != "no" && test "$(PO2HTML)" != "off" && test -f $(top_srcdir)/errors/en.po; then \
|
||||
lang=`basename $@ .lang`; \
|
||||
@if test "$(PO2HTML)" != "" && test "$(PO2HTML)" != "no" && test "$(PO2HTML)" != "off" && test -f $(top_srcdir)/errors/en.po; then \
|
||||
lang=$(@:.lang=); \
|
||||
mkdir -p $(top_builddir)/errors/$$lang; \
|
||||
echo -n "Translate '$$lang' ..."; \
|
||||
echo "Translating $$lang ..."; \
|
||||
for f in $(ERROR_TEMPLATES); do \
|
||||
page=`basename $$f`; \
|
||||
$(PO2HTML) $(NOTIDY) --progress=none -i $(top_srcdir)/errors/$$lang.po -t $(top_srcdir)/errors/$$f >$(top_builddir)/errors/$$lang/$$page || exit 1; \
|
||||
done; \
|
||||
cp $(top_srcdir)/errors/templates/error-details.txt $(top_builddir)/errors/$$lang/error-details.txt || exit 1; \
|
||||
echo "done."; \
|
||||
echo "Done translating $$lang"; \
|
||||
else \
|
||||
lang=$(@:.lang=); \
|
||||
echo "Translation of $$lang disabled\n"; \
|
||||
fi; \
|
||||
touch $@
|
||||
|
||||
|
@ -616,14 +616,13 @@ printRawAmFile ()
|
||||
echo "## $GeneratedByMe"
|
||||
echo
|
||||
|
||||
echo -n "$1 ="
|
||||
printf "%s =" "$1"
|
||||
# Only some files are formed from *.po filenames, but all such files
|
||||
# should list *.lang filenames instead.
|
||||
git ls-files $2$3 | sed -e s%$2%%g -e 's%\.po%\.lang%g' | while read f; do
|
||||
echo " \\"
|
||||
echo -n " ${f}"
|
||||
printf ' \\\n\t%s' "${f}"
|
||||
done
|
||||
echo ""
|
||||
printf '\n'
|
||||
}
|
||||
|
||||
generateAmFile ()
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
set -e
|
||||
|
||||
echo -n "Codespell version: "
|
||||
printf "Codespell version: "
|
||||
if ! codespell --version; then
|
||||
echo "This script requires codespell which was not found."
|
||||
exit 1
|
||||
|
@ -49,7 +49,7 @@ msgcat ./pot/*.pot -s -o errpages.pot.new &&
|
||||
|
||||
## Update all existing dictionaries with the new content ...
|
||||
for f in `ls -1 ./*.po` ; do
|
||||
echo -n "Update: ${f} ... "
|
||||
printf "Update: %s ... " "${f}"
|
||||
msgmerge --verbose -s -o ${f}.new ${f} errpages.pot
|
||||
chown --reference=${f} ${f}.new
|
||||
mv ${f}.new ${f}
|
||||
|
@ -40,7 +40,7 @@ if test -e ${config} ; then
|
||||
echo "BUILD: ${config}"
|
||||
. ${config}
|
||||
else
|
||||
echo -n "BUILD ERROR: Unable to locate test configuration '${config}' from " && pwd
|
||||
printf "BUILD ERROR: Unable to locate test configuration '%s' from " "${config}" && pwd
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user