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

Automatically identify the suite to use for udeb fetching



[ Please reply to debian-boot ]

To try to work out of box for most situations we use
/etc/debian_version information to detect from witch suite to
grab udebs from but allow for overriden by auto-builders.

After this change, following use-cases are covered:

 - Building from UNRELEASED code: default to unstable;

 - If /etc/buildd_target exists, use this for suite (to be used by
   buildds)

 - Otherise, use /etc/debian_version to detect the suite to use.


This would allow us to have the experimental building working, using experimental buildds, and use unstable for beta and rc releases. When stable comes, buildds can set the suite according too.

Comments?

--
Otavio Salvador                             O.S. Systems
E-mail: otavio@ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br

From 6a72e0607272838ffdc462fba0f06e429a14dfe6 Mon Sep 17 00:00:00 2001
From: Otavio Salvador <otavio@ossystems.com.br>
Date: Sat, 30 Jul 2011 04:04:45 +0200
Subject: [PATCH] Automatically identify the suite to use for udeb fetching

To try to work out of box for most situations we use
/etc/debian_version information to detect from witch suite to grab
udebs from but allow for overriden by auto-builders.

After this change, following use-cases are covered:

 - Building from UNRELEASED code: default to unstable;

 - If /etc/buildd_target exists, use this for suite (to be used by
   buildds)

 - Otherise, use /etc/debian_version to detect the suite to use.
---
 debian/changelog |    3 +++
 debian/rules     |   15 ++++++++++++---
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index e40cee1..188fb05 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -182,6 +182,9 @@ debian-installer (2011xxxx) UNRELEASED; urgency=low
   [ Jurij Smakov ]
   * Update kernel version to 3.2.0-1.
 
+  [ Otavio Salvador ]
+  * Automatically identify the suite to use for udeb fetching.
+
  -- Jurij Smakov <jurij@debian.org>  Mon, 23 Jan 2012 21:20:41 +0000
 
 debian-installer (20110106) unstable; urgency=low
diff --git a/debian/rules b/debian/rules
index 60e2f41..385c6eb 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,14 +3,23 @@
 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},UNRELEASED)
 USE_UDEBS_FROM=unstable
+USE_PROPOSED_UPDATES=0
 TRANSSTATUS=
 BOOTMENU_BEEP=n
 else
-USE_UDEBS_FROM=wheezy
+BUILDD_TARGET=$(shell [[ -e /etc/buildd_target ]] && sed 's,sid,unstable,g' /etc/buildd_target || echo "")
+ifeq (${BUILDD_TARGET},)
+USE_UDEBS_FROM=$(shell grep -q '/sid$' /etc/debian_version && echo "unstable" || cat /etc/debian_version)
 USE_PROPOSED_UPDATES=0
+else
+USE_UDEBS_FROM=${BUILDD_TARGET}
+USE_PROPOSED_UPDATES=1
+endif
 TRANSSTATUS=translation-status
 BOOTMENU_BEEP=y
 endif
-- 
1.7.9


Reply to: