From b742d58794c456f6612d38431401cfa0d8c1acf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcus=20H=C3=BCwe?= Date: Tue, 4 Aug 2009 16:01:02 +0000 Subject: [PATCH] - determine pacsuffix from buildtype (slightly modified version of David Greaves' patch) --- osc/build.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/osc/build.py b/osc/build.py index 16e1a475..09790230 100644 --- a/osc/build.py +++ b/osc/build.py @@ -53,7 +53,7 @@ if hostarch == 'i686': # FIXME class Buildinfo: """represent the contents of a buildinfo file""" - def __init__(self, filename, apiurl): + def __init__(self, filename, apiurl, buildtype = 'spec'): try: tree = ET.parse(filename) @@ -73,15 +73,13 @@ class Buildinfo: if not (apiurl.startswith('https://') or apiurl.startswith('http://')): raise urllib2.URLError('invalid protocol for the apiurl: \'%s\'' % apiurl) - # are we building .rpm or .deb? - # need the right suffix for downloading - # if a package named debhelper is in the dependencies, it must be .deb + self.buildtype = buildtype + + # are we building .rpm or .deb? # XXX: shouldn't we deliver the type via the buildinfo? self.pacsuffix = 'rpm' - for node in root.findall('bdep'): - if node.get('name') == 'debhelper': - self.pacsuffix = 'deb' - break + if self.buildtype == 'dsc': + self.pacsuffix = 'deb' self.buildarch = root.find('arch').text self.downloadurl = root.get('downloadurl') @@ -363,7 +361,7 @@ def main(opts, argv): bi_file.write(bi_text) bi_file.flush() - bi = Buildinfo(bi_file.name, apiurl) + bi = Buildinfo(bi_file.name, apiurl, build_type) if bi.debuginfo and not opts.disable_debuginfo: buildargs.append('--debug') buildargs = ' '.join(set(buildargs))