Skip to content

Commit

Permalink
Merge branch 'wip-dmick-install-deps-master'
Browse files Browse the repository at this point in the history
install-deps.sh: use mk-build-deps instead of processing control

Reviewed-by: Erwan Velu <erwan@redhat.com>
Reviewed-by: Josh Durgin <jdurgin@redhat.com>
  • Loading branch information
jdurgin committed Jun 21, 2016
2 parents 9f15f03 + 99bca09 commit f7fc985
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions install-deps.sh
Expand Up @@ -61,7 +61,7 @@ if test -f /etc/redhat-release ; then
fi

if type apt-get > /dev/null 2>&1 ; then
$SUDO apt-get install -y lsb-release
$SUDO apt-get install -y lsb-release devscripts equivs
fi

if type zypper > /dev/null 2>&1 ; then
Expand All @@ -76,20 +76,23 @@ Ubuntu|Debian|Devuan)
exit 1
fi
touch $DIR/status
packages=$(dpkg-checkbuilddeps --admindir=$DIR debian/control 2>&1 | \
perl -p -e 's/.*Unmet build dependencies: *//;' \
-e 's/build-essential:native/build-essential/;' \
-e 's/\s*\|\s*/\|/g;' \
-e 's/\(.*?\)//g;' \
-e 's/ +/\n/g;' | sort)

backports=""
control="debian/control"
case $(lsb_release -sc) in
squeeze|wheezy)
packages=$(echo $packages | perl -pe 's/[-\w]*babeltrace[-\w]*//g')
control="/tmp/control.$$"
grep -v babeltrace debian/control > $control
backports="-t $(lsb_release -sc)-backports"
;;
esac
packages=$(echo $packages) # change newlines into spaces
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get install $backports -y $packages || exit 1

# make a metapackage that expresses the build dependencies,
# install it, rm the .deb; then uninstall the package as its
# work is done
$SUDO env DEBIAN_FRONTEND=noninteractive mk-build-deps --install --remove --tool="apt-get -y --no-install-recommends $backports" $control || exit 1
$SUDO env DEBIAN_FRONTEND=noninteractive apt-get -y remove ceph-build-deps
if [ -n "$backports" ] ; then rm $control; fi
;;
CentOS|Fedora|RedHatEnterpriseServer)
case $(lsb_release -si) in
Expand Down

0 comments on commit f7fc985

Please sign in to comment.