Index: build/install-build-deps.sh |
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh |
index 756186d49dee1630bbe0b9da5866545d7b792e7e..e4743cedb2208165404a1b275ce55e5f2e9fee60 100755 |
--- a/build/install-build-deps.sh |
+++ b/build/install-build-deps.sh |
@@ -21,6 +21,12 @@ usage() { |
exit 1 |
} |
+# Checks whether a particular package is available in the repos. |
+# USAGE: $ satisfiable <package name> |
+satisfiable() { |
Paweł Hajdan Jr.
2013/05/28 19:06:27
nit: Let's change the name from very generic to on
Lambros
2013/05/28 19:09:54
+1 on renaming
|
+ apt-cache --no-generate pkgnames | grep -x $1 > /dev/null 2>&1 |
Paweł Hajdan Jr.
2013/05/28 19:06:27
Why --no-generate? Just asking for better understa
Lambros
2013/05/28 19:09:54
style nit: "$1". We prefer to quote variables, eve
|
+} |
+ |
while test "$1" != "" |
do |
case "$1" in |
@@ -123,24 +129,24 @@ arm_list="libc6-armel-cross libc6-dev-armel-cross libgcc1-armel-cross |
# Some package names have changed over time |
-if apt-cache show ttf-mscorefonts-installer >/dev/null 2>&1; then |
+if satisfiable ttf-mscorefonts-installer; then |
dev_list="${dev_list} ttf-mscorefonts-installer" |
else |
dev_list="${dev_list} msttcorefonts" |
fi |
-if apt-cache show libnspr4-dbg >/dev/null 2>&1; then |
+if satisfiable libnspr4-dbg; then |
dbg_list="${dbg_list} libnspr4-dbg libnss3-dbg" |
lib_list="${lib_list} libnspr4 libnss3" |
else |
dbg_list="${dbg_list} libnspr4-0d-dbg libnss3-1d-dbg" |
lib_list="${lib_list} libnspr4-0d libnss3-1d" |
fi |
-if apt-cache show libjpeg-dev >/dev/null 2>&1; then |
+if satisfiable libjpeg-dev; then |
dev_list="${dev_list} libjpeg-dev" |
else |
dev_list="${dev_list} libjpeg62-dev" |
fi |
-if apt-cache show libudev1 >/dev/null 2>&1; then |
+if satisfiable libudev1; then |
dev_list="${dev_list} libudev1" |
else |
dev_list="${dev_list} libudev0" |
@@ -149,7 +155,7 @@ fi |
# Some packages are only needed, if the distribution actually supports |
# installing them. |
-if apt-cache show appmenu-gtk >/dev/null 2>&1; then |
+if satisfiable appmenu-gtk; then |
lib_list="$lib_list appmenu-gtk" |
fi |