Browse Source

Always include $distribution in cow base name [closes #17]

This change might cause your system to create a new base.cow from
scratch. This doesn't cause any harm but increases disk space due
to the duplication. Though the change is useful because it makes
usage of $distribution much easier and also shows which
distribution you're actually building against.

To avoid the recreation of the base.cow run something like
(adjust "squeeze" for the distribution and "amd64" for the
architecture you're using):

|  cd /var/cache/pbuilder
|  mv base-amd64.cow base-squeeze-amd64.cow

Thanks: Christoph Berg for the suggestion
merge-requests/109/head
Michael Prokop 10 years ago
parent
commit
a12b28a7fe
  1. 21
      scripts/build-and-provide-package

21
scripts/build-and-provide-package

@ -128,7 +128,13 @@ identify_sourcefile() {
dist_and_arch_settings() {
if [ -n "${distribution:-}" ] ; then
DIST="-${distribution}"
local DIST="-${distribution}"
else
# default to the currently running distribution to avoid hardcoding
# a distribution which might not be supported by the running system
local distribution=$(lsb_release --short --codename 2>/dev/null)
[ -n "${distribution}" ] || distribution="sid" # fallback to "sid" iff lsb_release fails
local DIST="-$distribution"
fi
if [ -z "${architecture:-}" ] || [ "${architecture:-}" = "all" ] ; then
@ -149,17 +155,8 @@ dist_and_arch_settings() {
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
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
echo "*** Using cowbuilder base for distribution ${distribution} ***"
COWBUILDER_DIST="${distribution}"
fi
}

Loading…
Cancel
Save