Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1365)

Unified Diff: build/install-build-deps.sh

Issue 15741015: Change detection method for checking package name changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased against upstream Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/install-build-deps.sh
diff --git a/build/install-build-deps.sh b/build/install-build-deps.sh
index cc3728f1ed8b682f2021769c798b9c33bddd81e8..c858fa018eebb25b79f01bd9eb281a9b0219843a 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: $ package_exists <package name>
+package_exists() {
+ apt-cache pkgnames | grep -x "$1" > /dev/null 2>&1
+}
+
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 package_exists 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 package_exists 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 package_exists libjpeg-dev; then
dev_list="${dev_list} libjpeg-dev"
else
dev_list="${dev_list} libjpeg62-dev"
fi
-if [ "$(apt-cache pkgnames libudev1 2>&1)" == "libudev1" ] ; then
+if package_exists 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 package_exists appmenu-gtk; then
lib_list="$lib_list appmenu-gtk"
fi
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698