Loop Over AWL Directory Candidates

Using this method we're able to loop over the candidate directories
until we find what should be suitable AWL location. Further, adding
additional locations is as simple as adding a new line to ${awldirs}.

It does have the limitation that if the path has a new line in it
(/some/ridic
ulous/path), it'll treat it as two different paths. However, if
somebody seriously has that, they deserve the pain.
This commit is contained in:
Aaron W. Swenson committed 2014-11-14 13:44:39 -05:00
1 parent ccfff62118
commit cfd5fd7555
2 files changed
+43 -23

No files matched your search

+22 -9
View File
@@ -10,17 +10,30 @@
PODIR="po"
LOCALEDIR="locale"
APPLICATION="davical"
AWL_LOCATION="../awl"
if [ ! -d "${AWL_LOCATION}" ]; then
AWL_LOCATION="`find .. -type d -name 'awl-*.*'`"
if [ ! -d "${AWL_LOCATION}" ]; then
AWL_LOCATION=/usr/share/awl
if [ ! -d "${AWL_LOCATION}" ]; then
echo "I can't find a location for the AWL libraries and I need those strings too"
exit 1
awldirs="../awl
`find .. -type d -name 'awl-*.*'`
/usr/share/awl
/usr/share/php/awl
/usr/local/share/awl"
# Disable globbing and use newline as seperator
set -f; IFS='
'
for d in $awldirs ; do
if [ -d "${d}" ] ; then
AWL_LOCATION="${d}"
break
fi
fi
done
# Renable file globbing and reset seperator
set +f; unset IFS
if [ -z "${AWL_LOCATION}" ] ; then
echo "I can't find a location for the AWL libraries and I need those strings too"
exit 1
fi
egrep -l '(i18n|translate)' htdocs/*.php inc/*.php inc/ui/*.php > ${PODIR}/pofilelist.tmp1