* pbuilder-dist:

- Fallback to calling lsb_release if /etc/lsb-release doesn't
     exist; this makes it possible to run pbuilder-dist on Debian.
This commit is contained in:
Siegfried-Angel Gevatter Pujals 2009-04-18 23:38:52 +02:00
parent 4d314779fd
commit ad0ee7b350
2 changed files with 18 additions and 11 deletions

6
debian/changelog vendored
View File

@ -1,8 +1,10 @@
ubuntu-dev-tools (0.73) UNRELEASED; urgency=low
*
* pbuilder-dist:
- Fallback to calling lsb_release if /etc/lsb-release doesn't
exist; this makes it possible to run pbuilder-dist on Debian.
-- Scott Kitterman <scott@kitterman.com> Wed, 15 Apr 2009 23:06:54 -0400
-- Siegfried-Angel Gevatter Pujals <rainct@ubuntu.com> Sat, 18 Apr 2009 23:37:55 +0200
ubuntu-dev-tools (0.72) jaunty; urgency=low

View File

@ -101,15 +101,20 @@ class pbuilder_dist:
if not self.system_architecture or 'not found' in self.system_architecture:
print 'Error: Not running on a Debian based system; could not detect its architecture.'
if not os.path.isfile('/etc/lsb-release'):
print 'Error: Not running on a Debian based system; could not find /etc/lsb-release.'
exit(1)
for line in open('/etc/lsb-release'):
line = line.strip()
if line.startswith('DISTRIB_CODENAME'):
self.system_distro = line[17:]
break
if os.path.isfile('/etc/lsb-release'):
for line in open('/etc/lsb-release'):
line = line.strip()
if line.startswith('DISTRIB_CODENAME'):
self.system_distro = line[17:]
break
else:
import commands
output = commands.getoutput('lsb_release -c').split()
if len(output) == 2:
self.system_distro = output[1]
else:
print 'Error: Not running on a Debian based system; could not find lsb_release.'
exit(1)
if not self.system_distro:
print 'Error: Could not determine what distribution you are running.'