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

Re: Bug#624769: lsb-release: wrong output on debian-ports architectures breaks other packages



tags 624769 +patch
thanks

Le 24.02.2012 19:49, Thorsten Glaser a écrit :
>> does the attached patch on lsb_release.py fix this bug ?
> 
> Sorry, it doesn’t.

Eh, don't be sorry !

And does that one (cleaner, IMHO) help now ? It should at least allow
the apt-cache policy 'Debian Ports' release line go further down the
processing.

Cheers,

OdyX

From ab7965c476c124e4af8194e0c01cba92c76ad1ed Mon Sep 17 00:00:00 2001
From: Didier Raboud <odyx@debian.org>
Date: Mon, 27 Feb 2012 14:53:50 +0100
Subject: [PATCH] Recognise Debian Ports as `sid` too.

This extends the interface of guess_release_from_apt to accept new origin -
label pairs, with a default to accept 'Debian Ports': 'ftp.debian-ports.org'
at least.

Closes: #624769
Reported-by: Thorsten Glaser <tg@mirbsd.de>
Signed-off-by: Didier Raboud <odyx@debian.org>
---
 lsb_release.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/lsb_release.py b/lsb_release.py
index d65e933..7979f21 100644
--- a/lsb_release.py
+++ b/lsb_release.py
@@ -166,7 +166,8 @@ def parse_apt_policy():
 
 def guess_release_from_apt(origin='Debian', component='main',
                            ignoresuites=('experimental'),
-                           label='Debian'):
+                           label='Debian',
+                           alternate_olabels={'Debian Ports':'ftp.debian-ports.org'}):
     releases = parse_apt_policy()
 
     if not releases:
@@ -176,7 +177,9 @@ def guess_release_from_apt(origin='Debian', component='main',
     releases = [x for x in releases if (
         x[1].get('origin', '') == origin and
         x[1].get('component', '') == component and
-        x[1].get('label', '') == label)]
+        x[1].get('label', '') == label) or (
+        x[1].get('origin', '') in alternate_olabels and
+        x[1].get('label', '') == alternate_olabels.get(x[1].get('origin', '')))]
 
     # Check again to make sure we didn't wipe out all of the releases
     if not releases:
-- 
1.7.2.5

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: