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

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

Issue 2519523002: Fix install-build-deps.sh --quick-check (Closed)
Patch Set: Created 4 years, 1 month 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 832d116beeeb6aa3fcf76d6db653eb3c868d0dc0..44c5a1d46ccda5fee3a658a1158f1f4ed1541fcf 100755
--- a/build/install-build-deps.sh
+++ b/build/install-build-deps.sh
@@ -372,35 +372,28 @@ packages="$(
)"
if [ 1 -eq "${do_quick_check-0}" ] ; then
- failed_check="$(dpkg-query -W -f '${PackageSpec}:${Status}\n' \
- ${packages} 2>&1 | grep -v "ok installed" || :)"
- if [ -n "${failed_check}" ]; then
- echo
- nomatch="$(echo "${failed_check}" | \
- sed -e "s/^No packages found matching \(.*\).$/\1/;t;d")"
- missing="$(echo "${failed_check}" | \
- sed -e "/^No packages found matching/d;s/^\(.*\):.*$/\1/")"
- if [ "$nomatch" ]; then
- # Distinguish between packages that actually aren't available to the
- # system (i.e. not in any repo) and packages that just aren't known to
- # dpkg (i.e. managed by apt).
- unknown=""
- for p in ${nomatch}; do
- if apt-cache show ${p} > /dev/null 2>&1; then
- missing="${p}\n${missing}"
- else
- unknown="${p}\n${unknown}"
- fi
- done
- if [ -n "${unknown}" ]; then
- echo "WARNING: The following packages are unknown to your system"
- echo "(maybe missing a repo or need to 'sudo apt-get update'):"
- echo -e "${unknown}" | sed -e "s/^/ /"
+ if ! missing_packages="$(dpkg-query -W -f ' ' ${packages} 2>&1)"; then
+ # Distinguish between packages that actually aren't available to the
+ # system (i.e. not in any repo) and packages that just aren't known to
+ # dpkg (i.e. managed by apt).
+ missing_packages="$(echo "${missing_packages}" | awk '{print $NF}')"
+ not_installed=""
+ unknown=""
+ for p in ${missing_packages}; do
+ if apt-cache show ${p} > /dev/null 2>&1; then
+ not_installed="${p}\n${not_installed}"
+ else
+ unknown="${p}\n${unknown}"
fi
- fi
- if [ -n "${missing}" ]; then
+ done
+ if [ -n "${not_installed}" ]; then
echo "WARNING: The following packages are not installed:"
- echo -e "${missing}" | sed -e "s/^/ /"
+ echo -e "${not_installed}" | sed -e "s/^/ /"
+ fi
+ if [ -n "${unknown}" ]; then
+ echo "WARNING: The following packages are unknown to your system"
+ echo "(maybe missing a repo or need to 'sudo apt-get update'):"
+ echo -e "${unknown}" | sed -e "s/^/ /"
fi
exit 1
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