File: debootstrap-add-fallback-for-Debian-SID-distro.patch

package info (click to toggle)
obs-build 20190710-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,660 kB
  • sloc: perl: 10,153; sh: 3,084; ansic: 284; makefile: 170
file content (39 lines) | stat: -rw-r--r-- 1,635 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
From: =?utf-8?b?SMOpY3RvciBPcsOzbiBNYXJ0w61uZXo=?=
 <hector.oron@collabora.co.uk>
Date: Mon, 6 Nov 2017 15:55:02 +0100
Subject: debootstrap: add fallback for Debian SID distro
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

  When attempting to build Debian unstable, distribution is
  calculated using lsb, which relies on apt cache. As our
  build systems lack apt cache and network we cannot detect
  we are building for Debian SID (aka unstable).
  For more background information see: DebianBug#845651

Signed-off-by: Héctor Orón Martínez <hector.oron@collabora.co.uk>
Tested-by: Héctor Orón Martínez <hector.oron@collabora.co.uk>
Forwarded: https://github.com/openSUSE/obs-build/pull/460
Last-Update: 2018-08-30
---
 build-recipe-debootstrap | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/build-recipe-debootstrap b/build-recipe-debootstrap
index 2404fdc..f28cdfc 100644
--- a/build-recipe-debootstrap
+++ b/build-recipe-debootstrap
@@ -31,7 +31,11 @@ recipe_prepare_debootstrap() {
 
 recipe_build_debootstrap() {
     local arch=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
-    local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
+    if $(chroot $BUILD_ROOT grep -q '/sid' /etc/debian_version) ; then
+        local dist=unstable
+    else
+        local dist=$(chroot $BUILD_ROOT su -c "lsb_release --codename --short")
+    fi
     local myroot=debootstraproot
     test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
     if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/dists" ; then