Hello community,
here is the log from the commit of package osc
checked in at Thu May 10 18:57:23 CEST 2007.
--------
--- osc/osc.changes 2007-05-08 12:23:41.000000000 +0200
+++ osc/osc.changes 2007-05-10 16:34:05.000000000 +0200
@@ -1,0 +2,8 @@
+Thu May 10 16:33:57 CEST 2007 - poeml@suse.de
+
+- update to r1652:
+- build: implement -x/--extra-pkgs option (passed to backend and
+ included in buildinfo result)
+- make filling out of username in templates work again
+
+-------------------------------------------------------------------
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.v18217/_old 2007-05-10 18:57:06.000000000 +0200
+++ /var/tmp/diff_new_pack.v18217/_new 2007-05-10 18:57:06.000000000 +0200
@@ -13,7 +13,7 @@
Name: osc
BuildRequires: python-devel
Version: 0.96
-Release: 1
+Release: 3
Group: Development/Tools/Other
License: GNU General Public License (GPL)
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -63,6 +63,11 @@
%doc README TODO NEWS
%changelog
+* Thu May 10 2007 - poeml@suse.de
+- update to r1652:
+- build: implement -x/--extra-pkgs option (passed to backend and
+ included in buildinfo result)
+- make filling out of username in templates work again
* Tue May 08 2007 - poeml@suse.de
- update to r1644:
- don't allow to delete projects, as long it is not implemented in
++++++ debian.changelog ++++++
--- osc/debian.changelog 2007-05-08 12:24:29.000000000 +0200
+++ osc/debian.changelog 2007-05-10 16:34:51.000000000 +0200
@@ -1,3 +1,11 @@
+osc (0.96-3) unstable; urgency=high
+ * update to r1652:
+ - build: implement -x/--extra-pkgs option (passed to backend and
+ included in buildinfo result)
+ - make filling out of username in templates work again
+
+ -- Peter Poeml Tue, 10 May 2007 00:00:00 +0200
+
osc (0.96-2) unstable; urgency=high
* update to r1644:
- don't allow to delete projects, as long it is not implemented in
++++++ osc-0.96.tar.gz ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/NEWS new/osc-0.96/NEWS
--- old/osc-0.96/NEWS 2007-05-08 12:21:51.000000000 +0200
+++ new/osc-0.96/NEWS 2007-05-10 16:33:43.000000000 +0200
@@ -1,4 +1,6 @@
since 0.96:
+- build: implement -x/--extra-pkgs option (passed to backend and included in buildinfo result)
+- make filling out of username in templates work again
- don't try to delete projects, as long it is not implemented in the backend
- use new API route for downloading binaries also in configured URLs
- make deletepac work again
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/osc/build.py new/osc-0.96/osc/build.py
--- old/osc-0.96/osc/build.py 2007-05-04 23:40:35.000000000 +0200
+++ new/osc-0.96/osc/build.py 2007-05-09 11:36:55.000000000 +0200
@@ -11,6 +11,7 @@
import sys
from tempfile import NamedTemporaryFile
from osc.fetch import *
+from osc.core import get_buildinfo, store_read_apiurl, store_read_project, store_read_package
import osc.conf
try:
from xml.etree import cElementTree as ET
@@ -238,10 +239,21 @@
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))
- if rc:
+ try:
+ bi_text = ''.join(get_buildinfo(store_read_apiurl(os.curdir),
+ store_read_project(os.curdir),
+ store_read_package(os.curdir),
+ repo,
+ arch,
+ specfile=spec,
+ addlist=opts.extra_pkgs))
+
+ except:
print >>sys.stderr, 'wrong repo/arch?'
- sys.exit(rc)
+ sys.exit(1)
+ bi_file.write(bi_text)
+ bi_file.flush()
+
bi = Buildinfo(bi_file.name)
rpmlist_prefers = []
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/osc/commandline.py new/osc-0.96/osc/commandline.py
--- old/osc-0.96/osc/commandline.py 2007-05-08 10:59:10.000000000 +0200
+++ new/osc-0.96/osc/commandline.py 2007-05-10 16:29:04.000000000 +0200
@@ -56,6 +56,10 @@
conf.parse_apisrv_url(conf.config['scheme'], self.global_opts.apisrv)
conf.config['apiurl'] = conf.config['scheme'] + '://' + conf.config['apisrv']
+ # XXX unless config['user'] goes away (and is replaced with a handy function, or
+ # config becomes an object, even better), set the global 'user' here as well:
+ conf.config['user'] = conf.config['auth_dict'][conf.config['apisrv']]['user']
+
# finally, initialize urllib2 for to use the credentials for Basic Authentication
conf.init_basicauth(conf.config)
@@ -944,6 +948,8 @@
pass
+ @cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append',
+ help='Add this package when computing the buildinfo')
def do_buildinfo(self, subcmd, opts, *args):
"""${cmd_name}: Shows the build info
@@ -993,7 +999,10 @@
print >>sys.stderr, e
return 1
- print ''.join(get_buildinfo(apiurl, project, package, platform, arch, specfile=spec))
+ print ''.join(get_buildinfo(apiurl,
+ project, package, platform, arch,
+ specfile=spec,
+ addlist=opts.extra_pkgs))
def do_buildconfig(self, subcmd, opts, platform, arch):
@@ -1051,6 +1060,8 @@
help='Prefer packages from this directory when installing the build-root')
@cmdln.option('-k', '--keep-pkgs', metavar='DIR',
help='Save built packages into this directory')
+ @cmdln.option('-x', '--extra-pkgs', metavar='PAC', action='append',
+ help='Add this package when installing the build-root')
def do_build(self, subcmd, opts, *args):
"""${cmd_name}: Build a package on your local machine
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/osc/conf.py new/osc-0.96/osc/conf.py
--- old/osc-0.96/osc/conf.py 2007-05-07 22:14:20.000000000 +0200
+++ new/osc-0.96/osc/conf.py 2007-05-10 16:29:04.000000000 +0200
@@ -19,7 +19,6 @@
{'apisrv': 'https://api.opensuse.org/',
'user': 'poeml',
- 'pass': 'secret',
'auth_dict': {'api.opensuse.org': {'user': 'poeml', 'pass': 'secret'},
'apitest.opensuse.org': {'user': 'poeml', 'pass': 'secret'},
'foo.opensuse.org': {'user': 'foo', 'pass': 'foo'}},
@@ -42,7 +41,6 @@
DEFAULTS = { 'apisrv': 'https://api.opensuse.org/',
'scheme': 'https',
'user': 'your_username',
- 'pass': 'your_password',
'packagecachedir': '/var/tmp/osbuild-packagecache',
'su-wrapper': 'su -c',
'build-cmd': '/usr/bin/build',
@@ -178,7 +176,7 @@
# note that it is not suited for credentials containing spaces
import netrc
try:
- # FIXME: apisrv is a URL now
+ # XXX: apisrv is a URL now, thus requiring the "scheme" setting if https is to be used
netrc_host = parse_apisrv_url(None, DEFAULTS['apisrv'])[1]
config['user'], account, config['pass'] = \
netrc.netrc().authenticators(netrc_host)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/osc-0.96/osc/core.py new/osc-0.96/osc/core.py
--- old/osc-0.96/osc/core.py 2007-05-04 23:51:54.000000000 +0200
+++ new/osc-0.96/osc/core.py 2007-05-10 15:52:13.000000000 +0200
@@ -107,14 +107,6 @@
<login>%(user)s</login>
<email>PUT_EMAIL_ADDRESS_HERE</email>
<realname>PUT_REAL_NAME_HERE</realname>
-
- <host></host>
- <port></port>
-
-
- <host></host>
- <port></port>
-
<watchlist>
<project name="home:%(user)s"/>
</watchlist>
@@ -307,19 +299,22 @@
# escaping '+' in the URL path (note: not in the URL query string) is
# only a workaround for ruby on rails, which swallows it otherwise
- u = makeurl(self.apiurl, ['source', self.prjname, self.name, pathname2url(n)])
+ query = []
if conf.config['do_commits'] == '1':
- u += '?rev=upload'
+ query.append('rev=upload')
+ u = makeurl(self.apiurl, ['source', self.prjname, self.name, pathname2url(n)], query=query)
http_PUT(u, file = os.path.join(self.dir, n))
shutil.copy2(os.path.join(self.dir, n), os.path.join(self.storedir, n))
def commit(self, msg=''):
- u = makeurl(self.apiurl, ['source', self.prjname, self.name])
- u += '?cmd=commit&rev=upload'
- u += '&user=%s' % conf.config['user']
- u += '&comment=%s' % quote_plus(msg)
+ query = []
+ query.append('cmd=commit')
+ query.append('rev=upload')
+ query.append('user=%s' % conf.config['user'])
+ query.append('comment=%s' % quote_plus(msg))
+ u = makeurl(self.apiurl, ['source', self.prjname, self.name], query=query)
#print u
f = http_POST(u)
#print f.read()
@@ -634,13 +629,13 @@
return path
-def makeurl(baseurl, l):
+def makeurl(baseurl, l, query=[]):
"""given a list of path compoments, construct a complete URL"""
- #print 'makeurl:', baseurl, l
+ #print 'makeurl:', baseurl, l, query
scheme, netloc = urlsplit(baseurl)[0:2]
- return urlunsplit((scheme, netloc, '/'.join(l), '', ''))
+ return urlunsplit((scheme, netloc, '/'.join(l), '&'.join(query), ''))
def http_request(method, url, data=None, file=None):
@@ -687,6 +682,7 @@
def urlopen(url, data=None):
"""wrapper around urllib2.urlopen for error handling"""
+
print 'core.urlopen() is deprecated -- use http_GET et al.'
try:
@@ -1277,8 +1273,14 @@
return f.read()
-def get_buildinfo(apiurl, prj, package, platform, arch, specfile=None):
- u = makeurl(apiurl, ['build', prj, platform, arch, package, '_buildinfo'])
+def get_buildinfo(apiurl, prj, package, platform, arch, specfile=None, addlist=None):
+ query = []
+ if addlist:
+ for i in addlist:
+ query.append('add=%s' % quote_plus(i))
+
+ u = makeurl(apiurl, ['build', prj, platform, arch, package, '_buildinfo'], query=query)
+
if specfile:
f = http_POST(u, data=specfile)
else:
@@ -1315,18 +1317,18 @@
def cmd_rebuild(apiurl, prj, package, repo, arch, code=None):
- cmd = prj
- cmd += '?cmd=rebuild'
+ query = []
+ query.append('cmd=rebuild')
if package:
- cmd += '&package=%s' % package
+ query.append('package=%s' % quote_plus(package))
if repo:
- cmd += '&repo=%s' % repo
+ query.append('repo=%s' % quote_plus(repo))
if arch:
- cmd += '&arch=%s' % arch
+ query.append('arch=%s' % quote_plus(arch))
if code:
- cmd += '&code=%s' % code
+ query.append('code=%s' % quote_plus(code))
- u = makeurl(apiurl, ['build', cmd])
+ u = makeurl(apiurl, ['build', prj], query=query)
try:
f = http_POST(u)
except urllib2.HTTPError, e:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org