Make update_po_files.sh run on macOS...

... BSD version of sed doesn't know -r, but does know -E.

BSD versions of head and tail didn't know --lines= but do know -n.

Also changed the mode to executable and added #! line.
This commit is contained in:
Paul Licameli 2018-10-29 14:14:09 -04:00
parent 9c9bc70e9b
commit 79cf475c87
1 changed files with 4 additions and 3 deletions

7
locale/update_po_files.sh Normal file → Executable file
View File

@ -1,6 +1,7 @@
#!/bin/sh
echo ";; Recreating audacity.pot using .h, .cpp and .mm files"
for path in ../lib-src/FileDialog ../lib-src/mod-script* ../lib-src/mod-nyq* ../include ../src ; do find $path -name \*.h -o -name \*.cpp -o -name \*.mm ; done | LANG=c sort | \
sed -r 's/\.\.\///g' |\
sed -E 's/\.\.\///g' |\
xargs xgettext \
--default-domain=audacity \
--directory=.. \
@ -14,7 +15,7 @@ xargs xgettext \
--add-location=file -L C -o audacity.pot
echo ";; Adding nyquist files to audacity.pot"
for path in ../plug-ins ; do find $path -name \*.ny -not -name rms.ny; done | LANG=c sort | \
sed -r 's/\.\.\///g' |\
sed -E 's/\.\.\///g' |\
xargs xgettext \
--default-domain=audacity \
--directory=.. \
@ -36,5 +37,5 @@ done
echo ""
echo ";;Translation updated"
echo ""
head --lines=11 audacity.pot | tail --lines=3
head -n 11 audacity.pot | tail -n 3
wc -l audacity.pot