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

Bug#845651: lsb-release: --codename returns n/a on stretch without apt sources configured



Package: lsb-release
Version: 9.20161101
Severity: important
Tags: patch

Dear maintainer,

Currently lsb_release parses /etc/debian_version and figures out the
testing codename and stores it. But it never uses it unless apt can be
used, which depends on network access.
Without network access and apt sources downloaded, lsb_release -c on
stretch returns n/a. So a simple way to reproduce it is to comment out
all entries in sources.list(.d/*), apt-get update and running
lsb_release -c on stretch.

The fix is simple and just sets the codename after
parsing /etc/debian_release.
A simple patch is attached.

Thank you!

Kind regards,
Luca Boccassi


From c7de044f737f6df4ba8e6501fcb106aecc83e577 Mon Sep 17 00:00:00 2001
From: Luca Boccassi <lboccass@brocade.com>
Date: Fri, 25 Nov 2016 15:26:17 +0000
Subject: [PATCH] Fix detecting debian testing release without apt

Currently lsb_release parses /etc/debian_version and figures out the
testing codename and stores it. But it never uses it unless apt can
be used, which depends on network access.
Without network access and apt sources downloaded, lsb_release -c
on stretch returns n/a.
The fix is simple and just sets the codename after parsing
/etc/debian_release.
---
 lsb_release.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lsb_release.py b/lsb_release.py
index 221a321..f134518 100644
--- a/lsb_release.py
+++ b/lsb_release.py
@@ -273,6 +273,7 @@ def guess_debian_release():
             if release.rstrip('/sid').lower() != 'testing':
                 global TESTING_CODENAME
                 TESTING_CODENAME = release.rstrip('/sid')
+                distinfo['CODENAME'] = release.rstrip('/sid')
             distinfo['RELEASE'] = 'testing/unstable'
         else:
             distinfo['RELEASE'] = release
-- 
2.1.4

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: