Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2014-04-08 12:44:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/osc (Old) and /work/SRC/openSUSE:Factory/.osc.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "osc" Changes: -------- --- /work/SRC/openSUSE:Factory/osc/osc.changes 2014-03-01 07:54:15.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.osc.new/osc.changes 2014-04-08 12:45:00.000000000 +0200 @@ -1,0 +2,15 @@ +Thu Apr 3 07:52:46 UTC 2014 - [email protected] + +- 0.145.0 + - allow to use the set-release option when running a manual release + - added support for "osc requestmaintainership PROJECT" + - various bugfixes: + - print_buildlog: do not strip tabs + - fixed "osc -H ..." in combination with a proxy + - fixed creation of ~/.osc_cookiejar + - Package.commit: create _meta for newly added packages + - fixed behavior of set_link_rev #72 +- fixed typos in PKGBUILD file: no comma in depends tag (as + pointed out by roflik) + +------------------------------------------------------------------- Old: ---- osc-0.144.1.tar.gz New: ---- osc-0.145.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.jEdbHg/_old 2014-04-08 12:45:00.000000000 +0200 +++ /var/tmp/diff_new_pack.jEdbHg/_new 2014-04-08 12:45:00.000000000 +0200 @@ -17,7 +17,7 @@ Name: osc -Version: 0.144.1 +Version: 0.145.0 Release: 0 Summary: openSUSE Build Service Commander License: GPL-2.0+ ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.jEdbHg/_old 2014-04-08 12:45:00.000000000 +0200 +++ /var/tmp/diff_new_pack.jEdbHg/_new 2014-04-08 12:45:00.000000000 +0200 @@ -1,19 +1,19 @@ pkgname=osc -pkgver=0.144.1 +pkgver=0.145.0 pkgrel=0 pkgdesc="Open Build Service client" arch=('i686' 'x86_64') url="https://www.github.com/openSUSE/osc" license=('GPL-2.0+' 'GPL-2.0') groups=('base-devel') -depends=('python') +depends=('python2' 'python2-m2crypto' 'urlgrabber') source=(osc-${pkgver}.tar.gz) -md5sums=('d6f0d72f1716d5e57ef02b3ff8a101d8') +md5sums=('53795d71d825f5f2a41721bd96edca8c') package() { msg "Installing osc ..." cd "${srcdir}"/osc-${pkgver} - python setup.py build - python setup.py install --prefix=/usr --root=${pkgdir} + python2 setup.py build + python2 setup.py install --prefix=/usr --root=${pkgdir} ln -s osc-wrapper.py ${pkgdir}/usr/bin/osc } ++++++ _service ++++++ --- /var/tmp/diff_new_pack.jEdbHg/_old 2014-04-08 12:45:00.000000000 +0200 +++ /var/tmp/diff_new_pack.jEdbHg/_new 2014-04-08 12:45:00.000000000 +0200 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="version">0.144.1</param> - <param name="revision">0.144.1</param> + <param name="version">0.145.0</param> + <param name="revision">0.145.0</param> <param name="url">git://github.com/openSUSE/osc.git</param> <param name="scm">git</param> </service> ++++++ osc-0.144.1.tar.gz -> osc-0.145.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/NEWS new/osc-0.145.0/NEWS --- old/osc-0.144.1/NEWS 2014-02-28 21:51:20.000000000 +0100 +++ new/osc-0.145.0/NEWS 2014-04-03 09:51:24.000000000 +0200 @@ -1,3 +1,13 @@ +0.145 + - allow to use the set-release option when running a manual release + - added support for "osc requestmaintainership PROJECT" + - various bugfixes: + - print_buildlog: do not strip tabs + - fixed "osc -H ..." in combination with a proxy + - fixed creation of ~/.osc_cookiejar + - Package.commit: create _meta for newly added packages + - fixed behavior of set_link_rev #72 + 0.144 - allow commiting to package sources from linked projects. osc will ask to branch it first. - group support in bugowner and maintainer command diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/osc/commandline.py new/osc-0.145.0/osc/commandline.py --- old/osc-0.144.1/osc/commandline.py 2014-02-28 21:51:20.000000000 +0100 +++ new/osc-0.145.0/osc/commandline.py 2014-04-03 09:51:24.000000000 +0200 @@ -1142,7 +1142,7 @@ 'Please provide it the target via commandline arguments.' % p.name) modified = [i for i in p.filenamelist if not p.status(i) in (' ', '?', 'S')] - if len(modified) > 0: + if len(modified) > 0 and not opts.yes: print('Your working copy has local modifications.') repl = raw_input('Proceed without committing the local changes? (y|N) ') if repl != 'y': @@ -1701,6 +1701,7 @@ usage: osc requestmaintainership # for current user in checked out package osc requestmaintainership USER # for specified user in checked out package + osc requestmaintainership PROJECT # for current user if cwd is not a checked out package osc requestmaintainership PROJECT PACKAGE # for current user osc requestmaintainership PROJECT PACKAGE USER # request for specified user @@ -1727,6 +1728,10 @@ user = conf.get_apiurl_usr(apiurl) else: user = args[0] + elif len(args) == 1: + user = conf.get_apiurl_usr(apiurl) + project = args[0] + package = None else: raise oscerr.WrongArgs('Wrong number of arguments.') @@ -2390,7 +2395,7 @@ @cmdln.option('-r', '--revision', metavar='rev', help='use the specified revision.') @cmdln.option('-R', '--use-plain-revision', action='store_true', - help='Don\'t expand revsion based on baserev, the revision which was used when commit happened.') + help='Do not expand revision the specified or latest rev') @cmdln.option('-u', '--unset', action='store_true', help='remove revision in link, it will point always to latest revision') def do_setlinkrev(self, subcmd, opts, *args): @@ -2408,12 +2413,6 @@ args = slash_split(args) apiurl = self.get_api_url() package = None - expand = True - baserev = True - if opts.use_plain_revision: - expand = False - baserev = False - rev = parseRevisionOption(opts.revision)[0] or '' if opts.unset: rev = None @@ -2440,7 +2439,8 @@ packages = meta_get_packagelist(apiurl, project) for p in packages: - rev = set_link_rev(apiurl, project, p, revision=rev, expand=expand, baserev=baserev) + rev = set_link_rev(apiurl, project, p, revision=rev, + expand=not opts.use_plain_revision) if rev is None: print('removed revision from link') else: @@ -2585,7 +2585,7 @@ opts.cicount = "copy" if opts.current and not opts.new_package: - rev, vrev = show_upstream_rev_vrev(apiurl, src_project, src_package, expand=1) + rev, vrev = show_upstream_rev_vrev(apiurl, src_project, src_package, expand=True) if rev == None or len(rev) < 32: # vrev is only needed for srcmd5 and OBS instances < 2.1.17 do not support it vrev = None @@ -2747,6 +2747,8 @@ help='Release only to specified project') @cmdln.option('--target-repository', metavar='TARGETREPOSITORY', help='Release only to specified repository') + @cmdln.option('--set-release', metavar='RELEASETAG', + help='rename binaries during release using this release tag') def do_release(self, subcmd, opts, *args): """${cmd_name}: Release sources and binaries @@ -2785,6 +2787,8 @@ query["targetproject"] = opts.target_project if opts.target_repository: query["targetrepository"] = opts.target_repository + if opts.set_release: + query["setrelease"] = opts.set_release baseurl = ['source', source_project] if source_package: baseurl.append(source_package) @@ -5479,7 +5483,7 @@ @cmdln.option('--noinit', '--no-init', action='store_true', help='Skip initialization of build root and start with build immediately.') @cmdln.option('--nochecks', '--no-checks', action='store_true', - help='Do not run post build checks on the resulting packages.') + help='Do not run build checks on the resulting packages.') @cmdln.option('--no-verify', '--noverify', action='store_true', help='Skip signature verification of packages used for build. (Global config in .oscrc: no_verify)') @cmdln.option('--noservice', '--no-service', action='store_true', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/osc/conf.py new/osc-0.145.0/osc/conf.py --- old/osc-0.144.1/osc/conf.py 2014-02-28 21:51:20.000000000 +0100 +++ new/osc-0.145.0/osc/conf.py 2014-04-03 09:51:24.000000000 +0200 @@ -531,12 +531,20 @@ # this is so ugly but httplib doesn't use # a logger object or such def new_method(self, *args, **kwargs): - self._orig_stdout = sys.stdout - sys.stdout = StringIO() - meth(self, *args, **kwargs) - hdr = sys.stdout.getvalue() - sys.stdout = self._orig_stdout - del self._orig_stdout + # check if this is a recursive call (note: we do not + # have to care about thread safety) + is_rec_call = getattr(self, '_orig_stdout', None) is not None + try: + if not is_rec_call: + self._orig_stdout = sys.stdout + sys.stdout = StringIO() + meth(self, *args, **kwargs) + hdr = sys.stdout.getvalue() + finally: + # restore original stdout + if not is_rec_call: + sys.stdout = self._orig_stdout + del self._orig_stdout for i in hdrs: if ishdr: hdr = re.sub(r'%s:[^\\r]*\\r\\n' % i, '', hdr) @@ -571,9 +579,10 @@ cookiejar.load(ignore_discard=True) except IOError: try: - fd = os.open(cookie_file, os.O_CREAT | os.O_WRONLY | os.O_TRUNC, mode=0o600) + fd = os.open(cookie_file, os.O_CREAT | os.O_WRONLY | os.O_TRUNC, 0o600) os.close(fd) - except: + except IOError: + # hmm is any good reason why we should catch the IOError? #print 'Unable to create cookiejar file: \'%s\'. Using RAM-based cookies.' % cookie_file cookiejar = CookieJar() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/osc/core.py new/osc-0.145.0/osc/core.py --- old/osc-0.144.1/osc/core.py 2014-02-28 21:51:20.000000000 +0100 +++ new/osc-0.145.0/osc/core.py 2014-04-03 09:51:25.000000000 +0200 @@ -5,7 +5,7 @@ from __future__ import print_function -__version__ = '0.144' +__version__ = '0.145' # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration @@ -1453,6 +1453,10 @@ print('') rev = self.latest_rev() self.update(rev=rev) + elif self.get_local_meta() is None: + # if this was a newly added package there is no _meta + # file + self.update_local_pacmeta() def __write_storelist(self, name, data): if len(data) == 0: @@ -1560,7 +1564,13 @@ def get_local_origin_project(self): """Get the originproject from the _meta file.""" - root = ET.fromstring(self.get_local_meta()) + # if the wc was checked out via some old osc version + # there might be no meta file: in this case we assume + # that the origin project is equal to the wc's project + meta = self.get_local_meta() + if meta is None: + return self.prjname + root = ET.fromstring(meta) return root.get('project') def is_link_to_different_project(self): @@ -3485,8 +3495,8 @@ return li.xsrcmd5 -def show_upstream_rev_vrev(apiurl, prj, pac, revision=None, expand=False, linkrev=None, meta=False): - m = show_files_meta(apiurl, prj, pac, revision=revision, expand=expand, linkrev=linkrev, meta=meta) +def show_upstream_rev_vrev(apiurl, prj, pac, revision=None, expand=False, meta=False): + m = show_files_meta(apiurl, prj, pac, revision=revision, expand=expand, meta=meta) et = ET.fromstring(''.join(m)) return et.get('rev'), et.get('vrev') @@ -5376,7 +5386,7 @@ # to protect us against control characters import string all_bytes = string.maketrans('', '') - remove_bytes = all_bytes[:10] + all_bytes[11:32] # accept newlines + remove_bytes = all_bytes[:9] + all_bytes[11:32] # accept tabs and newlines query = {'nostream' : '1', 'start' : '%s' % offset} if last: @@ -5953,12 +5963,7 @@ pass return res -def set_link_rev(apiurl, project, package, revision='', expand=False, baserev=False): - """ - updates the rev attribute of the _link xml. If revision is set to None - the rev attribute is removed from the _link xml. If revision is set to '' - the "plain" upstream revision is used (if xsrcmd5 and baserev aren't specified). - """ +def set_link_rev(apiurl, project, package, revision='', expand=False): url = makeurl(apiurl, ['source', project, package, '_link']) try: f = http_GET(url) @@ -5966,29 +5971,38 @@ except HTTPError as e: e.osc_msg = 'Unable to get _link file in package \'%s\' for project \'%s\'' % (package, project) raise + revision = _set_link_rev(apiurl, project, package, root, revision, expand=expand) + l = ET.tostring(root, encoding=ET_ENCODING) + http_PUT(url, data=l) - # set revision element +def _set_link_rev(apiurl, project, package, root, revision='', expand=False): + """ + Updates the rev attribute of the _link xml. If revision is set to None + the rev and vrev attributes are removed from the _link xml. + updates the rev attribute of the _link xml. If revision is the empty + string the latest rev of the link's source package is used (or the + xsrcmd5 if expand is True). If revision is neither None nor the empty + string the _link's rev attribute is set to this revision (or to the + xsrcmd5 if expand is True). + """ src_project = root.get('project', project) src_package = root.get('package', package) - linkrev = None vrev = None - if baserev: - linkrev = 'base' - expand = True + if revision == '': + revision = root.get('rev', '') if revision is None: if 'rev' in root.keys(): del root.attrib['rev'] - elif revision == '' or expand: - revision, vrev = show_upstream_rev_vrev(apiurl, src_project, src_package, revision=revision, linkrev=linkrev, expand=expand) + if 'vrev' in root.keys(): + del root.attrib['vrev'] + elif not revision or expand: + revision, vrev = show_upstream_rev_vrev(apiurl, src_project, src_package, revision=revision, expand=expand) if revision: root.set('rev', revision) # add vrev when revision is a srcmd5 - if vrev and revision and len(revision) >= 32: + if vrev is not None and revision is not None and len(revision) >= 32: root.set('vrev', vrev) - - l = ET.tostring(root, encoding=ET_ENCODING) - http_PUT(url, data=l) return revision diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/tests/setlinkrev_fixtures/baserev_filesremote new/osc-0.145.0/tests/setlinkrev_fixtures/baserev_filesremote --- old/osc-0.144.1/tests/setlinkrev_fixtures/baserev_filesremote 2014-02-28 21:51:20.000000000 +0100 +++ new/osc-0.145.0/tests/setlinkrev_fixtures/baserev_filesremote 1970-01-01 01:00:00.000000000 +0100 @@ -1,5 +0,0 @@ -<directory name="srcpkg" rev="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" srcmd5="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1"> - <linkinfo project="srcsrcprj" package="srcsrcpkg" srcmd5="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" baserev="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" xsrcmd5="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" lsrcmd5="cccccccccccccccccccccccccccccccc" /> - <entry md5="0d62ceea6020d75154078a20d8c9f9ba" mtime="1282047302" name="_link" size="23" /> - <entry md5="17b9e9e1a032ed44e7a584dc6303ffa8" mtime="1282047303" name="merge" size="48" /> -</directory> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/tests/setlinkrev_fixtures/link_with_rev new/osc-0.145.0/tests/setlinkrev_fixtures/link_with_rev --- old/osc-0.144.1/tests/setlinkrev_fixtures/link_with_rev 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.145.0/tests/setlinkrev_fixtures/link_with_rev 2014-04-03 09:51:24.000000000 +0200 @@ -0,0 +1 @@ +<link package="srcpkg" project="srcprj" rev="7" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/tests/setlinkrev_fixtures/md5_rev_link new/osc-0.145.0/tests/setlinkrev_fixtures/md5_rev_link --- old/osc-0.144.1/tests/setlinkrev_fixtures/md5_rev_link 1970-01-01 01:00:00.000000000 +0100 +++ new/osc-0.145.0/tests/setlinkrev_fixtures/md5_rev_link 2014-04-03 09:51:24.000000000 +0200 @@ -0,0 +1 @@ +<link package="srcpkg" project="srcprj" rev="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1" /> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.144.1/tests/test_setlinkrev.py new/osc-0.145.0/tests/test_setlinkrev.py --- old/osc-0.144.1/tests/test_setlinkrev.py 2014-02-28 21:51:20.000000000 +0100 +++ new/osc-0.145.0/tests/test_setlinkrev.py 2014-04-03 09:51:24.000000000 +0200 @@ -38,23 +38,32 @@ """expand src package""" osc.core.set_link_rev('http://localhost', 'osctest', 'simple', expand=True) - @GET('http://localhost/source/osctest/simple/_link', file='simple_link') - @GET('http://localhost/source/srcprj/srcpkg?linkrev=base&rev=latest&expand=1', file='baserev_filesremote') + @GET('http://localhost/source/osctest/simple/_link', file='link_with_rev') @PUT('http://localhost/source/osctest/simple/_link', - exp='<link package="srcpkg" project="srcprj" rev="abcdeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1" />', text='dummytext') - def test_baserev(self): - """expanded baserev revision""" - osc.core.set_link_rev('http://localhost', 'osctest', 'simple', baserev=True) + exp='<link package="srcpkg" project="srcprj" rev="7" />', text='dummytext') + def test_existingrev(self): + """link already has a rev attribute (no expand)""" + # we could also avoid the superfluous PUT + osc.core.set_link_rev('http://localhost', 'osctest', 'simple') + + @GET('http://localhost/source/osctest/simple/_link', file='link_with_rev') + @GET('http://localhost/source/srcprj/srcpkg?rev=7&expand=1', file='expandedsrc_filesremote') + @PUT('http://localhost/source/osctest/simple/_link', + exp='<link package="srcpkg" project="srcprj" rev="eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee" vrev="1" />', + text='dummytext') + def test_expandexistingrev(self): + """link already has a rev attribute (expand it)""" + osc.core.set_link_rev('http://localhost', 'osctest', 'simple', expand=True) @GET('http://localhost/source/osctest/simple/_link', file='simple_link') - @GET('http://localhost/source/srcprj/srcpkg?rev=latest&expand=1', text='conflict in file merge', code=404) + @GET('http://localhost/source/srcprj/srcpkg?rev=latest&expand=1', text='conflict in file merge', code=400) def test_linkerror(self): """link is broken""" try: from urllib.error import HTTPError except ImportError: from urllib2 import HTTPError - # the backend returns status 404 if we try to expand a broken _link + # the backend returns status 400 if we try to expand a broken _link self.assertRaises(HTTPError, osc.core.set_link_rev, 'http://localhost', 'osctest', 'simple', expand=True) @GET('http://localhost/source/osctest/simple/_link', file='rev_link') @@ -64,6 +73,13 @@ """delete rev attribute from link xml""" osc.core.set_link_rev('http://localhost', 'osctest', 'simple', revision=None) + @GET('http://localhost/source/osctest/simple/_link', file='md5_rev_link') + @PUT('http://localhost/source/osctest/simple/_link', + exp='<link package="srcpkg" project="srcprj" />', text='dummytext') + def test_deleterev(self): + """delete rev and vrev attribute from link xml""" + osc.core.set_link_rev('http://localhost', 'osctest', 'simple', revision=None) + @GET('http://localhost/source/osctest/simple/_link', file='simple_link') @PUT('http://localhost/source/osctest/simple/_link', exp='<link package="srcpkg" project="srcprj" />', text='dummytext') ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.jEdbHg/_old 2014-04-08 12:45:01.000000000 +0200 +++ /var/tmp/diff_new_pack.jEdbHg/_new 2014-04-08 12:45:01.000000000 +0200 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 0.144.1 +Version: 0.145.0 Binary: osc Maintainer: Adrian Schroeter <[email protected]> Architecture: any -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
