From 6259513b0f32ebcee5e3e8ad840e7962554f4c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20P=C3=A9ters?= Date: Sun, 11 Jul 2010 20:40:23 +0200 Subject: [PATCH] [build] Use dpkg-checkbuilddeps to check for installed packages This is required to handle Provides header, as used by lib*-dev packages (for example libtiff5-dev provides libtiff-dev), this allows the build setup script to specify the "generic" package names. https://bugzilla.gnome.org/show_bug.cgi?id=624009 --- tools/build/gnome-shell-build-setup.sh | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/tools/build/gnome-shell-build-setup.sh b/tools/build/gnome-shell-build-setup.sh index ed7ca5222..a43b7f981 100755 --- a/tools/build/gnome-shell-build-setup.sh +++ b/tools/build/gnome-shell-build-setup.sh @@ -69,22 +69,13 @@ fi # # (*) only needed for --xephyr -# Can this be simplified? Obvious ways don't handle handle packages -# that have been installed then removed. ('purged' status, e.g.) -dpkg_is_installed() { - status=`dpkg-query --show --showformat='${Status}' $1 2>/dev/null` - if [ $? = 0 ] ; then - set $status - if [ "$3" = installed ] ; then - return 0 - fi - fi - - return 1 -} - if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then reqd="" + if [ ! -x /usr/bin/dpkg-checkbuilddeps ]; then + echo "Please run 'sudo apt-get install dpkg-dev' and try again." + echo + exit 1 + fi for pkg in \ build-essential curl \ automake bison flex gettext git-core gnome-common gtk-doc-tools gvfs gvfs-backends \ @@ -94,7 +85,7 @@ if test x$system = xUbuntu -o x$system = xDebian -o x$system = xLinuxMint ; then python-dev python-gconf python-gobject xulrunner-dev xserver-xephyr gnome-terminal \ libcroco3-dev libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good \ ; do - if ! dpkg_is_installed $pkg; then + if ! dpkg-checkbuilddeps -d $pkg /dev/null 2> /dev/null; then reqd="$pkg $reqd" fi done