From: Chris Lawrence Date: Mon, 27 Sep 2010 06:15:49 +0000 (-0500) Subject: lsb 3.2-25 Debian release. X-Git-Tag: archive/raspbian/10.2018112800+rpi1^2~201 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bdc596fff08c2253ca2000d10df2edd5cabd0a53;p=lsb.git lsb 3.2-25 Debian release. --- diff --git a/debian/changelog b/debian/changelog index 224e223..afb1c37 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +lsb (3.2-25) unstable; urgency=low + + * Improve release comparison function when 'suite' is missing from + sources.list. (Closes: #597667) + * return 3 in pidofproc() if we can't track down a running copy of + the process and the pidfile is missing. (Closes: #597628) + * Correct location of README.Debian.gz in lsb(8). (Closes: #589100) + * Add link to LSB specification in lsb(8). (Closes: #589102) + + -- Chris Lawrence Mon, 27 Sep 2010 01:15:49 -0500 + lsb (3.2-24) unstable; urgency=low * Improve detection of Debian version when there is a "tie" in diff --git a/init-functions b/init-functions index 67f2fb0..57444b8 100644 --- a/init-functions +++ b/init-functions @@ -91,7 +91,7 @@ pidofproc () { fi fi fi - if [ -x /bin/pidof -a "$specified" ]; then + if [ -x /bin/pidof -a ! "$specified" ]; then status="0" /bin/pidof -o %PPID -x $1 || status="$?" if [ "$status" = 1 ]; then @@ -99,6 +99,9 @@ pidofproc () { fi return 0 fi + if [ "$specified" ]; then + return 3 # almost certain it's not running + fi return 4 # Unable to determine status } diff --git a/lsb.8 b/lsb.8 index fa6b788..20896ef 100644 --- a/lsb.8 +++ b/lsb.8 @@ -27,8 +27,9 @@ third-party packages. The goal of the LSB is to make it easy to create binary packages that will run on any Linux distribution. For more information on the standard, please see the LSB web site. .SH SEE ALSO -.BR /usr/share/doc/lsb-core/README.Debian +.BR /usr/share/doc/lsb-core/README.Debian.gz .BR http://www.linuxbase.org/ +.BR http://refspecs.freestandards.org/lsb.shtml .SH AUTHOR This manual page was written by Chris Lawrence for the Debian system (but may be used by others). diff --git a/lsb_release.py b/lsb_release.py index 495e7cc..51e6978 100644 --- a/lsb_release.py +++ b/lsb_release.py @@ -36,6 +36,8 @@ RELEASE_CODENAME_LOOKUP = { '3.1' : 'sarge', '4.0' : 'etch', '5.0' : 'lenny', + '6.0' : 'squeeze', + '7.0' : 'wheezy', } TESTING_CODENAME = 'unknown.new.testing' @@ -134,6 +136,18 @@ def parse_policy_line(data): retval[longnames[k]] = v return retval +def compare_release(x, y): + suite_x = y[1].get('suite') + suite_y = x[1].get('suite') + + if suite_x and suite_y: + if suite_x in RELEASES_ORDER and suite_y in RELEASES_ORDER: + return RELEASES_ORDER.index(suite_y)-RELEASES_ORDER.index(suite_x) + else: + return cmp(suite_x, suite_y) + + return 0 + def parse_apt_policy(): data = [] @@ -176,7 +190,7 @@ def guess_release_from_apt(origin='Debian', component='main', max_priority = releases[0][0] releases = [x for x in releases if x[0] == max_priority] - releases.sort(cmp = lambda x,y: RELEASES_ORDER.index(y[1]['suite']) - RELEASES_ORDER.index(x[1]['suite'])) + releases.sort(compare_release) return releases[0][1]