Hello community, here is the log from the commit of package osc for openSUSE:Factory checked in at 2015-01-10 23:05:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 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-12-16 14:49:11.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.osc.new/osc.changes 2015-01-10 23:05:17.000000000 +0100 @@ -1,0 +2,10 @@ +Fri Jan 9 14:44:45 UTC 2015 - [email protected] + +- 0.150.0 + - support local builds using builenv (for same build environment as a former build) + - add "osc api --edit" option to be able to edit some meta files directly + - follow the request order of the api (sorting according to priorization) + - add mr --release-project option for kgraft updates + - add support for makeoriginolder in request + +------------------------------------------------------------------- Old: ---- osc-0.149.0.tar.gz New: ---- osc-0.150.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.nCGRkc/_old 2015-01-10 23:05:17.000000000 +0100 +++ /var/tmp/diff_new_pack.nCGRkc/_new 2015-01-10 23:05:17.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package osc # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: osc -Version: 0.149.0 +Version: 0.150.0 Release: 0 Summary: openSUSE Build Service Commander License: GPL-2.0+ ++++++ PKGBUILD ++++++ --- /var/tmp/diff_new_pack.nCGRkc/_old 2015-01-10 23:05:18.000000000 +0100 +++ /var/tmp/diff_new_pack.nCGRkc/_new 2015-01-10 23:05:18.000000000 +0100 @@ -1,5 +1,5 @@ pkgname=osc -pkgver=0.149.0 +pkgver=0.150.0 pkgrel=0 pkgdesc="Open Build Service client" arch=('i686' 'x86_64') @@ -8,7 +8,7 @@ groups=('base-devel') depends=('python2' 'python2-m2crypto' 'urlgrabber') source=(osc-${pkgver}.tar.gz) -md5sums=('3c31fb9a5c5bd6f9c05d72380fabfef1') +md5sums=('23983272cec120b109c494c40483dfac') package() { msg "Installing osc ..." ++++++ _service ++++++ --- /var/tmp/diff_new_pack.nCGRkc/_old 2015-01-10 23:05:18.000000000 +0100 +++ /var/tmp/diff_new_pack.nCGRkc/_new 2015-01-10 23:05:18.000000000 +0100 @@ -1,7 +1,7 @@ <services> <service name="tar_scm" mode="disabled"> - <param name="version">0.149.0</param> - <param name="revision">0.149.0</param> + <param name="version">0.150.0</param> + <param name="revision">0.150.0</param> <param name="url">git://github.com/openSUSE/osc.git</param> <param name="scm">git</param> </service> ++++++ debian.changelog ++++++ --- /var/tmp/diff_new_pack.nCGRkc/_old 2015-01-10 23:05:18.000000000 +0100 +++ /var/tmp/diff_new_pack.nCGRkc/_new 2015-01-10 23:05:18.000000000 +0100 @@ -1,4 +1,4 @@ -osc (0.149.0) unstable; urgency=low +osc (0.150.0) unstable; urgency=low - Update to 0.135.0 -- Adrian Schroeter <[email protected]> Wed, 28 Jun 2012 10:00:00 +0200 ++++++ osc-0.149.0.tar.gz -> osc-0.150.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/NEWS new/osc-0.150.0/NEWS --- old/osc-0.149.0/NEWS 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/NEWS 2015-01-09 15:46:01.000000000 +0100 @@ -1,3 +1,10 @@ +0.150 + - support local builds using builenv (for same build environment as a former build) + - add "osc api --edit" option to be able to edit some meta files directly + - follow the request order of the api (sorting according to priorization) + - add mr --release-project option for kgraft updates + - add support for makeoriginolder in request + 0.149 - removed "--diff" option from the "createrequest" command - introduced new "vc-cmd" config option, which is used to specify the path diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/build.py new/osc-0.150.0/osc/build.py --- old/osc-0.149.0/osc/build.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/build.py 2015-01-09 15:46:01.000000000 +0100 @@ -179,7 +179,7 @@ self.mp = {} for i in ['binary', 'package', - 'epoch', 'version', 'release', + 'epoch', 'version', 'release', 'hdrmd5', 'project', 'repository', 'preinstall', 'vminstall', 'noinstall', 'installonly', 'runscripts', ]: @@ -317,9 +317,9 @@ return repositoryDirectory -def get_prefer_pkgs(dirs, wanted_arch, type): +def get_prefer_pkgs(dirs, wanted_arch, type, cpio): import glob - from .util import repodata, packagequery, cpio + from .util import repodata, packagequery paths = [] repositories = [] @@ -346,7 +346,9 @@ packageQueries.add(packageQuery) for path in paths: - if path.endswith('src.rpm'): + if path.endswith('.src.rpm') or path.endswith('.nosrc.rpm'): + continue + if path.endswith('.patch.rpm') or path.endswith('.delta.rpm'): continue if path.find('-debuginfo-') > 0: continue @@ -357,21 +359,27 @@ for name, packageQuery in packageQueries.items()) depfile = create_deps(packageQueries.values()) - cpio = cpio.CpioWrite() cpio.add('deps', '\n'.join(depfile)) - return prefer_pkgs, cpio + return prefer_pkgs def create_deps(pkgqs): """ - creates a list of requires/provides which corresponds to build's internal + creates a list of dependencies which corresponds to build's internal dependency file format """ depfile = [] for p in pkgqs: id = '%s.%s-0/0/0: ' % (p.name(), p.arch()) - depfile.append('R:%s%s' % (id, ' '.join(p.requires()))) depfile.append('P:%s%s' % (id, ' '.join(p.provides()))) + depfile.append('R:%s%s' % (id, ' '.join(p.requires()))) + d = p.conflicts() + if d: + depfile.append('C:%s%s' % (id, ' '.join(d))) + d = p.obsoletes() + if d: + depfile.append('O:%s%s' % (id, ' '.join(d))) + depfile.append('I:%s%s-%s 0-%s' % (id, p.name(), p.evr(), p.arch())) return depfile @@ -558,11 +566,31 @@ s += "%%define %s\n" % i build_descr_data = s + build_descr_data + cpiodata = None + buildenvfile = os.path.join(os.path.dirname(build_descr), "_buildenv." + repo + "." + arch) + if not os.path.isfile(buildenvfile): + buildenvfile = os.path.join(os.path.dirname(build_descr), "_buildenv") + if not os.path.isfile(buildenvfile): + buildenvfile = None + if buildenvfile: + print('Using buildenv file: %s' % os.path.basename(buildenvfile)) + from .util import cpio + if not cpiodata: + cpiodata = cpio.CpioWrite() + if opts.prefer_pkgs: print('Scanning the following dirs for local packages: %s' % ', '.join(opts.prefer_pkgs)) - prefer_pkgs, cpio = get_prefer_pkgs(opts.prefer_pkgs, arch, build_type) - cpio.add(os.path.basename(build_descr), build_descr_data) - build_descr_data = cpio.get() + from .util import cpio + if not cpiodata: + cpiodata = cpio.CpioWrite() + prefer_pkgs = get_prefer_pkgs(opts.prefer_pkgs, arch, build_type, cpiodata) + + if cpiodata: + cpiodata.add(os.path.basename(build_descr), build_descr_data) + # buildenv must come last for compatibility reasons... + if buildenvfile: + cpiodata.add("buildenv", open(buildenvfile).read()) + build_descr_data = cpiodata.get() # special handling for overlay and rsync-src/dest specialcmdopts = [] @@ -765,8 +793,9 @@ """ temporary directory that removes itself""" def __init__(self, *args, **kwargs): self.name = mkdtemp(*args, **kwargs) + _rmtree = staticmethod(shutil.rmtree) def cleanup(self): - shutil.rmtree(self.name) + self._rmtree(self.name) def __del__(self): self.cleanup() def __exit__(self): @@ -910,6 +939,17 @@ else: print('WARNING: unknown packages get not verified, they can compromise your system !') + for i in bi.deps: + if i.hdrmd5: + from .util import packagequery + hdrmd5 = packagequery.PackageQuery.queryhdrmd5(i.fullfilename) + if not hdrmd5: + print("Error: cannot get hdrmd5 for %s" % i.fullfilename) + sys.exit(1) + if hdrmd5 != i.hdrmd5: + print("Error: hdrmd5 mismatch for %s: %s != %s" % (i.fullfilename, hdrmd5, i.hdrmd5)) + sys.exit(1) + print('Writing build configuration') if build_type == 'kiwi': @@ -959,6 +999,11 @@ if os.access(build_root, os.W_OK) and os.access('/dev/kvm', os.W_OK): # so let's hope there's also an fstab entry need_root = False + if config['build-kernel']: + vm_options += [ '--vm-kernel=' + config['build-kernel'] ] + if config['build-initrd']: + vm_options += [ '--vm-initrd=' + config['build-initrd'] ] + build_root += '/.mount' if config['build-memory']: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/cmdln.py new/osc-0.150.0/osc/cmdln.py --- old/osc-0.149.0/osc/cmdln.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/cmdln.py 2015-01-09 15:46:01.000000000 +0100 @@ -393,47 +393,63 @@ """ self.cmdlooping = True self.preloop() - if intro is None: - intro = self.intro - if intro: - intro_str = self._str(intro) - self.stdout.write(intro_str+'\n') - self.stop = False - retval = None - while not self.stop: - if self.cmdqueue: - argv = self.cmdqueue.pop(0) - assert isinstance(argv, (list, tuple)), \ - "item on 'cmdqueue' is not a sequence: %r" % argv - else: - if self.use_rawinput: - try: - try: - #python 2.x - line = raw_input(self._prompt_str) - except NameError: - line = input(self._prompt_str) - except EOFError: - line = 'EOF' + if self.use_rawinput and self.completekey: + try: + import readline + self.old_completer = readline.get_completer() + readline.set_completer(self.complete) + readline.parse_and_bind(self.completekey+": complete") + except ImportError: + pass + try: + if intro is None: + intro = self.intro + if intro: + intro_str = self._str(intro) + self.stdout.write(intro_str+'\n') + self.stop = False + retval = None + while not self.stop: + if self.cmdqueue: + argv = self.cmdqueue.pop(0) + assert isinstance(argv, (list, tuple)), \ + "item on 'cmdqueue' is not a sequence: %r" % argv else: - self.stdout.write(self._prompt_str) - self.stdout.flush() - line = self.stdin.readline() - if not len(line): - line = 'EOF' + if self.use_rawinput: + try: + try: + #python 2.x + line = raw_input(self._prompt_str) + except NameError: + line = input(self._prompt_str) + except EOFError: + line = 'EOF' else: - line = line[:-1] # chop '\n' - argv = line2argv(line) - try: - argv = self.precmd(argv) - retval = self.onecmd(argv) - self.postcmd(argv) - except: - if not self.cmdexc(argv): - raise - retval = 1 - self.lastretval = retval - self.postloop() + self.stdout.write(self._prompt_str) + self.stdout.flush() + line = self.stdin.readline() + if not len(line): + line = 'EOF' + else: + line = line[:-1] # chop '\n' + argv = line2argv(line) + try: + argv = self.precmd(argv) + retval = self.onecmd(argv) + self.postcmd(argv) + except: + if not self.cmdexc(argv): + raise + retval = 1 + self.lastretval = retval + self.postloop() + finally: + if self.use_rawinput and self.completekey: + try: + import readline + readline.set_completer(self.old_completer) + except ImportError: + pass self.cmdlooping = False return retval diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/commandline.py new/osc-0.150.0/osc/commandline.py --- old/osc-0.149.0/osc/commandline.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/commandline.py 2015-01-09 15:46:01.000000000 +0100 @@ -693,13 +693,13 @@ osc meta prj PRJ osc meta pkg PRJ PKG osc meta pkg PRJ PKG -e - osc meta attribute PRJ [PKG [SUBPACKAGE]] [--attribute ATTRIBUTE] [--create|--delete|--set [value_list]] Usage: - osc meta <prj|pkg|prjconf|user|pattern|attribute> ARGS... - osc meta <prj|pkg|prjconf|user|pattern|attribute> -e|--edit ARGS... - osc meta <prj|pkg|prjconf|user|pattern|attribute> -F|--file ARGS... + osc meta <prj|pkg|prjconf|user|pattern> ARGS... + osc meta <prj|pkg|prjconf|user|pattern> -e|--edit ARGS... + osc meta <prj|pkg|prjconf|user|pattern> -F|--file ARGS... osc meta pattern --delete PRJ PATTERN + osc meta attribute PRJ [PKG [SUBPACKAGE]] [--attribute ATTRIBUTE] [--create|--delete|--set [value_list]] ${cmd_option_list} """ @@ -2150,7 +2150,7 @@ print('No results') return - results.sort(reverse=True) + # we must not sort the results here, since the api is doing it already "the right way" days = opts.days or conf.config['request_list_days'] since = '' try: @@ -2910,6 +2910,8 @@ help='Use this attribute to find default maintenance project (default is OBS:MaintenanceProject)') @cmdln.option('-m', '--message', metavar='TEXT', help='specify message TEXT') + @cmdln.option('--release-project', metavar='RELEASEPROJECT', + help='Specify the release project') @cmdln.option('--no-cleanup', action='store_true', help='do not remove source project on accept') @cmdln.option('--cleanup', action='store_true', @@ -2933,6 +2935,9 @@ osc maintenancerequest [ SOURCEPROJECT [ SOURCEPACKAGES RELEASEPROJECT ] ] ${cmd_option_list} """ + #FIXME: the follow syntax would make more sense and would obsolete the --release-project parameter + # but is incompatible with the current one + # osc maintenancerequest [ SOURCEPROJECT [ RELEASEPROJECT [ SOURCEPACKAGES ] ] args = slash_split(args) apiurl = self.get_api_url() @@ -2961,6 +2966,9 @@ if source_project.startswith(default_branch): opt_sourceupdate = 'cleanup' + if opts.release_project: + release_project = opts.release_project + if opts.incident_project: target_project = opts.incident_project else: @@ -4131,6 +4139,7 @@ 'M' Modified '?' item is not under version control '!' item is missing (removed by non-osc command) or incomplete + 'F' Frozen (use "osc pull" to merge conflicts) (package-only state) examples: osc st @@ -4164,7 +4173,9 @@ # state is != ' ' lines.append(statfrmt(st, os.path.normpath(os.path.join(prj.dir, pac)))) continue - if st == ' ' and opts.verbose or st != ' ': + if p.isfrozen(): + lines.append(statfrmt('F', os.path.normpath(os.path.join(prj.dir, pac)))) + elif st == ' ' and opts.verbose or st != ' ': lines.append(statfrmt(st, os.path.normpath(os.path.join(prj.dir, pac)))) states = p.get_status(opts.show_excluded, *excl_states) for st, filename in sorted(states, lambda x, y: cmp(x[1], y[1])): @@ -4269,9 +4280,10 @@ pacs = findpacs(args) for p in pacs: - p.todo = list(set(p.filenamelist + p.filenamelist_unvers + p.to_be_added)) - for filename in p.todo: - if os.path.isdir(filename): + todo = list(set(p.filenamelist + p.filenamelist_unvers + p.to_be_added)) + for filename in todo: + abs_filename = os.path.join(p.absdir, filename) + if os.path.isdir(abs_filename): continue # ignore foo.rXX, foo.mine for files which are in 'C' state if os.path.splitext(filename)[0] in p.in_conflict: @@ -4280,6 +4292,9 @@ if state == '?': # TODO: should ignore typical backup files suffix ~ or .orig p.addfile(filename) + elif state == 'D' and os.path.isfile(abs_filename): + # if the "deleted" file exists in the wc, track it again + p.addfile(filename) elif state == '!': p.delete_file(filename) print(statfrmt('D', getTransActPath(os.path.join(p.dir, filename)))) @@ -5413,10 +5428,11 @@ repo_names = sorted(set([r.name for r in repositories])) if not arg_repository and repositories: + # XXX: we should avoid hardcoding repository names # Use a default value from config, but just even if it's available - # unless try standard, or openSUSE_Factory + # unless try standard, or openSUSE_Factory, or openSUSE_Tumbleweed arg_repository = repositories[-1].name - for repository in (conf.config['build_repository'], 'standard', 'openSUSE_Factory'): + for repository in (conf.config['build_repository'], 'standard', 'openSUSE_Factory', 'openSUSE_Tumbleweed'): if repository in repo_names: arg_repository = repository break @@ -5794,8 +5810,10 @@ help='specify the used build target project') @cmdln.option('--noinit', '--no-init', action='store_true', help='do not guess/verify specified repository') - @cmdln.option('-r', '--root', action='store_true', + @cmdln.option('-r', '--login-as-root', action='store_true', help='login as root instead of abuild') + @cmdln.option('--root', metavar='ROOT', + help='Path to the buildroot') @cmdln.option('-o', '--offline', action='store_true', help='Use cached data without contacting the api server') def do_chroot(self, subcmd, opts, *args): @@ -5819,17 +5837,20 @@ sys.exit(1) user = 'abuild' - if opts.root: + if opts.login_as_root: user = 'root' - repository, arch, descr = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project) - project = opts.alternative_project or store_read_project('.') - if opts.local_package: - package = os.path.splitext(descr)[0] - else: - package = store_read_package('.') - apihost = urlsplit(self.get_api_url())[1] - buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \ - % {'repo': repository, 'arch': arch, 'project': project, 'package': package, 'apihost': apihost} + buildroot = opts.root + if buildroot is None: + repository, arch, descr = self.parse_repoarchdescr(args, opts.noinit or opts.offline, opts.alternative_project) + project = opts.alternative_project or store_read_project('.') + if opts.local_package: + package = os.path.splitext(descr)[0] + else: + package = store_read_package('.') + apihost = urlsplit(self.get_api_url())[1] + if buildroot is None: + buildroot = os.environ.get('OSC_BUILD_ROOT', conf.config['build-root']) \ + % {'repo': repository, 'arch': arch, 'project': project, 'package': package, 'apihost': apihost} if not os.path.isdir(buildroot): raise oscerr.OscIOError(None, '\'%s\' is not a directory' % buildroot) @@ -6981,6 +7002,8 @@ @cmdln.option('-X', '-m', '--method', default='GET', metavar='HTTP_METHOD', help='specify HTTP method to use (GET|PUT|DELETE|POST)') + @cmdln.option('-e', '--edit', default=None, action='store_true', + help='GET, edit and PUT the location') @cmdln.option('-d', '--data', default=None, metavar='STRING', help='specify string data for e.g. POST') @cmdln.option('-T', '-f', '--file', default=None, metavar='FILE', @@ -7001,6 +7024,7 @@ Examples: osc api /source/home:user osc api -X PUT -T /etc/fstab source/home:user/test5/myfstab + osc api -e /configuration ${cmd_usage} ${cmd_option_list} @@ -7028,10 +7052,17 @@ data=opts.data, file=opts.file, headers=opts.headers) - out = r.read() - sys.stdout.write(out) + if opts.edit: + text = edit_text(out) + r = http_request("PUT", + url, + data=text, + headers=opts.headers) + out = r.read() + + sys.stdout.write(out) @cmdln.option('-b', '--bugowner-only', action='store_true', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/conf.py new/osc-0.150.0/osc/conf.py --- old/osc-0.149.0/osc/conf.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/conf.py 2015-01-09 15:46:01.000000000 +0100 @@ -112,6 +112,8 @@ 'build-vmdisk-rootsize': '', # optional for VM builds 'build-vmdisk-swapsize': '', # optional for VM builds 'build-vmdisk-filesystem': '', # optional for VM builds + 'build-kernel': '', # optional for VM builds + 'build-initrd': '', # optional for VM builds 'build-jobs': _get_processors(), 'builtin_signature_check': '1', # by default use builtin check for verify pkgs @@ -227,6 +229,12 @@ # e.g. /var/tmp/FILE.swap #build-swap = /var/tmp/FILE.swap +# build-kernel is the boot kernel used for VM builds +#build-kernel = /boot/vmlinuz + +# build-initrd is the boot initrd used for VM builds +#build-initrd = /boot/initrd + # build-memory is the amount of memory used in the VM # value in MB - e.g. 512 #build-memory = 512 @@ -452,7 +460,7 @@ # workaround for http://bugs.python.org/issue9639 authhandler_class = HTTPBasicAuthHandler - if sys.version_info >= (2, 6, 6) and sys.version_info < (2, 7, 99) \ + if sys.version_info >= (2, 6, 6) and sys.version_info < (2, 7, 1) \ and not 'reset_retry_count' in dir(HTTPBasicAuthHandler): print('warning: your urllib2 version seems to be broken. ' \ 'Using a workaround for http://bugs.python.org/issue9639', file=sys.stderr) @@ -468,7 +476,7 @@ return None authhandler_class = OscHTTPBasicAuthHandler - elif sys.version_info >= (2, 6, 6) and sys.version_info < (2, 7, 99): + elif sys.version_info >= (2, 6, 6) and sys.version_info < (2, 7, 1): class OscHTTPBasicAuthHandler(HTTPBasicAuthHandler): def http_error_404(self, *args): self.reset_retry_count() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/core.py new/osc-0.150.0/osc/core.py --- old/osc-0.149.0/osc/core.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/core.py 2015-01-09 15:46:01.000000000 +0100 @@ -5,7 +5,7 @@ from __future__ import print_function -__version__ = '0.149' +__version__ = '0.150' # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration @@ -2029,7 +2029,7 @@ def mark_frozen(self): store_write_string(self.absdir, '_frozenlink', '') print() - print("The link in this package is currently broken. Checking") + print("The link in this package (\"%s\") is currently broken. Checking" % self.name) print("out the last working version instead; please use 'osc pull'") print("to merge the conflicts.") print() @@ -2493,13 +2493,13 @@ # allowed types + the corresponding (allowed) attributes type_args = {'submit': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'opt_sourceupdate', 'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5', - 'acceptinfo_oxsrcmd5', 'opt_updatelink'), + 'acceptinfo_oxsrcmd5', 'opt_updatelink', 'opt_makeoriginolder'), 'add_role': ('tgt_project', 'tgt_package', 'person_name', 'person_role', 'group_name', 'group_role'), 'set_bugowner': ('tgt_project', 'tgt_package', 'person_name', 'group_name'), 'maintenance_release': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_package', 'person_name', 'acceptinfo_rev', 'acceptinfo_srcmd5', 'acceptinfo_xsrcmd5', 'acceptinfo_osrcmd5', 'acceptinfo_oxsrcmd5'), - 'maintenance_incident': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_releaseproject', 'person_name', 'opt_sourceupdate'), + 'maintenance_incident': ('src_project', 'src_package', 'src_rev', 'tgt_project', 'tgt_releaseproject', 'person_name', 'opt_sourceupdate', 'opt_makeoriginolder'), 'delete': ('tgt_project', 'tgt_package', 'tgt_repository'), 'change_devel': ('src_project', 'src_package', 'tgt_project', 'tgt_package'), 'group': ('grouped_id', )} @@ -2766,6 +2766,8 @@ if action.src_package == action.tgt_package: tgt_package = '' d['target'] = prj_pkg_join(action.tgt_project, tgt_package) + if action.opt_makeoriginolder: + d['target'] = d['target'] + ' ***makeoriginolder***' elif action.type == 'add_role': roles = [] if action.person_name and action.person_role: @@ -3829,7 +3831,6 @@ return os.stat(filename).st_mtime != orig_mtime def edit_message(footer='', template='', templatelen=30): - import tempfile delim = '--This line, and those below, will be ignored--\n' data = '' if template != '': @@ -3839,18 +3840,24 @@ if lines[templatelen:]: footer = '%s\n\n%s' % ('\n'.join(lines[templatelen:]), footer) data += '\n' + delim + '\n' + footer + return edit_text(data, delim, suffix='.diff', template=template) + +def edit_text(data='', delim=None, suffix='.txt', template=''): + import tempfile try: - (fd, filename) = tempfile.mkstemp(prefix='osc-commitmsg', suffix='.diff') + (fd, filename) = tempfile.mkstemp(prefix='osc-editor', suffix=suffix) os.close(fd) mtime = os.stat(filename).st_mtime while True: file_changed = _edit_message_open_editor(filename, data, mtime) - msg = open(filename).read().split(delim)[0].rstrip() + msg = open(filename).read() + if delim: + msg = msg.split(delim)[0].rstrip() if msg and file_changed: break else: reason = 'Log message not specified' - if template and template == msg: + if template == msg: reason = 'Default log message was not changed. Press \'c\' to continue.' ri = raw_input('%s\na)bort, c)ontinue, e)dit: ' % reason) if ri in 'aA': @@ -3956,11 +3963,17 @@ print("WARNING:") print("WARNING: Project does not accept submit request, request to open a NEW maintenance incident instead") print("WARNING:") - xpath = 'attribute/@name = \'%s\'' % conf.config['maintenance_attribute'] + xpath = 'maintenance/maintains/@project = \'%s\' and attribute/@name = \'%s\'' % dst_project, conf.config['maintenance_attribute'] res = search(apiurl, project_id=xpath) root = res['project_id'] project = root.find('project') if project is None: + print("WARNING: This project is not maintained in the maintenance project specified by '%s', looking elsewhere" % conf.config['maintenance_attribute']) + xpath = 'maintenance/maintains/@project = \'%s\'' % dst_project + res = search(apiurl, project_id=xpath) + root = res['project_id'] + project = root.find('project') + if project is None: raise oscerr.APIError("Server did not define a default maintenance project, can't submit.") tproject = project.get('name') r = create_maintenance_request(apiurl, src_project, [src_package], tproject, dst_project, src_update, message) @@ -5171,6 +5184,9 @@ def __str__(self): return self.repo_line_templ % (self.name, self.arch) + def __repr__(self): + return 'Repo(%s %s)' % (self.name, self.arch) + @staticmethod def fromfile(filename): if not os.path.exists(filename): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/fetch.py new/osc-0.150.0/osc/fetch.py --- old/osc-0.149.0/osc/fetch.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/fetch.py 2015-01-09 15:46:01.000000000 +0100 @@ -239,6 +239,12 @@ i.makeurls(self.cachedir, self.urllist) if os.path.exists(i.fullfilename): cached += 1 + if i.hdrmd5: + from .util import packagequery + hdrmd5 = packagequery.PackageQuery.queryhdrmd5(i.fullfilename) + if not hdrmd5 or hdrmd5 != i.hdrmd5: + os.unlink(i.fullfilename) + cached -= 1 miss = 0 needed = all - cached if all: @@ -254,6 +260,10 @@ '--offline not possible.' % i.fullfilename) self.dirSetup(i) + if i.hdrmd5 and self.enable_cpio: + self.__add_cpio(i) + done += 1 + continue try: # if there isn't a progress bar, there is no output at all if not self.progress_obj: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/util/archquery.py new/osc-0.150.0/osc/util/archquery.py --- old/osc-0.149.0/osc/util/archquery.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/util/archquery.py 2015-01-09 15:46:01.000000000 +0100 @@ -88,6 +88,12 @@ def requires(self): return self.fields['depend'] if 'depend' in self.fields else [] + def conflicts(self): + return self.fields['conflict'] if 'conflict' in self.fields else [] + + def obsoletes(self): + return self.fields['replaces'] if 'replaces' in self.fields else [] + def canonname(self): pkgver = self.fields['pkgver'][0] if 'pkgver' in self.fields else None return self.name() + '-' + pkgver + '-' + self.arch() + '.' + self.pkgsuffix diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/util/debquery.py new/osc-0.150.0/osc/util/debquery.py --- old/osc-0.149.0/osc/util/debquery.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/util/debquery.py 2015-01-09 15:46:01.000000000 +0100 @@ -13,7 +13,7 @@ class DebQuery(packagequery.PackageQuery): default_tags = ('package', 'version', 'release', 'epoch', 'architecture', 'description', - 'provides', 'depends', 'pre_depends') + 'provides', 'depends', 'pre_depends', 'conflicts', 'breaks') def __init__(self, fh): self.__file = fh @@ -71,9 +71,11 @@ self.fields['provides'] = [ i.strip() for i in re.split(',\s*', self.fields.get('provides', '')) if i ] self.fields['depends'] = [ i.strip() for i in re.split(',\s*', self.fields.get('depends', '')) if i ] self.fields['pre_depends'] = [ i.strip() for i in re.split(',\s*', self.fields.get('pre_depends', '')) if i ] + self.fields['conflicts'] = [ i.strip() for i in re.split(',\s*', self.fields.get('conflicts', '')) if i ] + self.fields['breaks'] = [ i.strip() for i in re.split(',\s*', self.fields.get('breaks', '')) if i ] if self_provides: # add self provides entry - self.fields['provides'].append('%s = %s' % (self.name(), '-'.join(versrel))) + self.fields['provides'].append('%s (= %s)' % (self.name(), '-'.join(versrel))) def vercmp(self, debq): res = cmp(int(self.epoch()), int(debq.epoch())) @@ -110,7 +112,13 @@ return self.fields['provides'] def requires(self): - return self.fields['depends'] + return self.fields['depends'] + self.fields['pre_depends'] + + def conflicts(self): + return self.fields['conflicts'] + self.fields['breaks'] + + def obsoletes(self): + return [] def gettag(self, num): return self.fields.get(num, None) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/util/packagequery.py new/osc-0.150.0/osc/util/packagequery.py --- old/osc-0.149.0/osc/util/packagequery.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/util/packagequery.py 2015-01-09 15:46:01.000000000 +0100 @@ -77,6 +77,12 @@ def requires(self): raise NotImplementedError + def conflicts(self): + raise NotImplementedError + + def obsoletes(self): + raise NotImplementedError + def gettag(self): raise NotImplementedError @@ -86,6 +92,13 @@ def canonname(self): raise NotImplementedError + def evr(self): + evr = self.version() + "-" + self.release() + epoch = self.epoch() + if epoch is not None and epoch != 0: + evr = epoch + ":" + evr + return evr + @staticmethod def query(filename, all_tags=False, extra_rpmtags=(), extra_debtags=(), self_provides=True): f = open(filename, 'rb') @@ -113,6 +126,17 @@ f.close() return pkgquery + @staticmethod + def queryhdrmd5(filename): + f = open(filename, 'rb') + magic = f.read(7) + f.seek(0) + if magic[:4] == '\xed\xab\xee\xdb': + from . import rpmquery + f.close() + return rpmquery.RpmQuery.queryhdrmd5(filename) + return None + if __name__ == '__main__': import sys try: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.149.0/osc/util/rpmquery.py new/osc-0.150.0/osc/util/rpmquery.py --- old/osc-0.149.0/osc/util/rpmquery.py 2014-10-21 11:49:53.000000000 +0200 +++ new/osc-0.150.0/osc/util/rpmquery.py 2015-01-09 15:46:01.000000000 +0100 @@ -60,7 +60,9 @@ default_tags = (1000, 1001, 1002, 1003, 1004, 1022, 1005, 1020, 1047, 1112, 1113, # provides - 1049, 1048, 1050 # requires + 1049, 1048, 1050, # requires + 1054, 1053, 1055, # conflicts + 1090, 1114, 1115 # obsoletes ) def __init__(self, fh): @@ -69,7 +71,7 @@ self.filename_suffix = 'rpm' self.header = None - def read(self, all_tags=False, self_provides=True, *extra_tags): + def read(self, all_tags=False, self_provides=True, *extra_tags, **extra_kw): # self_provides is unused because a rpm always has a self provides self.__read_lead() data = self.__file.read(RpmHeaderEntry.ENTRY_SIZE) @@ -80,8 +82,10 @@ size = il * RpmHeaderEntry.ENTRY_SIZE + dl # data is 8 byte aligned pad = (size + 7) & ~7 - self.__file.read(pad) - data = self.__file.read(RpmHeaderEntry.ENTRY_SIZE) + querysig = extra_kw.get('querysig') + if not querysig: + self.__file.read(pad) + data = self.__file.read(RpmHeaderEntry.ENTRY_SIZE) hdrmgc, reserved, il, dl = struct.unpack('!I3i', data) self.header = RpmHeader(pad, dl) if self.HEADER_MAGIC != hdrmgc: @@ -115,9 +119,10 @@ entry.data = struct.unpack('!%dh' % entry.count, data[off:off + 2 * entry.count]) elif entry.type == 4: entry.data = struct.unpack('!%di' % entry.count, data[off:off + 4 * entry.count]) - elif entry.type == 6 or entry.type == 7: - # XXX: what to do with binary data? for now treat it as a string + elif entry.type == 6: entry.data = unpack_string(data[off:]) + elif entry.type == 7: + entry.data = data[off:off + entry.count] elif entry.type == 8 or entry.type == 9: cnt = entry.count entry.data = [] @@ -151,7 +156,10 @@ raise RpmHeaderError(self.__path, 'unsupported tag type \'%d\' (tag: \'%s\'' % (entry.type, entry.tag)) def __reqprov(self, tag, flags, version): - pnames = self.header.gettag(tag).data + pnames = self.header.gettag(tag) + if not pnames: + return [] + pnames = pnames.data pflags = self.header.gettag(flags).data pvers = self.header.gettag(version).data if not (pnames and pflags and pvers): @@ -221,6 +229,12 @@ def requires(self): return self.__reqprov(1049, 1048, 1050) + def conflicts(self): + return self.__reqprov(1054, 1053, 1055) + + def obsoletes(self): + return self.__reqprov(1090, 1114, 1115) + def is_src(self): # SOURCERPM = 1044 return self.gettag(1044) is None @@ -251,6 +265,17 @@ return rpmq @staticmethod + def queryhdrmd5(filename): + f = open(filename, 'rb') + rpmq = RpmQuery(f) + rpmq.read(1004, querysig=True) + f.close() + entry = rpmq.gettag(1004) + if entry is None: + return None + return ''.join([ "%02x" % x for x in struct.unpack('16B', entry.data) ]) + + @staticmethod def rpmvercmp(ver1, ver2): """ implementation of RPM's version comparison algorithm @@ -326,3 +351,5 @@ print('\n'.join(rpmq.provides())) print('##########') print('\n'.join(rpmq.requires())) + print('##########') + print(RpmQuery.queryhdrmd5(sys.argv[1])) ++++++ osc.dsc ++++++ --- /var/tmp/diff_new_pack.nCGRkc/_old 2015-01-10 23:05:18.000000000 +0100 +++ /var/tmp/diff_new_pack.nCGRkc/_new 2015-01-10 23:05:18.000000000 +0100 @@ -1,6 +1,6 @@ Format: 1.0 Source: osc -Version: 0.149.0 +Version: 0.150.0 Binary: osc Maintainer: Adrian Schroeter <[email protected]> Architecture: any -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
