Hello community,
here is the log from the commit of package osc
checked in at Fri May 4 00:03:23 CEST 2007.
--------
--- osc/osc.changes 2007-04-25 19:35:39.000000000 +0200
+++ /mounts/work_src_done/STABLE/osc/osc.changes 2007-05-02 20:35:23.000000000 +0200
@@ -1,0 +2,8 @@
+Wed May 2 20:20:12 CEST 2007 - poeml@suse.de
+
+- update to r1626:
+ - build: implement --prefer-pacs option
+ - apply patch from Michael Marek, fixing all places where error
+ messages were printed to stdout instead of stderr. [#239404]
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.p19163/_old 2007-05-04 00:02:53.000000000 +0200
+++ /var/tmp/diff_new_pack.p19163/_new 2007-05-04 00:02:53.000000000 +0200
@@ -13,7 +13,7 @@
Name: osc
BuildRequires: python-devel
Version: 0.95
-Release: 1
+Release: 4
Group: Development/Tools/Other
License: GNU General Public License (GPL)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -63,6 +63,11 @@
%doc README TODO NEWS
%changelog
+* Wed May 02 2007 - poeml@suse.de
+- update to r1626:
+ - build: implement --prefer-pacs option
+ - apply patch from Michael Marek, fixing all places where error
+ messages were printed to stdout instead of stderr. [#239404]
* Wed Apr 25 2007 - poeml@suse.de
- update to r1608:
- version 0.95
++++++ debian.changelog ++++++
--- osc/debian.changelog 2007-04-25 19:38:05.000000000 +0200
+++ /mounts/work_src_done/STABLE/osc/debian.changelog 2007-05-02 20:27:28.000000000 +0200
@@ -1,3 +1,12 @@
+osc (0.95-2) unstable; urgency=high
+ * update to r1626:
+ - build:
+ - implement --prefer-pacs option
+ - applied patch from Michael Marek, fixing all places where error
+ messages were printed to stdout instead of stderr. [#239404]
+
+ -- Peter Poeml Wed, 2 May 2007 00:00:00 +0200
+
osc (0.95-1) unstable; urgency=high
* update to r1608:
- version 0.95
++++++ osc-0.95.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.95/NEWS new/osc-0.95/NEWS
--- old/osc-0.95/NEWS 2007-04-25 19:31:15.000000000 +0200
+++ new/osc-0.95/NEWS 2007-05-02 20:25:08.000000000 +0200
@@ -1,4 +1,7 @@
since 0.95:
+- build: implement --prefer-pacs option
+- applied patch from Michael Marek, fixing all places where error
+ messages were printed to stdout instead of stderr. [#239404]
- osc is now easier to work with when using alternative API servers. The
configured server can be overriden with -A <url> on the commandline.
"apisrv" in the config takes a URL now, so the variable "scheme" which was
@@ -37,8 +40,6 @@
setup, by using the new <bdep> preinstall and runscripts attributes
- update: when updating, don't delete files with local modifications
- let the diff subcommand return 1 if differences were found
-
-since 0.9:
- fix important bug, which could lead to overwriting local modifications when
upstream changes are merged in
- if a merge fails, the store copy must be updated neverthelesss
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.95/osc/build.py new/osc-0.95/osc/build.py
--- old/osc-0.95/osc/build.py 2007-04-25 13:22:40.000000000 +0200
+++ new/osc-0.95/osc/build.py 2007-05-02 15:49:57.000000000 +0200
@@ -47,8 +47,8 @@
try:
tree = ET.parse(filename)
except:
- print 'could not parse the buildconfig:'
- print open(filename).read()
+ print >>sys.stderr, 'could not parse the buildconfig:'
+ print >>sys.stderr, open(filename).read()
sys.exit(1)
root = tree.getroot()
@@ -87,6 +87,18 @@
self.preinstall_list = [ dep.name for dep in self.deps if dep.preinstall ]
self.runscripts_list = [ dep.name for dep in self.deps if dep.runscripts ]
+ def has_dep(self, name):
+ for i in self.deps:
+ if i.name == name:
+ return True
+ return False
+
+ def remove_dep(self, name):
+ for i in self.deps:
+ if i.name == name:
+ self.deps.remove(i)
+ return True
+ return False
class Pac:
@@ -150,6 +162,9 @@
def __str__(self):
return self.name
+ def __repr__(self):
+ return "%s" % self.name
+
def get_built_files(pacdir, pactype):
@@ -165,16 +180,48 @@
return s_built, b_built
+def get_prefer_pacs(dirs, wanted_arch):
+ # XXX learn how to do the same for Debian packages
+ import glob
+ paths = []
+ for dir in dirs:
+ paths += glob.glob(os.path.join(dir, '*.rpm'))
+ prefer_pacs = []
+
+ for path in paths:
+ if path.endswith('src.rpm'):
+ continue
+ if path.find('-debuginfo-') > 0:
+ continue
+ arch, name = os.popen('rpm -qp --qf "%%{arch} %%{name}\\n" %s' \
+ % path).read().split()
+ # instead of this assumption, we should probably rather take the
+ # requested arch for this package from buildinfo
+ # also, it will ignore i686 packages, how to handle those?
+ if arch == wanted_arch or arch == 'noarch':
+ prefer_pacs.append((name, path))
+
+ return dict(prefer_pacs)
+
+
def main(opts, argv):
repo = argv[0]
arch = argv[1]
spec = argv[2]
+
buildargs = []
if opts.clean:
buildargs.append('--clean')
if opts.noinit:
buildargs.append('--noinit')
+ buildargs = ' '.join(buildargs)
+
+
+ if not os.path.exists(spec):
+ print >>sys.stderr, 'Error: specfile \'%s\' does not exist.' % spec
+ return 1
+
# make it possible to override configuration of the rc file
for var in ['OSC_PACKAGECACHEDIR', 'OSC_SU_WRAPPER', 'BUILD_ROOT', 'OSC_BUILD_ROOT']:
@@ -189,9 +236,6 @@
config['build-root'] = config['build-root'] % {'repo': repo, 'arch': arch}
- if not os.path.exists(spec):
- sys.exit('Error: specfile \'%s\' does not exist.' % spec)
-
print 'Getting buildinfo from server'
bi_file = NamedTemporaryFile(suffix='.xml', prefix='buildinfo.', dir = '/tmp')
rc = os.system('osc buildinfo %s %s %s > %s' % (repo, arch, spec, bi_file.name))
@@ -200,15 +244,33 @@
sys.exit(rc)
bi = Buildinfo(bi_file.name)
+ rpmlist_prefers = []
+ if opts.prefer_pacs:
+ print 'Evaluating preferred packages'
+ # the resulting dict will also contain packages which are not on the install list
+ # but they won't be installed
+ prefer_pacs = get_prefer_pacs(opts.prefer_pacs, bi.buildarch)
+
+ for name, path in prefer_pacs.iteritems():
+ if bi.has_dep(name):
+ # We remove a preferred package from the buildinfo, so that the
+ # fetcher doesn't take care about them.
+ # Instead, we put it in a list which is appended to the rpmlist later.
+ # At the same time, this will make sure that these packages are
+ # not verified.
+ bi.remove_dep(name)
+ rpmlist_prefers.append((name, path))
+ print ' - %s (%s)' % (name, path)
+ continue
print 'Updating cache of required packages'
fetcher = Fetcher(cachedir = config['packagecachedir'],
urllist = config['urllist'],
auth_dict = config['auth_dict'])
+
# now update the package cache
fetcher.run(bi)
-
if bi.pacsuffix == 'rpm':
"""don't know how to verify .deb packages. They are verified on install
anyway, I assume... verifying package now saves time though, since we don't
@@ -217,18 +279,18 @@
print 'Verifying integrity of cached packages'
verify_pacs([ i.fullfilename for i in bi.deps ])
-
print 'Writing build configuration'
- buildconf = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps ]
+ rpmlist = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps ]
+ rpmlist += [ '%s %s\n' % (i[0], i[1]) for i in rpmlist_prefers ]
- buildconf.append('preinstall: ' + ' '.join(bi.preinstall_list) + '\n')
- buildconf.append('runscripts: ' + ' '.join(bi.runscripts_list) + '\n')
+ rpmlist.append('preinstall: ' + ' '.join(bi.preinstall_list) + '\n')
+ rpmlist.append('runscripts: ' + ' '.join(bi.runscripts_list) + '\n')
- rpmlist = NamedTemporaryFile(prefix='rpmlist.', dir = '/tmp')
- rpmlist.writelines(buildconf)
- rpmlist.flush()
- os.fsync(rpmlist)
+ rpmlist_file = NamedTemporaryFile(prefix='rpmlist.', dir = '/tmp')
+ rpmlist_file.writelines(rpmlist)
+ rpmlist_file.flush()
+ os.fsync(rpmlist_file)
@@ -240,12 +302,10 @@
print 'Running build'
- buildargs = ' '.join(buildargs)
-
cmd = '%s --root=%s --norootforbuild --rpmlist=%s --dist=%s %s %s' \
% (config['build-cmd'],
config['build-root'],
- rpmlist.name,
+ rpmlist_file.name,
bc_file.name,
spec,
buildargs)
@@ -279,9 +339,8 @@
(s_built, b_built) = get_built_files(pacdir, bi.pacsuffix)
print
- #print 'built source packages:'
if s_built: print s_built
- #print 'built binary packages:'
+ print
print b_built
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.95/osc/commandline.py new/osc-0.95/osc/commandline.py
--- old/osc-0.95/osc/commandline.py 2007-04-25 13:22:40.000000000 +0200
+++ new/osc-0.95/osc/commandline.py 2007-05-02 15:49:57.000000000 +0200
@@ -73,7 +73,8 @@
${cmd_option_list}
"""
if len(args) != 2:
- sys.exit('Must provide project and package name.')
+ print >>sys.stderr, 'Must provide project and package name.'
+ return 2
project = args[0]
package = args[1]
@@ -118,7 +119,7 @@
"""
if not args:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
self.do_help(['foo', 'meta'])
return 2
@@ -173,7 +174,7 @@
"""
if not args:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
self.do_help(['foo', 'editmeta'])
return 2
@@ -225,7 +226,7 @@
"""
if not args or len(args) < 3:
- print 'Incorrect number of argument.'
+ print >>sys.stderr, 'Incorrect number of argument.'
self.do_help(['foo', 'linkpac'])
return 2
@@ -238,7 +239,8 @@
dst_package = src_package
if src_project == dst_project and src_package == dst_package:
- sys.exit('osc: error: source and destination are the same')
+ print >>sys.stderr, 'Error: source and destination are the same.'
+ return 1
link_pac(src_project, src_package, dst_project, dst_package)
@@ -256,7 +258,7 @@
"""
if not args or len(args) < 3:
- print 'Incorrect number of argument.'
+ print >>sys.stderr, 'Incorrect number of argument.'
self.do_help(['foo', 'copypac'])
return 2
@@ -269,7 +271,8 @@
dst_package = src_package
if src_project == dst_project and src_package == dst_package:
- sys.exit('osc: error: source and destination are the same')
+ print >>sys.stderr, 'Error: source and destination are the same.'
+ return 1
copy_pac(src_project, src_package, dst_project, dst_package)
@@ -297,7 +300,8 @@
"""
if meta_get_packagelist(project) != []:
- sys.exit('Project contains packages. It must be empty before deleting it.')
+ print >>sys.stderr, 'Project contains packages. It must be empty before deleting it.'
+ return 1
delete_project(project)
@@ -353,7 +357,7 @@
difference_found = True
if difference_found:
- sys.exit(1)
+ return 1
@@ -416,7 +420,7 @@
for package in meta_get_packagelist(project):
checkout_package(project, package)
else:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
self.do_help(['foo', 'checkout'])
return 2
@@ -464,7 +468,8 @@
elif os.path.isfile(arg):
pacpaths.append(arg)
else:
- sys.exit('osc: error: %s is neither a project or a package directory' % arg)
+ print >>sys.stderr, 'osc: error: %s is neither a project or a package directory' % arg
+ return 1
pacs = findpacs(pacpaths)
@@ -503,7 +508,7 @@
"""
if not args:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
self.do_help(['foo', 'add'])
return 2
@@ -511,8 +516,8 @@
for filename in filenames:
if not os.path.exists(filename):
- print "file '%s' does not exist" % filename
- sys.exit(1)
+ print >>sys.stderr, "file '%s' does not exist" % filename
+ return 1
pacs = findpacs(filenames)
@@ -521,7 +526,7 @@
if filename in pac.excluded:
continue
if filename in pac.filenamelist:
- print 'osc: warning: \'%s\' is already under version control' % filename
+ print >>sys.stderr, 'osc: warning: \'%s\' is already under version control' % filename
continue
pac.addfile(filename)
@@ -585,9 +590,10 @@
# commit only if the upstream revision is the same as the working copy's
upstream_rev = show_upstream_rev(p.prjname, p.name)
if p.rev != upstream_rev:
- print 'Working copy \'%s\' is out of date (rev %s vs rev %s).' % (p.absdir, p.rev, upstream_rev)
- print 'Looks as if you need to update it first.'
- sys.exit(1)
+ print >>sys.stderr, 'Working copy \'%s\' is out of date (rev %s vs rev %s).' \
+ % (p.absdir, p.rev, upstream_rev)
+ print >>sys.stderr, 'Looks as if you need to update it first.'
+ return 1
if not p.todo:
p.todo = p.filenamelist_unvers + p.filenamelist
@@ -728,7 +734,7 @@
"""
if not args:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
self.do_help(['foo', 'delete'])
return 2
@@ -768,7 +774,7 @@
"""
if not args:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
self.do_help(['foo', 'resolved'])
return 2
@@ -843,7 +849,7 @@
"""
if args and len(args) > 1:
- print 'getting results for more than one package is not supported'
+ print >>sys.stderr, 'getting results for more than one package is not supported'
self.do_help(['foo', 'results'])
return 2
@@ -856,7 +862,8 @@
package = store_read_package(wd)
project = store_read_project(wd)
except:
- sys.exit('\'%s\' is not an osc package directory' % wd)
+ print >>sys.stderr, '\'%s\' is not an osc package directory' % wd
+ return 1
print '\n'.join(get_results(project, package))
@@ -879,7 +886,7 @@
"""
if args and len(args) > 1:
- print 'getting results for more than one project is not supported'
+ print >>sys.stderr, 'getting results for more than one project is not supported'
return 2
if args:
@@ -890,7 +897,7 @@
try:
project = store_read_project(wd)
except:
- print '\'%s\' is neither an osc project or package directory' % wd
+ print >>sys.stderr, '\'%s\' is neither an osc project or package directory' % wd
return 1
print '\n'.join(get_prj_results(project, show_legend=opts.legend))
@@ -955,7 +962,8 @@
project = store_read_project(wd)
if args is None or len(args) < 2:
- print 'Missing argument. Valid arguments for this package are:'
+ print >>sys.stderr, 'Missing argument.'
+ print 'Valid arguments for this package are:'
print
self.do_repos(None, None)
print
@@ -970,7 +978,8 @@
except IndexError:
spec = None
except IOError, e:
- sys.exit(e)
+ print >>sys.stderr, e
+ return 1
print ''.join(get_buildinfo(project, package, platform, arch, specfile=spec))
@@ -1025,6 +1034,8 @@
help='Delete old build root before initializing it')
@cmdln.option('--noinit', '--no-init', action='store_true',
help='Skip initialization of build root and start with build immediately.')
+ @cmdln.option('-p', '--prefer-pacs', metavar='DIR', action='append',
+ help='Prefer packages from this directory when installing the build-root')
def do_build(self, subcmd, opts, *args):
"""${cmd_name}: Build a package on your local machine
@@ -1039,13 +1050,12 @@
if present. You may want to set su-wrapper = 'sudo' in .oscrc, and
configure sudo with option NOPASSWD for /usr/bin/build.
- If neither --clean nor --noinit is given,
-
-
+ If neither --clean nor --noinit is given, build will reuse an existing
+ build-root again, removing unneeded packages and add missing ones. This
+ is usually the fastest option.
usage:
osc build [OPTS] PLATFORM ARCH BUILD_DESCR
-
${cmd_option_list}
"""
# Note:
@@ -1066,17 +1076,18 @@
builddist = os.getenv('BUILD_DIST')
if builddist:
- #sys.argv[4] = sys.argv[1]
+ #args[3] = args[0]
hyphen = builddist.rfind('-')
- sys.argv.insert(2, builddist[hyphen+1:])
- sys.argv.insert(2, builddist[:hyphen])
+ args.insert(1, builddist[hyphen+1:])
+ args.insert(1, builddist[:hyphen])
print sys.argv
elif len(args) >= 2 and len(args) < 3:
- print 'Missing argument: build description (spec of dsc file)'
+ print >>sys.stderr, 'Missing argument: build description (spec of dsc file)'
return 2
elif len(args) < 2:
print
+ print >>sys.stderr, 'Missing argument.'
print 'Valid arguments are:'
print 'you have to choose a repo to build on'
print 'possible repositories on this machine are:'
@@ -1095,7 +1106,13 @@
print line.strip()
return 1
- osc.build.main(opts, args)
+ if opts.prefer_pacs:
+ for d in opts.prefer_pacs:
+ if not os.path.isdir(d):
+ print >> sys.stderr, 'Preferred package location \'%s\' is not a directory' % d
+ return 1
+
+ return osc.build.main(opts, args)
@@ -1142,7 +1159,7 @@
"""
if len(args) < 1:
- print 'Missing argument.'
+ print >>sys.stderr, 'Missing argument.'
#self.do_help(['foo', 'rebuildpac'])
return 2
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.95/osc/core.py new/osc-0.95/osc/core.py
--- old/osc-0.95/osc/core.py 2007-04-25 01:00:12.000000000 +0200
+++ new/osc-0.95/osc/core.py 2007-04-25 23:10:49.000000000 +0200
@@ -448,8 +448,8 @@
elif not exists and exists_in_store and not known_by_meta:
state = 'D'
elif not exists and not exists_in_store and not known_by_meta:
- print '%s: not exists and not exists_in_store and not nown_by_meta' % n
- print 'this code path should never be reached!'
+ print >>sys.stderr, '%s: not exists and not exists_in_store and not nown_by_meta' % n
+ print >>sys.stderr, 'this code path should never be reached!'
sys.exit(1)
return state
@@ -481,7 +481,7 @@
name, summary, descr = read_meta_from_spec(specfile)
if name != self.name:
- print 'name from spec does not match name of package... this is probably a problem'
+ print >>sys.stderr, 'name from spec does not match name of package... this is probably a problem'
sys.exit(1)
self.summary = summary
self.descr = descr
@@ -500,8 +500,8 @@
print 'package does not exist yet... creating it'
m = template % (pac, conf.config['user'])
else:
- print 'error getting package meta for project \'%s\' package \'%s\':' % (prj, pac)
- print e
+ print >>sys.stderr, 'error getting package meta for project \'%s\' package \'%s\':' % (prj, pac)
+ print >>sys.stderr, e
sys.exit(1)
f = os.fdopen(fd, 'w')
@@ -726,7 +726,7 @@
v = ''
if v == '':
- print 'error: "%s" is not an osc working copy' % dir
+ print >>sys.stderr, 'error: "%s" is not an osc working copy' % dir
sys.exit(1)
if v != __version__:
@@ -736,11 +736,11 @@
f.write(__version__ + '\n')
f.close()
return
- print
- print 'the osc metadata of your working copy "%s"' % dir
- print 'has the wrong version (%s), should be %s' % (v, __version__)
- print 'please do a fresh checkout'
- print
+ print >>sys.stderr
+ print >>sys.stderr, 'the osc metadata of your working copy "%s"' % dir
+ print >>sys.stderr, 'has the wrong version (%s), should be %s' % (v, __version__)
+ print >>sys.stderr, 'please do a fresh checkout'
+ print >>sys.stderr
sys.exit(1)
@@ -804,8 +804,8 @@
if e.code == 404:
m = template % (pac, conf.config['user'])
else:
- print 'error getting package meta for project \'%s\' package \'%s\':' % (prj, pac)
- print e
+ print >>sys.stderr, 'error getting package meta for project \'%s\' package \'%s\':' % (prj, pac)
+ print >>sys.stderr, e
sys.exit(1)
else:
@@ -820,8 +820,8 @@
if e.code == 404:
m = new_project_templ % (prj, conf.config['user'])
else:
- print 'error getting package meta for project \'%s\':' % prj
- print e
+ print >>sys.stderr, 'error getting package meta for project \'%s\':' % prj
+ print >>sys.stderr, e
sys.exit(1)
f = os.fdopen(fd, 'w')
@@ -861,8 +861,8 @@
if e.code == 404:
m = new_user_template % { 'user': user }
else:
- print 'error getting metadata for user \'%s\':' % user
- print e
+ print >>sys.stderr, 'error getting metadata for user \'%s\':' % user
+ print >>sys.stderr, e
sys.exit(1)
(fd, filename) = tempfile.mkstemp(prefix = 'osc_edituser.', suffix = '.xml', dir = '/tmp')
@@ -1063,8 +1063,8 @@
# create the _link file
# but first, make sure not to overwrite an existing one
if '_link' in meta_get_filelist(dst_project, dst_package):
- print
- print '_link file already exists...! Aborting'
+ print >>sys.stderr
+ print >>sys.stderr, '_link file already exists...! Aborting'
sys.exit(1)
print 'Creating _link...',
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.95/osc/fetch.py new/osc-0.95/osc/fetch.py
--- old/osc-0.95/osc/fetch.py 2006-10-12 15:22:56.000000000 +0200
+++ new/osc-0.95/osc/fetch.py 2007-04-25 23:10:49.000000000 +0200
@@ -88,8 +88,8 @@
try:
os.makedirs(dir, mode=0755)
except OSError, e:
- print 'packagecachedir is not writable for you?'
- print e
+ print >>sys.stderr, 'packagecachedir is not writable for you?'
+ print >>sys.stderr, e
sys.exit(1)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.95/TODO new/osc-0.95/TODO
--- old/osc-0.95/TODO 2007-04-25 01:00:12.000000000 +0200
+++ new/osc-0.95/TODO 2007-05-02 15:49:57.000000000 +0200
@@ -1,5 +1,7 @@
- split functionality that needs prj/pac as commandline arguments into a seperate tool (oscremote? osc -r?)
+- memorize used the api server on checkout
+ - implmement switch command
- implement 'info' command
- implement 'mv' command
- editmeta: the API will return a 500 if the xml is broken... the document
@@ -11,7 +13,6 @@
- zsh completion, or even bash
- add option to disable gpg key checking?
- add support for adding tags to packages?
-- prefer-rpms support for osc build
- plugin-ize subcommand implementation
- look at Susannes extensions
- Allow the package owners/users to signal an abort build.
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org