[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] Automatically identify the suite to use for udeb fetching



From: Otavio Salvador <otavio@ossystems.com.br>

To try to work out of box for most situations we use
/etc/debian_version to detect default to use host source.list
information to detect from which suite to grab udebs from but allow
to be overridden by auto-builders.

After this change, following use-cases are covered:

 - Building from UNRELEASED code: default to unstable;

 - If /etc/debian_chroot exists, check it for experimental;

 - Otherwise, use package suite as target.

The logic behind this behavior change consider those facts:

 - No upload will be done using 'stable' or 'oldstable' as target
   suite (code checks for it and fails);

 - BinNMUs set the target suite according.

Signed-off-by: Otavio Salvador <otavio@debian.org>
---
 debian/changelog |    3 +++
 debian/rules     |   20 +++++++++++++++++---
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 38fd990..3af02bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -189,6 +189,9 @@ debian-installer (2011xxxx) UNRELEASED; urgency=low
   * Replace kbd-chooser with console-setup-udeb+kbd-udeb, and
     console-keymaps-* with console-setup-*-ekmap.
 
+  [ Otavio Salvador ]
+  * Automatically identify the suite to use for udeb fetching.
+
  -- Jurij Smakov <jurij@debian.org>  Mon, 20 Feb 2012 21:02:22 +0000
 
 debian-installer (20110106) unstable; urgency=low
diff --git a/debian/rules b/debian/rules
index 60e2f41..07318af 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,14 +3,28 @@
 ARCH=$(shell dpkg-architecture -qDEB_BUILD_ARCH)
 VERSION=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Version: | cut -d ' ' -f 2)
 DATE=$(shell echo $(VERSION) | cut -d '.' -f 1)
-SUITE=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Distribution: | cut -d ' ' -f 2)
-ifeq (${SUITE},UNRELEASED)
+
+PKG_SUITE=$(shell LC_ALL=C dpkg-parsechangelog | grep ^Distribution: | cut -d ' ' -f 2)
+
+ifeq (${PKG_SUITE},$(filter ${PKG_SUITE},stable oldstable))
+	@echo "ERROR: you need to use suite codename for installer uploads."
+	@exit 1
+endif
+
+ifeq (${PKG_SUITE},UNRELEASED)
 USE_UDEBS_FROM=unstable
+USE_PROPOSED_UPDATES=0
 TRANSSTATUS=
 BOOTMENU_BEEP=n
 else
-USE_UDEBS_FROM=wheezy
+EXPERIMENTAL_TARGET=$(shell [ -e /etc/debian_chroot ] && grep -q 'experimental' /etc/debian_chroot && echo "yes" || echo "no")
+ifeq (${EXPERIMENTAL_TARGET},yes)
+USE_UDEBS_FROM=experimental
 USE_PROPOSED_UPDATES=0
+else
+USE_UDEBS_FROM=${PKG_SUITE}
+USE_PROPOSED_UPDATES=1
+endif
 TRANSSTATUS=translation-status
 BOOTMENU_BEEP=y
 endif
-- 
1.7.9.1


Reply to: