Browse Source

Do not hardcode "sid" as default for cowbuilder dist, support setting COWBUILDER_DIST [Closes #8]

On e.g. Ubuntu "sid" isn't supported, so we can't just hardcode it.
Instead support setting COWBUILDER_DIST via /etc/jenkins/debian_glue
and if it's not set then use "$distribution" if it's set, otherwise
default to the currently running distribution and just fallback to
"sid" if none of all of that worked.

Thanks: Daniel Thomas for the detailed bugreport
merge-requests/109/head
Michael Prokop 11 years ago
parent
commit
fae2428bf4
  1. 21
      scripts/build-and-provide-package

21
scripts/build-and-provide-package

@ -155,13 +155,24 @@ identify_sourcefile() {
}
dist_and_arch_settings() {
if [ -z "${distribution:-}" ]; then
echo "*** No distribution set, using sid for base.cow if it does not exist yet. ***"
COWBUILDER_DIST="sid"
if [ -n "${COWBUILDER_DIST:-}" ]; then
echo "*** COWBUILDER_DIST is set to $COWBUILDER_DIST - using it for base.cow if it does not exist yet. ***"
else
echo "*** Using cowbuilder base for distribution ${distribution} ***"
if [ -n "${distribution:-}" ]; then
echo "*** Using cowbuilder base for distribution ${distribution} ***"
COWBUILDER_DIST="${distribution}"
else
# default to the currently running distribution to avoid hardcoding
# a distribution which might not be supported by the running system
local distri_codename=$(lsb_release --short --codename 2>/dev/null)
[ -n "${distri_codename:-}" ] || distri_codename="sid" # fallback to "sid" iff lsb_release fails
echo "*** Neither COWBUILDER_DIST nor distribution set - using ${distri_codename} for base.cow if it does not exist yet. ***"
COWBUILDER_DIST="${distri_codename}"
fi
fi
if [ -n "${distribution:-}" ] ; then
DIST="-${distribution}"
COWBUILDER_DIST="${distribution}"
fi
if [ -z "${architecture:-}" ] || [ "${architecture:-}" = "all" ] ; then

Loading…
Cancel
Save