Mailinglist Archive: opensuse-buildservice (262 mails)

< Previous Next >
Re: [opensuse-buildservice] [PATCH] fix osc selection of debs for dsc builds
  • From: David Greaves <david@xxxxxxxxxxxx>
  • Date: Mon, 03 Aug 2009 11:33:49 +0100
  • Message-id: <4A76BD0D.2000603@xxxxxxxxxxxx>
Adrian Schröter wrote:
Am Samstag, 1. August 2009 22:35:52 schrieb David Greaves:
Use buildtype instead of expecting a dependency on debhelper


patch against 7788:

http://gitorious.org/mer/osc/commit/184edb3778baf4264b84afd83887b7ea23dfaae
7

Can you please send a diff directly ? The patch created from the web patch
leads to errors here. (and yes, I am too lazy ;)
Sure.

OK, I did a vanilla svn checkout and a diff -ru ... visually it appears the
same.

Just by looking at the patch, should the buildtype not get a default ?
It's validated on line 250 and only influence pacsuffix which defaults to rpm.

I've just added a default and some class validation in keeping with the other
parameters though.

David

--
"Don't worry, you'll be fine; I saw it work in a cartoon once..."
diff --git a/osc/build.py b/osc/build.py
index 16e1a47..559b5d8 100644
--- a/osc/build.py
+++ b/osc/build.py
@@ -53,7 +53,8 @@ if hostarch == 'i686': # FIXME
class Buildinfo:
"""represent the contents of a buildinfo file"""

- def __init__(self, filename, apiurl):
+ # buildtype is one of ['spec', 'dsc', 'kiwi']
+ def __init__(self, filename, apiurl, buildtype):

try:
tree = ET.parse(filename)
@@ -73,15 +74,18 @@ class Buildinfo:
if not (apiurl.startswith('https://') or apiurl.startswith('http://')):
raise urllib2.URLError('invalid protocol for the apiurl: \'%s\'' %
apiurl)

+ if buildtype == '':
+ buildtype='spec'
+ if buildtype not in ['spec', 'dsc', 'kiwi']:
+ raise oscerr.WrongArgs(
+ "Unknown build type: '%s'. Build type should be spec, dsc or
kiwi." \
+ % build_type)
+
# 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
- # 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 buildtype == 'dsc':
+ self.pacsuffix = 'deb'

self.buildarch = root.find('arch').text
self.downloadurl = root.get('downloadurl')
@@ -363,7 +367,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))
< Previous Next >