summaryrefslogtreecommitdiff
blob: e0105bffbd2f6ea9aaa8a46f1e408061015df283 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
diff --git a/dba/create-database.sh b/dba/create-database.sh
index b1dd1fa..d25f9d9 100755
--- a/dba/create-database.sh
+++ b/dba/create-database.sh
@@ -10,22 +10,29 @@ DBADIR="`dirname \"$0\"`"
 
 INSTALL_NOTE_FN="`mktemp -t tmp.XXXXXXXXXX`"
 
-testawldir() {
-  [ -f "${1}/dba/awl-tables.sql" ]
-}
 
-#
-# Attempt to locate the AWL directory
-AWLDIR="${DBADIR}/../../awl"
-if ! testawldir "${AWLDIR}"; then
-  AWLDIR="/usr/share/awl"
-  if ! testawldir "${AWLDIR}"; then
-    AWLDIR="/usr/local/share/awl"
-    if ! testawldir "${AWLDIR}"; then
-      echo "Unable to find AWL libraries"
-      exit 1
+# Candidate locations of the AWL directory
+awldirs="${DBADIR}/../../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 [ -f "${d}/dba/awl-tables.sql" ] ; then
+	AWLDIR="${d}"
+	break
     fi
-  fi
+done
+
+# Renable file globbing and reset seperator 
+set +f; unset IFS
+
+if [ -z "${AWLDIR}" ] ; then
+    echo "Unable to find AWL libraries"
+    exit 1
 fi
 
 export AWL_DBAUSER=davical_dba
diff --git a/scripts/po/rebuild-translations.sh b/scripts/po/rebuild-translations.sh
index 7191615..809fa8c 100755
--- a/scripts/po/rebuild-translations.sh
+++ b/scripts/po/rebuild-translations.sh
@@ -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