mk-sbuild: Add ubuntu_dist_ge and use it to set BUILD_PKGS for Ubuntu.

This commit is contained in:
Adam Conrad 2018-04-24 05:12:33 -06:00
parent 1f7b7ea4ff
commit 92822060b2
2 changed files with 39 additions and 4 deletions

6
debian/changelog vendored
View File

@ -1,3 +1,9 @@
ubuntu-dev-tools (0.163) unstable; urgency=medium
* mk-sbuild: Add ubuntu_dist_ge and use it to set BUILD_PKGS for Ubuntu.
-- Adam Conrad <adconrad@ubuntu.com> Tue, 24 Apr 2018 05:11:18 -0600
ubuntu-dev-tools (0.162) unstable; urgency=medium
[ Mattia Rizzolo ]

View File

@ -330,6 +330,29 @@ elif [ -z "$DISTRO" ]; then
exit 1
fi
if [ "$DISTRO" = "ubuntu" ]; then
ubuntu_dist_ge() {
local releases="$(ubuntu-distro-info --all)"
local seq=1
for i in $releases; do
if [ $1 = $i ]; then
local left=$seq
break
fi
seq=$((seq+1))
done
seq=1
for i in $releases; do
if [ $2 = $i ]; then
local right=$seq
break
fi
seq=$((seq+1))
done
[ $left -ge $right ] && return 0 || return 1
}
fi
# By default, name the schroot the same as the release
if [ -z "$name" ]; then
name="$RELEASE"
@ -494,11 +517,17 @@ ubuntu)
esac
fi
# Add edgy+ buildd tools
if [ "$RELEASE" != "breezy" ] && [ "$RELEASE" != "dapper" ]; then
if ubuntu_dist_ge "$RELEASE" "edgy"; then
# Add pkgbinarymangler (edgy and later)
BUILD_PKGS="$BUILD_PKGS pkgbinarymangler"
# Disable recommends for a smaller chroot (gutsy and later only)
BUILD_PKGS="--no-install-recommends $BUILD_PKGS"
# Add buildd tools
BUILD_PKGS="$BUILD_PKGS pkg-create-dbgsym pkgbinarymangler"
if ubuntu_dist_ge "$RELEASE" "gutsy"; then
BUILD_PKGS="--no-install-recommends $BUILD_PKGS"
fi
# Add pkg-create-dbgsym (edgy through zesty)
if ! ubuntu_dist_ge "$RELEASE" "artful"; then
BUILD_PKGS="$BUILD_PKGS pkg-create-dbgsym"
fi
fi
;;
debian)