From b68895d1295dc8c90b8baa5180ca919da2c1c327 Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Mon, 5 Sep 2011 02:31:06 +0200 Subject: [PATCH] Recommend pbuilder | aptitude for get-build-deps, and exit with an error if neither are installed (LP: #799368) --- debian/changelog | 2 ++ debian/control | 1 + get-build-deps | 19 ++++++++++--------- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/debian/changelog b/debian/changelog index 452a478..6cad5c8 100644 --- a/debian/changelog +++ b/debian/changelog @@ -21,6 +21,8 @@ ubuntu-dev-tools (0.129) UNRELEASED; urgency=low native syncs. (Bugs are closed one individually, via the API, post-sync) * dgetlp, submittodebian, 404main: Use unicode strings for literal strings containing non-ASCII characters (LP: #836661) + * Recommend pbuilder | aptitude for get-build-deps, and exit with an error + if neither are installed (LP: #799368) -- Stefano Rivera Sat, 03 Sep 2011 21:04:38 +0200 diff --git a/debian/control b/debian/control index d616ac8..d20224d 100644 --- a/debian/control +++ b/debian/control @@ -51,6 +51,7 @@ Recommends: bzr, debootstrap, genisoimage, libwww-perl, + pbulider | aptitude, pbuilder | cowdancer | sbuild, perl-modules, python-dns, diff --git a/get-build-deps b/get-build-deps index a77f1fa..7125020 100755 --- a/get-build-deps +++ b/get-build-deps @@ -32,8 +32,7 @@ # argument is the name of a package, and install the dependencies for # all of them. -if [ $# -eq 0 ] -then +if [ $# -eq 0 ]; then ######################################################### # Install the dependencies for the source package the # user is working on. @@ -57,24 +56,26 @@ to use this script." exit 0 fi + if [ ! -x /usr/lib/pbuilder/pbuilder-satisfydepends -a -z "$(which aptitude)" ]; then + echo "Please install either «pbuilder» or «aptitude» in order to use this utility" + exit 1 + fi + echo "Installing the build dependencies described in «$filepath»..." - if [ -x /usr/lib/pbuilder/pbuilder-satisfydepends ] - then + if [ -x /usr/lib/pbuilder/pbuilder-satisfydepends ]; then sudo /usr/lib/pbuilder/pbuilder-satisfydepends else - echo "Warning: «pbuilder» isn\'t installed, falling back to «dpkg-checkbuilddeps»." + echo "Warning: «pbuilder» isn't installed, falling back to «dpkg-checkbuilddeps»." sudo aptitude install $(echo $missing_dependencies | awk -F': ' '{ print $3 }' | sed 's/([^)]*)//g' | sed 's/|\s[^\s]*//g') #' <--- Fix to avoid Geanys markup breaking fi exit 0 -elif [ $# -eq 1 ] -then +elif [ $# -eq 1 ]; then ######################################################### # Check if the given argument is a file name, else # continue after the if. - if [ -f $1 ] - then + if [ -f $1 ]; then packages='' echo "Installing the build dependencies for the following packages:" while read line