![](https://seccdn.libravatar.org/avatar/e2145bc5cf53dda95c308a3c75e8fef3.jpg?s=120&d=mm&r=g)
Hello community, here is the log from the commit of package osc checked in at Wed Oct 1 12:17:28 CEST 2008. -------- --- osc/osc.changes 2008-09-16 14:29:02.000000000 +0200 +++ /mounts/work_src_done/STABLE/osc/osc.changes 2008-09-30 17:20:43.000000000 +0200 @@ -1,0 +2,17 @@ +Tue Sep 30 17:19:23 CEST 2008 - poeml@suse.de + +- update to r5219 (version 0.109): + With changes from Marcus_H, myself, dmueller, tpatzig: + - osc getbinaries: new command to download binaries directly from + the api server + - pass the --debug option to the build script which will take + care of creating debuginfo packages + - add link to plugin API to osc help output + - Don't try to catch rpm-python errors if rpm-python isn't installed. + Thus we can avoid a hard dependency on having rpm-python. + - added command 'rlog', to show commit logs of remote packages + - fixed depracation warnings with Python 2.6 [bnc#426612] + - fix streaming of unfinished logfiles again + - fixed regression of .oscrc template [bnc#427118] + +------------------------------------------------------------------- calling whatdependson for head-i586 Old: ---- osc-0.108.tar.gz New: ---- osc-0.109.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ osc.spec ++++++ --- /var/tmp/diff_new_pack.k19889/_old 2008-10-01 12:17:11.000000000 +0200 +++ /var/tmp/diff_new_pack.k19889/_new 2008-10-01 12:17:11.000000000 +0200 @@ -1,5 +1,5 @@ # -# spec file for package osc (Version 0.108) +# spec file for package osc (Version 0.109) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -20,13 +20,13 @@ Name: osc BuildRequires: python-devel -Version: 0.108 +Version: 0.109 Release: 1 Group: Development/Tools/Other License: GPL v2 or later BuildRoot: %{_tmppath}/%{name}-%{version}-build Url: https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/p... -# v=0.101; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/p... osc-$v && tar czf osc-$v.tar.gz osc-$v +# v=0.109; svn export https://forgesvn1.novell.com/svn/opensuse/trunk/buildservice/src/clientlib/p... osc-$v && tar czf osc-$v.tar.gz osc-$v Source: osc-%{version}.tar.gz Summary: openSUSE (build service) commander Requires: python-urlgrabber @@ -87,6 +87,20 @@ %doc README TODO NEWS %changelog +* Tue Sep 30 2008 poeml@suse.de +- update to r5219 (version 0.109): + With changes from Marcus_H, myself, dmueller, tpatzig: + - osc getbinaries: new command to download binaries directly from + the api server + - pass the --debug option to the build script which will take + care of creating debuginfo packages + - add link to plugin API to osc help output + - Don't try to catch rpm-python errors if rpm-python isn't installed. + Thus we can avoid a hard dependency on having rpm-python. + - added command 'rlog', to show commit logs of remote packages + - fixed depracation warnings with Python 2.6 [bnc#426612] + - fix streaming of unfinished logfiles again + - fixed regression of .oscrc template [bnc#427118] * Tue Sep 16 2008 poeml@suse.de - update to r5032 (version 0.108): - osc submitreq: has two aliases now: "osc sr" and "osc submitrequest" ++++++ debian.changelog ++++++ --- osc/debian.changelog 2008-09-16 14:29:01.000000000 +0200 +++ /mounts/work_src_done/STABLE/osc/debian.changelog 2008-09-30 17:20:42.000000000 +0200 @@ -1,3 +1,21 @@ +osc (0.109-1) unstable; urgency=high + + - update to r5219 (version 0.109): + With changes from Marcus_H, myself, dmueller, tpatzig: + - osc getbinaries: new command to download binaries directly from + the api server + - pass the --debug option to the build script which will take + care of creating debuginfo packages + - add link to plugin API to osc help output + - Don't try to catch rpm-python errors if rpm-python isn't installed. + Thus we can avoid a hard dependency on having rpm-python. + - added command 'rlog', to show commit logs of remote packages + - fixed depracation warnings with Python 2.6 [bnc#426612] + - fix streaming of unfinished logfiles again + - fixed regression of .oscrc template [bnc#427118] + + -- Peter Poeml <poeml@suse.de> Tue, 30 Sep 2008 12:00:00 +0200 + osc (0.108-1) unstable; urgency=high - update to r5032 (version 0.108): ++++++ osc-0.108.tar.gz -> osc-0.109.tar.gz ++++++ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/NEWS new/osc-0.109/NEWS --- old/osc-0.108/NEWS 2008-09-16 14:16:04.000000000 +0200 +++ new/osc-0.109/NEWS 2008-09-30 17:07:44.000000000 +0200 @@ -1,3 +1,16 @@ +0.109: + +- osc getbinaries: new command to download binaries directly from the api server +- osc rlog: new command to show commit logs of remote packages +- osc build: --debug option to the build script which will take care of creating debuginfo packages +- add link to plugin API to osc help output +- avoid a hard dependency on the rpm-python bindings. +- fixed depracation warnings with Python 2.6 [bnc#426612] +- streaming of unfinished logfiles fixed +- fixed regression of .oscrc template [bnc#427118] +Changes were from Marcus_H, poeml, dmueller, tpatzig. + + 0.108: - osc submitreq: has two aliases now: "osc sr" and "osc submitrequest" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/babysitter.py new/osc-0.109/osc/babysitter.py --- old/osc-0.108/osc/babysitter.py 2008-07-16 17:14:57.000000000 +0200 +++ new/osc-0.109/osc/babysitter.py 2008-09-24 14:16:25.000000000 +0200 @@ -9,8 +9,13 @@ import signal from osc import oscerr from urllib2 import URLError, HTTPError -# import as RPMError because the class "error" is too generic -from rpm import error as RPMError +try: + # import as RPMError because the class "error" is too generic + from rpm import error as RPMError +except: + # if rpm-python isn't installed (we might be on a debian system): + RPMError = None + # the good things are stolen from Matt Mackall's mercurial diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/build.py new/osc-0.109/osc/build.py --- old/osc-0.108/osc/build.py 2008-08-20 11:45:49.000000000 +0200 +++ new/osc-0.109/osc/build.py 2008-09-24 15:13:33.000000000 +0200 @@ -250,6 +250,8 @@ buildargs.append('--jobs %s' % opts.jobs) if opts.baselibs: buildargs.append('--baselibs') + if opts.debuginfo: + buildargs.append('--debug') buildargs = ' '.join(buildargs) prj = store_read_project(os.curdir) @@ -264,20 +266,6 @@ print >>sys.stderr, 'Error: specfile \'%s\' does not exist.' % spec return 1 - if opts.debuginfo: - # make sure %debug_package is in the spec-file. - spec_text = open(spec).read() - if not re.search(r'(?m)^%debug_package', spec_text): - spec_text = re.sub(r'(?m)^(%prep)', - r'# added by osc build -d\n%debug_package\n\n\1', - spec_text, 1) - tmp_spec = NamedTemporaryFile(prefix = spec + '_', dir = '.', suffix = '.spec') - tmp_spec.write(spec_text) - tmp_spec.flush() - spec = tmp_spec.name - os.chmod(spec, 0644) - - # make it possible to override configuration of the rc file for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'OSC_BUILD_ROOT']: val = os.getenv(var) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/cmdln.py new/osc-0.109/osc/cmdln.py --- old/osc-0.108/osc/cmdln.py 2007-05-16 12:55:05.000000000 +0200 +++ new/osc-0.109/osc/cmdln.py 2008-09-21 16:44:20.000000000 +0200 @@ -271,8 +271,8 @@ Returns the return value from the command handler. """ - assert (isinstance(argv, (list, tuple)), - "'argv' is not a sequence: %r" % argv) + assert isinstance(argv, (list, tuple)), \ + "'argv' is not a sequence: %r" % argv retval = None try: argv = self.precmd(argv) @@ -317,8 +317,8 @@ 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) + assert isinstance(argv, (list, tuple)), \ + "item on 'cmdqueue' is not a sequence: %r" % argv else: if self.use_rawinput: try: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/commandline.py new/osc-0.109/osc/commandline.py --- old/osc-0.108/osc/commandline.py 2008-08-21 20:17:40.000000000 +0200 +++ new/osc-0.109/osc/commandline.py 2008-09-30 16:54:08.000000000 +0200 @@ -26,6 +26,9 @@ For additional information, see * http://www.opensuse.org/Build_Service_Tutorial * http://www.opensuse.org/Build_Service/CLI + + You can modify osc commands, or roll you own, via the plugin API: + * http://www.opensuse.org/Build_Service/osc_plugins """ name = 'osc' conf = None @@ -1945,6 +1948,24 @@ print '\n'.join(get_commitlog(apiurl, project, package, rev)) + @cmdln.option('-r', '--revision', metavar='rev', + help='show log of the specified revision') + def do_rlog(self, subcmd, opts, prj, pkg): + """${cmd_name}: Shows the commit log of a remote package + + ${cmd_usage} + ${cmd_option_list} + """ + + apiurl = conf.config['apiurl'] + rev, dummy = parseRevisionOption(opts.revision) + if rev and not checkRevision(prj, pkg, rev, apiurl): + print >>sys.stderr, 'Revision \'%s\' does not exist' % rev + sys.exit(1) + + print '\n'.join(get_commitlog(apiurl, prj, pkg, rev)) + + @cmdln.option('-f', '--failed', action='store_true', help='rebuild all failed packages') def do_rebuildpac(self, subcmd, opts, *args): @@ -2082,6 +2103,58 @@ print wipebinaries(conf.config['apiurl'], args[0], package, opts.arch, opts.repo, code) + @cmdln.option('-q', '--quiet', action='store_true', + help='do not show downloading progress') + @cmdln.option('-d', '--destdir', default='.', metavar='DIR', + help='destination directory') + def do_getbinaries(self, subcmd, opts, project, package, repository, architecture): + """${cmd_name}: Download binaries to a local directory + + This command does download packages directly from the api server. + Thus, it does directly access the packages that are used for building + others, even when they are "published" yet. + + ${cmd_usage} + ${cmd_option_list} + """ + + # Get package list + binaries = get_binarylist(conf.config['apiurl'], + project, repository, architecture, + package = package, verbose=True) + + if not os.path.isdir(opts.destdir): + print "Creating %s" % opts.destdir + os.makedirs(opts.destdir, 0755) + + if binaries == [ ]: + sys.exit('no binaries found. Either the package does not ' + 'exist, or no binaries have been built.') + + for binary in binaries: + + # skip source rpms + if binary.name.endswith('.src.rpm'): + continue + + target_filename = '%s/%s' % (opts.destdir, binary.name) + + if os.path.exists(target_filename): + st = os.stat(target_filename) + if st.st_mtime == binary.mtime and st.st_size == binary.size: + continue + + get_binary_file(conf.config['apiurl'], + project, + repository, architecture, + binary.name, + package = package, + target_filename = target_filename, + target_mtime = binary.mtime, + progress_meter = not opts.quiet) + + + @cmdln.option('--repos-baseurl', action='store_true', help='show base URLs of download repositories') @cmdln.option('-e', '--enable-exact', action='store_true', diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/conf.py new/osc-0.109/osc/conf.py --- old/osc-0.108/osc/conf.py 2008-08-21 20:17:40.000000000 +0200 +++ new/osc-0.109/osc/conf.py 2008-09-18 17:04:42.000000000 +0200 @@ -264,7 +264,7 @@ try: try: os.chmod(conffile, 0600) - cp.write(file) + cp.write(file, True) except IOError, e: raise oscerr.OscIOError(e, 'cannot write configfile \'s\'' % conffile) finally: diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/core.py new/osc-0.109/osc/core.py --- old/osc-0.108/osc/core.py 2008-09-16 13:12:02.000000000 +0200 +++ new/osc-0.109/osc/core.py 2008-09-30 17:07:44.000000000 +0200 @@ -7,7 +7,7 @@ # and distributed under the terms of the GNU General Public Licence, # either version 2, or (at your option) any later version. -__version__ = '0.108' +__version__ = '0.109' # __store_version__ is to be incremented when the format of the working copy # "store" changes in an incompatible way. Please add any needed migration # functionality to check_store_version(). @@ -2048,9 +2048,13 @@ def get_binary_file(apiurl, prj, repo, arch, - filename, targetfilename=None, - package=None, - progress_meter=False): + filename, + package = None, + target_filename = None, + target_mtime = None, + progress_meter = False): + + target_filename = target_filename or filename where = package or '_repository' u = makeurl(apiurl, ['build', prj, repo, arch, where, filename]) @@ -2064,26 +2068,35 @@ import tempfile (fd, tmpfilename) = tempfile.mkstemp(prefix = filename + '.', suffix = '.osc', dir = '/tmp') + os.chmod(tmpfilename, 0644) - o = os.fdopen(fd, 'w') + try: + o = os.fdopen(fd, 'w') - downloaded = 0 - while 1: - #buf = f.read(BUFSIZE) - buf = f.read(16384) - if not buf: break - o.write(buf) - downloaded += len(buf) - if progress_meter: - completion = str(int((float(downloaded)/binsize)*100)) - sys.stdout.write('%s%*s%%]' % ('\b'*5, 3, completion)) - sys.stdout.flush() - o.close() + downloaded = 0 + while 1: + #buf = f.read(BUFSIZE) + buf = f.read(16384) + if not buf: break + o.write(buf) + downloaded += len(buf) + if progress_meter: + completion = str(int((float(downloaded)/binsize)*100)) + sys.stdout.write('%s%*s%%]' % ('\b'*5, 3, completion)) + sys.stdout.flush() + o.close() - if progress_meter: - sys.stdout.write('\n') + if progress_meter: + sys.stdout.write('\n') - shutil.move(tmpfilename, targetfilename or filename) + shutil.move(tmpfilename, target_filename) + if target_mtime: + os.utime(target_filename, (-1, target_mtime)) + + # make sure that the temp file is cleaned up when we are interrupted + finally: + try: os.unlink(tmpfilename) + except: pass def dgst(file): @@ -2091,8 +2104,13 @@ #if not os.path.exists(file): #return None - import md5 - s = md5.new() + try: + import hashlib + md5 = hashlib + except ImportError: + import md5 + md5 = md5 + s = md5.md5() f = open(file, 'r') while 1: buf = f.read(BUFSIZE) @@ -2537,13 +2555,22 @@ yield repo_line_templ % (node.get('name'), node2.text) -def get_binarylist(apiurl, prj, repo, arch, package=None): +def get_binarylist(apiurl, prj, repo, arch, package=None, verbose=False): what = package or '_repository' u = makeurl(apiurl, ['build', prj, repo, arch, what]) f = http_GET(u) tree = ET.parse(f) - r = [ node.get('filename') for node in tree.findall('binary')] - return r + if not verbose: + return [ node.get('filename') for node in tree.findall('binary')] + else: + l = [] + for node in tree.findall('binary'): + f = File(node.get('filename'), + None, + int(node.get('size')), + int(node.get('mtime'))) + l.append(f) + return l def get_binarylist_published(apiurl, prj, repo, arch): @@ -2717,11 +2744,19 @@ def print_buildlog(apiurl, prj, package, platform, arch, offset = 0): """prints out the buildlog on stdout""" try: - u = makeurl(apiurl, ['build', prj, platform, arch, package, '_log?start=%s' % offset]) - f = http_GET(u) - for log_chunk in f: - offset += len(log_chunk) - print log_chunk.strip() + while True: + u = makeurl(apiurl, ['build', prj, platform, arch, package, '_log?nostream=1&start=%s' % offset]) + f = http_GET(u) + start_offset = offset + while True: + log_chunk = f.read(8192) + offset += len(log_chunk) + print log_chunk, + if not len(log_chunk): + break + if start_offset == offset: + break + except urllib2.HTTPError, e: print >>sys.stderr, 'Can\'t get logfile' print >>sys.stderr, e diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.108/osc/OscConfigParser.py new/osc-0.109/osc/OscConfigParser.py --- old/osc-0.108/osc/OscConfigParser.py 2008-08-14 14:12:41.000000000 +0200 +++ new/osc-0.109/osc/OscConfigParser.py 2008-09-18 17:04:42.000000000 +0200 @@ -168,6 +168,8 @@ def format(self, line): mo = ConfigParser.ConfigParser.OPTCRE.match(line.strip()) key, val = mo.group('option', 'value') + # escape all occurrences of '%' otherwise string formatting will fail + line = line.replace('%', '%%') self.frmt = line.replace(key.strip(), '%s', 1) pos = val.find(' ;') if pos >= 0: ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de