Hello community,
here is the log from the commit of package osc for openSUSE:Factory checked in at 2016-08-03 11:44:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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 2016-06-25 02:22:09.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.osc.new/osc.changes 2016-08-03 11:44:13.000000000 +0200
@@ -1,0 +2,13 @@
+Fri Jul 29 14:05:52 UTC 2016 - adrian@suse.de
+
+- 0.155.0
+ - osc service runall: runs all service local, independend of the mode
+ This allows to create local files even when disabled or
+ just created at buildtime
+ - support snapcraft.yaml build descriptions
+ - "osc add" of a directory offers to create an archive for uploading it
+ - support usage or preinstall images in local builds
+ - revision control options for "meta prj"
+ - bugfixes and documentation updates
+
+-------------------------------------------------------------------
Old:
----
osc-0.154.0.tar.gz
New:
----
osc-0.155.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ osc.spec ++++++
--- /var/tmp/diff_new_pack.gGO23M/_old 2016-08-03 11:44:14.000000000 +0200
+++ /var/tmp/diff_new_pack.gGO23M/_new 2016-08-03 11:44:14.000000000 +0200
@@ -16,10 +16,10 @@
#
-%define version_unconverted 0.154.0
+%define version_unconverted 0.155.0
Name: osc
-Version: 0.154.0
+Version: 0.155.0
Release: 0
Summary: Open Build Service Commander
License: GPL-2.0+
++++++ PKGBUILD ++++++
--- /var/tmp/diff_new_pack.gGO23M/_old 2016-08-03 11:44:14.000000000 +0200
+++ /var/tmp/diff_new_pack.gGO23M/_new 2016-08-03 11:44:14.000000000 +0200
@@ -1,5 +1,5 @@
pkgname=osc
-pkgver=0.154.0
+pkgver=0.155.0
pkgrel=0
pkgdesc="Open Build Service client"
arch=('i686' 'x86_64')
++++++ _service ++++++
--- /var/tmp/diff_new_pack.gGO23M/_old 2016-08-03 11:44:14.000000000 +0200
+++ /var/tmp/diff_new_pack.gGO23M/_new 2016-08-03 11:44:14.000000000 +0200
@@ -1,7 +1,7 @@
<services>
<service name="tar_scm" mode="disabled">
- <param name="version">0.154.0</param>
- <param name="revision">0.154.0</param>
+ <param name="version">0.155.0</param>
+ <param name="revision">0.155.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.gGO23M/_old 2016-08-03 11:44:14.000000000 +0200
+++ /var/tmp/diff_new_pack.gGO23M/_new 2016-08-03 11:44:14.000000000 +0200
@@ -1,4 +1,4 @@
-osc (0.154.0) unstable; urgency=low
+osc (0.155.0) unstable; urgency=low
- Update to 0.135.0
-- Adrian Schroeter Wed, 28 Jun 2012 10:00:00 +0200
++++++ osc-0.154.0.tar.gz -> osc-0.155.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/NEWS new/osc-0.155.0/NEWS
--- old/osc-0.154.0/NEWS 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/NEWS 2016-07-29 16:03:59.000000000 +0200
@@ -1,3 +1,13 @@
+0.155
+ - osc service runall: runs all service local, independend of the mode
+ This allows to create local files even when disabled or
+ just created at buildtime
+ - support snapcraft.yaml build descriptions
+ - "osc add" of a directory offers to create an archive for uploading it
+ - support usage or preinstall images in local builds
+ - revision control options for "meta prj"
+ - bugfixes and documentation updates
+
0.154
- switch to new obs_scm service when adding git URL's
- set OSC_VERSION environment for source services
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/dist/osc.complete new/osc-0.155.0/dist/osc.complete
--- old/osc-0.154.0/dist/osc.complete 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/dist/osc.complete 2016-07-29 16:03:59.000000000 +0200
@@ -91,7 +91,7 @@
lnkprj=$(command sed -rn '/ /dev/null)
fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/osc/babysitter.py new/osc-0.155.0/osc/babysitter.py
--- old/osc-0.154.0/osc/babysitter.py 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/osc/babysitter.py 2016-07-29 16:03:59.000000000 +0200
@@ -78,7 +78,7 @@
return 1
except KeyboardInterrupt:
print('interrupted!', file=sys.stderr)
- return 1
+ return 130
except oscerr.UserAbort:
print('aborted.', file=sys.stderr)
return 1
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/osc/build.py new/osc-0.155.0/osc/build.py
--- old/osc-0.154.0/osc/build.py 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/osc/build.py 2016-07-29 16:03:59.000000000 +0200
@@ -33,6 +33,11 @@
from .conf import config, cookiejar
+try:
+ from .meter import TextMeter
+except:
+ TextMeter = None
+
change_personality = {
'i686': 'linux32',
'i586': 'linux32',
@@ -123,6 +128,10 @@
self.pacsuffix = 'arch'
if self.buildtype == 'livebuild':
self.pacsuffix = 'deb'
+ if self.buildtype == 'snapcraft':
+ # atm ubuntu is used as base, but we need to be more clever when
+ # snapcraft also supports rpm
+ self.pacsuffix = 'deb'
self.buildarch = root.find('arch').text
if root.find('hostarch') != None:
@@ -161,6 +170,11 @@
self.noinstall_list = [ dep.name for dep in self.deps if dep.noinstall ]
self.installonly_list = [ dep.name for dep in self.deps if dep.installonly ]
+ if root.find('preinstallimage') != None:
+ self.preinstallimage = root.find('preinstallimage')
+ else:
+ self.preinstallimage = None
+
def has_dep(self, name):
for i in self.deps:
@@ -262,6 +276,57 @@
return "%s" % self.name
+def get_preinstall_image(apiurl, arch, cache_dir, img_info):
+ """
+ Searches preinstall image according to build info and downloads it to cache.
+ Returns preinstall image path, source and list of image binaries, which can
+ be used to create rpmlist.
+ NOTE: preinstall image can be used only for new build roots!
+ """
+ imagefile = ''
+ imagesource = ''
+ img_bins = []
+ for bin in img_info.findall('binary'):
+ img_bins.append(bin.text)
+
+ img_project = img_info.get('project')
+ img_repository = img_info.get('repository')
+ img_arch = arch
+ img_pkg = img_info.get('package')
+ img_file = img_info.get('filename')
+ img_hdrmd5 = img_info.get('hdrmd5')
+ if not img_hdrmd5:
+ img_hdrmd5 = img_file
+ cache_path = '%s/%s/%s/%s' % (cache_dir, img_project, img_repository, img_arch)
+ ifile_path = '%s/%s' % (cache_path, img_file)
+ ifile_path_part = '%s.part' % ifile_path
+
+ imagefile = ifile_path
+ imagesource = "%s/%s/%s [%s]" % (img_project, img_repository, img_pkg, img_hdrmd5)
+
+ if not os.path.exists(ifile_path):
+ url = "%s/build/%s/%s/%s/%s/%s" % (apiurl, img_project, img_repository, img_arch, img_pkg, img_file)
+ print("downloading preinstall image %s" % imagesource)
+ if not os.path.exists(cache_path):
+ try:
+ os.makedirs(cache_path, mode=0o755)
+ except OSError as e:
+ print('packagecachedir is not writable for you?', file=sys.stderr)
+ print(e, file=sys.stderr)
+ sys.exit(1)
+ if sys.stdout.isatty() and TextMeter:
+ progress_obj = TextMeter(fo=sys.stdout)
+ else:
+ progress_obj = None
+ gr = OscFileGrabber(progress_obj=progress_obj)
+ try:
+ gr.urlgrab(url, filename=ifile_path_part, text='fetching image')
+ except URLGrabError as e:
+ print("Failed to download! ecode:%i errno:%i" % (e.code, e.errno))
+ return ('', '', [])
+ # download ok, rename partial file to final file name
+ os.rename(ifile_path_part, ifile_path)
+ return (imagefile, imagesource, img_bins)
def get_built_files(pacdir, buildtype):
if buildtype == 'spec':
@@ -293,6 +358,11 @@
'-name', '*.iso*'],
stdout=subprocess.PIPE).stdout.read().strip()
s_built = ''
+ elif buildtype == 'snapcraft':
+ b_built = subprocess.Popen(['find', os.path.join(pacdir, 'OTHER'),
+ '-name', '*.snap'],
+ stdout=subprocess.PIPE).stdout.read().strip()
+ s_built = ''
else:
print('WARNING: Unknown package type \'%s\'.' % buildtype, file=sys.stderr)
b_built = ''
@@ -432,9 +502,11 @@
build_type = 'arch'
if os.path.basename(build_descr) == 'build.collax':
build_type = 'collax'
- if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild']:
+ if os.path.basename(build_descr) == 'snapcraft.yaml':
+ build_type = 'snapcraft'
+ if build_type not in ['spec', 'dsc', 'kiwi', 'arch', 'collax', 'livebuild', 'snapcraft']:
raise oscerr.WrongArgs(
- 'Unknown build type: \'%s\'. Build description should end in .spec, .dsc, .kiwi or .livebuild.' \
+ 'Unknown build type: \'%s\'. Build description should end in .spec, .dsc, .kiwi, .yaml or .livebuild.' \
% build_type)
if not os.path.isfile(build_descr):
raise oscerr.WrongArgs('Error: build description file named \'%s\' does not exist.' % build_descr)
@@ -781,6 +853,21 @@
# implicitly trust the project we are building for
check_trusted_projects(apiurl, [ i for i in bi.projects.keys() if not i == prj ])
+ imagefile = ''
+ imagesource = ''
+ imagebins = []
+ if (not config['no_preinstallimage'] and not opts.nopreinstallimage and
+ bi.preinstallimage and
+ not opts.noinit and not opts.offline and
+ (opts.clean or (not os.path.exists(build_root + "/installed-pkg") and
+ not os.path.exists(build_root + "/.build/init_buildsystem.data")))):
+ (imagefile, imagesource, imagebins) = get_preinstall_image(apiurl, arch, cache_dir, bi.preinstallimage)
+ if imagefile:
+ # remove binaries from build deps which are included in preinstall image
+ for i in bi.deps:
+ if i.name in imagebins:
+ bi.remove_dep(i.name)
+
# now update the package cache
fetcher.run(bi)
@@ -981,8 +1068,15 @@
rpmlist = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps if not i.noinstall ]
else:
rpmlist = [ '%s %s\n' % (i.name, i.fullfilename) for i in bi.deps ]
+ for i in imagebins:
+ rpmlist.append('%s preinstallimage\n' % i)
rpmlist += [ '%s %s\n' % (i[0], i[1]) for i in rpmlist_prefers ]
+ if imagefile:
+ rpmlist.append('preinstallimage: %s\n' % imagefile)
+ if imagesource:
+ rpmlist.append('preinstallimagesource: %s\n' % imagesource)
+
rpmlist.append('preinstall: ' + ' '.join(bi.preinstall_list) + '\n')
rpmlist.append('vminstall: ' + ' '.join(bi.vminstall_list) + '\n')
rpmlist.append('runscripts: ' + ' '.join(bi.runscripts_list) + '\n')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/osc/commandline.py new/osc-0.155.0/osc/commandline.py
--- old/osc-0.154.0/osc/commandline.py 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/osc/commandline.py 2016-07-29 16:03:59.000000000 +0200
@@ -450,7 +450,7 @@
def do_addchannels(self, subcmd, opts, *args):
"""${cmd_name}: Add channels to project.
- The command adds all channels which are defined to be used for a given source package.
+ The command adds all channels which are defined to be used for a given source package.
The source link target is used to lookup the channels. The command can be
used for a certain package or for all in the specified project.
@@ -740,6 +740,10 @@
@cmdln.option('-F', '--file', metavar='FILE',
help='read metadata from FILE, instead of opening an editor. '
'\'-\' denotes standard input. ')
+ @cmdln.option('-r', '--revision', metavar='REV',
+ help='checkout given revision instead of head revision. For prj and prjconf meta only')
+ @cmdln.option('-m', '--message', metavar='TEXT',
+ help='specify log message TEXT. For prj and prjconf meta only')
@cmdln.option('-e', '--edit', action='store_true',
help='edit metadata')
@cmdln.option('-c', '--create', action='store_true',
@@ -774,6 +778,8 @@
the --file switch. If the argument is '-', input is taken from stdin:
osc meta prjconf home:user | sed ... | osc meta prjconf home:user -F -
+ For meta prj and prjconf updates optional commit messages can be applied with --message.
+
When trying to edit a non-existing resource, it is created implicitly.
@@ -783,9 +789,10 @@
osc meta pkg PRJ PKG -e
Usage:
+ osc meta [-r|--revision REV] ARGS...
osc meta ARGS...
- osc meta -e|--edit ARGS...
- osc meta -F|--file ARGS...
+ osc meta [-m|--message TEXT] -e|--edit ARGS...
+ osc meta [-m|--message TEXT] -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}
@@ -873,17 +880,20 @@
if opts.edit or opts.file:
raise oscerr.WrongArgs('A pattern file argument is required.')
+ if cmd not in ['prj', 'prjconf'] and (opts.message or opts.revision):
+ raise oscerr.WrongOptions('options --revision and --message are only supported for the prj or prjconf subcommand')
+
# show
if not opts.edit and not opts.file and not opts.delete and not opts.create and not opts.set:
if cmd == 'prj':
- sys.stdout.write(''.join(show_project_meta(apiurl, project)))
+ sys.stdout.write(''.join(show_project_meta(apiurl, project, opts.revision)))
elif cmd == 'pkg':
sys.stdout.write(''.join(show_package_meta(apiurl, project, package)))
elif cmd == 'attribute':
sys.stdout.write(''.join(show_attribute_meta(apiurl, project, package, subpackage,
opts.attribute, opts.attribute_defaults, opts.attribute_project)))
elif cmd == 'prjconf':
- sys.stdout.write(''.join(show_project_conf(apiurl, project)))
+ sys.stdout.write(''.join(show_project_conf(apiurl, project, opts.revision)))
elif cmd == 'user':
r = get_user_meta(apiurl, user)
if r:
@@ -907,6 +917,7 @@
remove_linking_repositories=opts.remove_linking_repositories,
path_args=quote_plus(project),
apiurl=apiurl,
+ msg = opts.message,
template_args=({
'name': project,
'user': conf.get_apiurl_usr(apiurl)}))
@@ -923,6 +934,7 @@
edit=True,
path_args=quote_plus(project),
apiurl=apiurl,
+ msg = opts.message,
template_args=None)
elif cmd == 'user':
edit_meta(metatype='user',
@@ -972,6 +984,7 @@
force=opts.force,
remove_linking_repositories=opts.remove_linking_repositories,
apiurl=apiurl,
+ msg = opts.message,
path_args=quote_plus(project))
elif cmd == 'pkg':
edit_meta(metatype='pkg',
@@ -984,6 +997,7 @@
data=f,
edit=opts.edit,
apiurl=apiurl,
+ msg = opts.message,
path_args=quote_plus(project))
elif cmd == 'user':
edit_meta(metatype='user',
@@ -1703,7 +1717,7 @@
args = slash_split(args)
apiurl = self.get_api_url()
-
+
i = 0
actionsxml = ""
supersede = []
@@ -1779,8 +1793,8 @@
osc requestmaintainership PROJECT PACKAGE # for current user
osc requestmaintainership PROJECT PACKAGE USER # request for specified user
osc requestmaintainership PROJECT PACKAGE group:NAME # request for specified group
-
- osc requestbugownership ... # accepts same parameters but uses bugowner role
+
+ osc requestbugownership ... # accepts same parameters but uses bugowner role
${cmd_option_list}
"""
@@ -2296,7 +2310,7 @@
if cmd == 'approvenew':
print("\n *** Approve them all ? [y/n] ***")
if sys.stdin.read(1) == "y":
-
+
if not opts.message:
opts.message = edit_message()
for result in results:
@@ -2412,7 +2426,7 @@
if repl.lower() != 'y':
print('Aborted...', file=sys.stderr)
raise oscerr.UserAbort()
-
+
if not opts.message:
tmpl = change_request_state_template(rq, state_map[cmd])
opts.message = edit_message(template=tmpl)
@@ -2500,12 +2514,10 @@
Obsolete command to edit metadata. Use 'meta' now.
See the help output of 'meta'.
-
"""
- print('This command is obsolete. Use \'osc meta <metatype> ...\'.', file=sys.stderr)
- print('See \'osc help meta\'.', file=sys.stderr)
- #self.do_help([None, 'meta'])
+ print("This command is obsolete. Use 'osc meta <metatype> ...'.", file=sys.stderr)
+ print("See 'osc help meta'.", file=sys.stderr)
return 2
@@ -2878,7 +2890,7 @@
${cmd_option_list}
"""
-
+
args = slash_split(args)
apiurl = self.get_api_url()
@@ -2936,7 +2948,7 @@
${cmd_option_list}
"""
-
+
# FIXME: additional parameters can be a certain repo list to create a partitial release
args = slash_split(args)
@@ -3054,7 +3066,7 @@
osc maintenancerequest [ SOURCEPROJECT [ SOURCEPACKAGES RELEASEPROJECT ] ]
osc maintenancerequest .
- The 2nd line when issued within a package directory provides a short cut to submit a single
+ The 2nd line when issued within a package directory provides a short cut to submit a single
package (the one in the current directory) from the project of this package to be submitted
to the release project this package links to. This syntax is only valid when specified from
a package subdirectory.
@@ -3214,7 +3226,7 @@
line+=" using sources from %s/%s"%(d.get('project'), d.get('package'))
print(line)
return
-
+
apiopt = ''
if conf.get_configParser().get('general', 'apiurl') != apiurl:
apiopt = '-A %s ' % apiurl
@@ -3309,7 +3321,7 @@
print('defaulting to %s/%s' % (def_p, args[0]), file=sys.stderr)
# python has no args.unshift ???
args = [ def_p, args[0] ]
-
+
if len(args) == 0 and is_package_dir('.'):
args = (store_read_project('.'), store_read_package('.'))
@@ -3355,7 +3367,7 @@
missingok=False,
maintenance=opts.maintenance,
newinstance=opts.new_package)
-
+
if exists:
print('Using existing branch project: %s' % targetprj, file=sys.stderr)
@@ -3570,25 +3582,36 @@
@cmdln.hide(1)
def do_deletepac(self, subcmd, opts, *args):
- print("""${cmd_name} is obsolete !
+ """${cmd_name}:
+
+ Obsolete command to delete package. Use 'delete' or 'rdelete' now.
+
+ See the help output of 'delete' and 'rdelete'.
+ """
+
+ print("""Command deletepac is obsolete !
Please use either
osc delete for checked out packages or projects
or
- osc rdelete for server side operations.""")
+ osc rdelete for server side operations.""", file=sys.stderr)
- sys.exit(1)
+ return 2
@cmdln.hide(1)
@cmdln.option('-f', '--force', action='store_true',
help='deletes a project and its packages')
def do_deleteprj(self, subcmd, opts, project):
- """${cmd_name} is obsolete !
+ """${cmd_name}:
- Please use
- osc rdelete PROJECT
+ Obsolete command to delete project. Use 'rdelete' now.
+
+ See the help output of 'rdelete'.
"""
- sys.exit(1)
+
+ print("This command is obsolete. Use 'osc rdelete <project>'.", file=sys.stderr)
+ print("See 'osc help rdelete'.", file=sys.stderr)
+ return 2
@cmdln.alias('metafromspec')
@cmdln.alias('updatepkgmetafromspec')
@@ -3655,7 +3678,7 @@
if (subcmd == 'ldiff' or subcmd == 'linkdiff'):
opts.link = True
args = parseargs(args)
-
+
pacs = None
if not opts.link or not len(args) == 2:
pacs = findpacs(args)
@@ -4186,7 +4209,7 @@
while inside a project directory:
osc co PACKAGE # check out PACKAGE from project
-
+
with the result of rpm -q --qf '%%{DISTURL}\\n' PACKAGE
osc co obs://API/PROJECT/PLATFORM/REVISION-PACKAGE
@@ -4256,20 +4279,16 @@
print_request_list(apiurl, project, package)
elif project:
- prj_dir = project
+ prj_dir = opts.output_dir if opts.output_dir else project
if sys.platform[:3] == 'win':
prj_dir = prj_dir.replace(':', ';')
if os.path.exists(prj_dir):
- sys.exit('osc: project \'%s\' already exists' % project)
+ sys.exit('osc: project directory \'%s\' already exists' % prj_dir)
# check if the project does exist (show_project_meta will throw an exception)
show_project_meta(apiurl, project)
- if opts.output_dir is not None:
- init_dir=opts.output_dir
- else:
- init_dir=prj_dir
- Project.init_project(apiurl, init_dir, project, conf.config['do_package_tracking'])
+ Project.init_project(apiurl, prj_dir, project, conf.config['do_package_tracking'])
print(statfrmt('A', prj_dir))
# all packages
@@ -4298,7 +4317,7 @@
prj_dir = prj_dir, service_files = opts.source_service_files, \
server_service_files = opts.server_side_source_service_files, \
progress_obj=self.download_progress, size_limit=opts.limit_size, \
- meta=opts.meta,outdir=outputdir)
+ meta=opts.meta)
except oscerr.LinkExpandError as e:
print('Link cannot be expanded:\n', e, file=sys.stderr)
print('Use "osc repairlink" for fixing merge conflicts:\n', file=sys.stderr)
@@ -4413,8 +4432,17 @@
addGitSource(arg)
else:
addDownloadUrlService(arg)
- else:
- addFiles([arg])
+ continue
+ if os.path.isdir(arg):
+ resp = raw_input("%s is a directory, do you want to archive it for submission? (y/n)" % (arg))
+ if resp not in ('y', 'Y'):
+ continue
+ archive = ("%s.obscpio" % arg)
+ run_external("find %s | cpio -o -H newc > %s" % (arg, archive), shell=True)
+ addFiles([archive])
+ continue
+
+ addFiles([arg])
def do_mkpac(self, subcmd, opts, *args):
@@ -4863,8 +4891,17 @@
@cmdln.hide(1)
def do_results_meta(self, subcmd, opts, *args):
- print("Command results_meta is obsolete. Please use: osc results --xml")
- sys.exit(1)
+ """${cmd_name}:
+
+ Obsolete command to show build results. Use 'results --xml' now.
+
+ See the help output of 'results'.
+ """
+
+ print("This command is obsolete. Use 'osc results --xml'.",
+ file=sys.stderr)
+ print("See 'osc help results'.", file=sys.stderr)
+ return 2
@cmdln.hide(1)
@cmdln.option('-l', '--last-build', action='store_true',
@@ -4876,10 +4913,17 @@
@cmdln.option('', '--xml', action='store_true',
help='generate output in XML (former results_meta)')
def do_rresults(self, subcmd, opts, *args):
- print("Command rresults is obsolete. Running 'osc results' instead")
- self.do_results('results', opts, *args)
- sys.exit(1)
+ """${cmd_name}:
+ Obsolete command to show build results. Use 'results' now.
+
+ See the help output of 'results'.
+ """
+
+ print("Command rresults is obsolete. Running 'osc results' instead",
+ file=sys.stderr)
+ print("See 'osc help results'.", file=sys.stderr)
+ return self.do_results('results', opts, *args)
@cmdln.option('-f', '--force', action='store_true', default=False,
help="Don't ask and delete files")
@@ -5061,8 +5105,17 @@
@cmdln.hide(1)
def do_rprjresults(self, subcmd, opts, *args):
- print("Command rprjresults is obsolete. Please use 'osc prjresults'")
- sys.exit(1)
+ """${cmd_name}:
+
+ Obsolete command to show project-wide build results. Use 'prjresults' now.
+
+ See the help output of 'prjresults'.
+ """
+
+ print("Command rprjresults is obsolete. Please use 'osc prjresults'",
+ file=sys.stderr)
+ print("See 'osc help prjresults'.", file=sys.stderr)
+ return 2
@cmdln.alias('bl')
@cmdln.alias('blt')
@@ -5318,7 +5371,7 @@
if len(args) < 2:
self.print_repos()
-
+
apiurl = self.get_api_url()
if len(args) == 2: # 2
@@ -5490,10 +5543,14 @@
raise oscerr.WrongArgs('error: a build description is needed if \'--prefer-pkgs\' is used')
elif opts.prefer_pkgs:
from .build import get_prefer_pkgs
+ from .util import cpio
print('Scanning the following dirs for local packages: %s' % ', '.join(opts.prefer_pkgs))
- prefer_pkgs, cpio = get_prefer_pkgs(opts.prefer_pkgs, arch, os.path.splitext(build_descr)[1])
- cpio.add(os.path.basename(build_descr), build_descr_data)
- build_descr_data = cpio.get()
+ cpiodata = cpio.CpioWrite()
+ prefer_pkgs, cpio = get_prefer_pkgs(opts.prefer_pkgs, arch,
+ os.path.splitext(build_descr)[1],
+ cpiodata)
+ cpiodata.add(os.path.basename(build_descr), build_descr_data)
+ build_descr_data = cpiodata.get()
print(''.join(get_buildinfo(apiurl,
project, package, repository, arch,
@@ -5592,7 +5649,7 @@
for repo in get_repos_of_project(apiurl, project):
if (disabled is None) or ((disabled is not None) and (repo.name not in disabled)):
data += [repo.name, repo.arch]
-
+
for row in build_table(2, data, width=2):
print(row)
@@ -5669,7 +5726,7 @@
# reduce(lambda x, y: x + y, (glob.glob(x) for x in ('*.spec', '*.dsc', '*.kiwi')))
# but be a bit more readable :)
descr = glob.glob('*.spec') + glob.glob('*.dsc') + glob.glob('*.kiwi') + glob.glob('*.livebuild') + glob.glob('PKGBUILD') + glob.glob('build.collax')
-
+
# FIXME:
# * request repos from server and select by build type.
if not arg_descr and len(descr) == 1:
@@ -5726,7 +5783,7 @@
@cmdln.option('--nochecks', '--no-checks', action='store_true',
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)')
+ help='Skip signature verification (via pgp keys) of packages used for build. (Global config in .oscrc: no_verify)')
@cmdln.option('--noservice', '--no-service', action='store_true',
help='Skip run of local source services as specified in _service file.')
@cmdln.option('-p', '--prefer-pkgs', metavar='DIR', action='append',
@@ -5792,6 +5849,8 @@
help='perform the build on a remote server - user@server:~/remote/directory')
@cmdln.option('--trust-all-projects', action='store_true',
help='trust packages from all projects')
+ @cmdln.option('--nopreinstallimage', '--no-preinstallimage', action='store_true',
+ help='Do not use preinstall images for creating the build root.')
def do_build(self, subcmd, opts, *args):
"""${cmd_name}: Build a package on your local machine
@@ -5858,7 +5917,7 @@
except:
print("WARNING: package is not existing on server yet")
opts.local_package = True
-
+
if opts.offline or opts.local_package or r == None:
print("WARNING: source service from package or project will not be executed. This may not be the same build as on server!")
elif (conf.config['local_service_run'] and not opts.noservice) and not opts.noinit:
@@ -5885,6 +5944,9 @@
if opts.offline and opts.preload:
raise oscerr.WrongOptions('--offline and --preload are mutually exclusive')
+ if opts.preload:
+ opts.nopreinstallimage = True
+
print('Building %s for %s/%s' % (args[2], args[0], args[1]))
if not opts.host:
return osc.build.main(self.get_api_url(), opts, args)
@@ -5934,7 +5996,7 @@
return ret
return 0
-
+
cwd = os.getcwd()
basename = os.path.basename(cwd)
@@ -6187,8 +6249,16 @@
@cmdln.hide(1)
def do_rlog(self, subcmd, opts, *args):
- print("Command rlog is obsolete. Please use 'osc log'")
- sys.exit(1)
+ """${cmd_name}:
+
+ Obsolete command to show commit logs. Use 'log' now.
+
+ See the help output of 'log'.
+ """
+
+ print("This command is obsolete. Use 'osc log'.", file=sys.stderr)
+ print("See 'osc help log'.", file=sys.stderr)
+ return 2
@cmdln.option('-r', '--revision', metavar='rev',
@@ -6268,14 +6338,14 @@
run r run defined services locally, it takes an optional parameter to run only a
specified source service. In case parameters exist for this one in _service file
they are used.
- localrun lr run services locally and store files as local created
- disabledrun dr run disabled or server side only services locally and store files as local created
+ runall ra run all services independend of the used mode
remoterun rr trigger a re-run on the server side
merge commits all server side generated files and drops the _service definition
wait waits until the service finishes and returns with an error if it failed
${cmd_option_list}
"""
+ # disabledrun and localrun exists as well, but are considered to be obsolete
args = slash_split(args)
project = package = singleservice = mode = None
@@ -6299,7 +6369,7 @@
command = args[0]
- if not (command in ( 'run', 'localrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'r', 'rr', 'merge', 'wait' )):
+ if not (command in ( 'runall', 'ra', 'run', 'localrun', 'disabledrun', 'remoterun', 'lr', 'dr', 'r', 'rr', 'merge', 'wait' )):
raise oscerr.WrongArgs('Wrong command given.')
if command == "remoterun" or command == "rr":
@@ -6314,7 +6384,7 @@
print(mergeservice(apiurl, project, package))
return
- if command in ('run', 'localrun', 'disabledrun', 'lr', 'dr', 'r'):
+ if command in ('runall', 'ra', 'run', 'localrun', 'disabledrun', 'lr', 'dr', 'r'):
if not is_package_dir(os.curdir):
raise oscerr.WrongArgs('Local directory is no package')
p = Package(".")
@@ -6322,6 +6392,8 @@
mode = "local"
elif command == "disabledrun" or command == "dr":
mode = "disabled"
+ elif command == "runall" or command == "ra":
+ mode = "all"
return p.run_source_services(mode, singleservice)
@@ -7360,7 +7432,7 @@
osc maintainer <options>
osc maintainer PRJ <options>
osc maintainer PRJ PKG <options>
-
+
The tool looks up the default responsible person for a certain project or package.
When using with an OBS 2.4 (or later) server it is doing the lookup for
a given binary according to the server side configuration of default owners.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/osc/conf.py new/osc-0.155.0/osc/conf.py
--- old/osc-0.154.0/osc/conf.py 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/osc/conf.py 2016-07-29 16:03:59.000000000 +0200
@@ -128,6 +128,7 @@
'http_full_debug': '0',
'http_retries': '3',
'verbose': '1',
+ 'no_preinstallimage': '0',
'traceback': '0',
'post_mortem': '0',
'use_keyring': '0',
@@ -188,7 +189,7 @@
boolean_opts = ['debug', 'do_package_tracking', 'http_debug', 'post_mortem', 'traceback', 'check_filelist', 'plaintext_passwd',
'checkout_no_colon', 'checkout_rooted', 'check_for_request_on_action', 'linkcontrol', 'show_download_progress', 'request_show_interactive',
'request_show_source_buildstatus', 'review_inherit_group', 'use_keyring', 'gnome_keyring', 'no_verify', 'builtin_signature_check',
- 'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time']
+ 'http_full_debug', 'include_request_from_project', 'local_service_run', 'buildlog_strip_time', 'no_preinstallimage']
api_host_options = ['user', 'pass', 'passx', 'aliases', 'http_headers', 'email', 'sslcertck', 'cafile', 'capath', 'trusted_prj']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/osc/core.py new/osc-0.155.0/osc/core.py
--- old/osc-0.154.0/osc/core.py 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/osc/core.py 2016-07-29 16:03:59.000000000 +0200
@@ -5,7 +5,7 @@
from __future__ import print_function
-__version__ = '0.154.0'
+__version__ = '0.155.0'
# __store_version__ is to be incremented when the format of the working copy
# "store" changes in an incompatible way. Please add any needed migration
@@ -398,18 +398,19 @@
# recreate files
ret = 0
for service in allservices:
- if singleservice and service['name'] != singleservice:
- continue
- if service['mode'] == "buildtime":
- continue
- if service['mode'] == "serveronly" and callmode != "disabled":
- continue
- if service['mode'] == "disabled" and callmode != "disabled":
- continue
- if service['mode'] != "disabled" and callmode == "disabled":
- continue
- if service['mode'] != "trylocal" and service['mode'] != "localonly" and callmode == "trylocal":
- continue
+ if callmode != "all":
+ if singleservice and service['name'] != singleservice:
+ continue
+ if service['mode'] == "buildtime":
+ continue
+ if service['mode'] == "serveronly" and callmode != "disabled":
+ continue
+ if service['mode'] == "disabled" and callmode != "disabled":
+ continue
+ if service['mode'] != "disabled" and callmode == "disabled":
+ continue
+ if service['mode'] != "trylocal" and service['mode'] != "localonly" and callmode == "trylocal":
+ continue
temp_dir = None
try:
temp_dir = tempfile.mkdtemp(dir=dir, suffix='.%s.service' % service['name'])
@@ -428,7 +429,7 @@
# updating _services.
return r
- if service['mode'] == "disabled" or service['mode'] == "trylocal" or service['mode'] == "localonly" or callmode == "local" or callmode == "trylocal":
+ if service['mode'] == "disabled" or service['mode'] == "trylocal" or service['mode'] == "localonly" or callmode == "local" or callmode == "trylocal" or callmode == "all":
for filename in os.listdir(temp_dir):
os.rename(os.path.join(temp_dir, filename), os.path.join(dir, filename))
else:
@@ -1653,6 +1654,8 @@
def is_link_to_different_project(self):
"""Check if the package is a link to a different project."""
+ if self.name == "_project":
+ return False
orgprj = self.get_local_origin_project()
return self.prjname != orgprj
@@ -3360,14 +3363,33 @@
return sorted([ node.get('name') for node in root if node.get('name')])
-def show_project_meta(apiurl, prj):
- url = makeurl(apiurl, ['source', prj, '_meta'])
- f = http_GET(url)
+def show_project_meta(apiurl, prj, rev=None):
+ if rev:
+ query = {}
+ query['rev'] = rev
+ url = makeurl(apiurl, ['source', prj, '_project', '_meta'], query)
+ try:
+ f = http_GET(url)
+ except HTTPError as e:
+ error_help = "%d" % e.code
+ os_err = e.hdrs.get('X-Opensuse-Errorcode')
+ if os_err:
+ error_help = "%s (%d) project: %s" % (os_err, e.code, prj)
+ if e.code == 404 and os_err == 'unknown_package':
+ error_help = 'option -r|--revision is not supported by this OBS version'
+ e.osc_msg = 'BuildService API error: %s' % error_help
+ raise
+ else:
+ url = makeurl(apiurl, ['source', prj, '_meta'])
+ f = http_GET(url)
return f.readlines()
+def show_project_conf(apiurl, prj, rev=None):
+ query = {}
+ if rev:
+ query['rev'] = rev
-def show_project_conf(apiurl, prj):
- url = makeurl(apiurl, ['source', prj, '_config'])
+ url = makeurl(apiurl, ['source', prj, '_config'], query)
f = http_GET(url)
return f.readlines()
@@ -3601,7 +3623,7 @@
return data
-def make_meta_url(metatype, path_args=None, apiurl=None, force=False, remove_linking_repositories=False):
+def make_meta_url(metatype, path_args=None, apiurl=None, force=False, remove_linking_repositories=False, msg=None):
global metatypes
if not apiurl:
@@ -3618,6 +3640,8 @@
query = { 'force': '1' }
if remove_linking_repositories:
query['remove_linking_repositories'] = '1'
+ if msg:
+ query['comment'] = msg
return makeurl(apiurl, [path], query)
@@ -3630,7 +3654,8 @@
force=False,
remove_linking_repositories=False,
change_is_required=False,
- apiurl=None):
+ apiurl=None,
+ msg=None):
global metatypes
@@ -3657,7 +3682,7 @@
print(' osc meta pkg %s %s -e' % (unquote(project), package))
return
- url = make_meta_url(metatype, path_args, apiurl, force, remove_linking_repositories)
+ url = make_meta_url(metatype, path_args, apiurl, force, remove_linking_repositories, msg)
f = metafile(url, data, change_is_required, metatypes[metatype]['file_ext'])
if edit:
@@ -5415,7 +5440,7 @@
rmap['dirty'] = node.get('dirty')
rmap['repostate'] = node.get('code')
rmap['pkg'] = rmap['package'] = rmap['pac'] = ''
- rmap['code'] = ''
+ rmap['code'] = node.get('code')
rmap['details'] = ''
details = None
statusnode = node.find('status')
@@ -5457,13 +5482,13 @@
lines = res['details'].split(',')
res['status'] += ': ' + '\n '.join(lines)
else:
- res['status'] += ': %s' % (res['details'], )
+ res['status'] += ': %s' % res['details']
if res['dirty']:
if verbose:
res['status'] = 'outdated (was: %s)' % res['status']
else:
res['status'] += '*'
- elif res['code'] in ('succeeded') and res['repostate'] != "published":
+ elif res['code'] in ('succeeded', ) and res['repostate'] != "published":
if verbose:
res['status'] += '(unpublished)'
else:
@@ -6903,7 +6928,12 @@
print('unable to get source buildstatus: no source actions defined')
for action in src_actions:
print('%s/%s:' % (action.src_project, action.src_package))
- print('\n'.join(get_results(apiurl, action.src_project, action.src_package)))
+ try:
+ print('\n'.join(get_results(apiurl, action.src_project, action.src_package)))
+ except HTTPError as e:
+ if e.code != 404:
+ raise
+ print('unable to retrieve the buildstatus: %s' % e)
print_request(request)
try:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/osc-0.154.0/tests/common.py new/osc-0.155.0/tests/common.py
--- old/osc-0.154.0/tests/common.py 2016-04-11 10:49:56.000000000 +0200
+++ new/osc-0.155.0/tests/common.py 2016-07-29 16:03:59.000000000 +0200
@@ -93,8 +93,11 @@
raise RuntimeError('exp or expfile required')
if exp is not None:
# use req.data instead of req.get_data() for python3 compatiblity
- if req.data != bytes(exp, "utf-8"):
- raise RequestDataMismatch(req.get_full_url(), repr(req.get_data()), repr(exp))
+ data = req.data
+ if hasattr(data, 'read'):
+ data = data.read()
+ if data != bytes(exp, "utf-8"):
+ raise RequestDataMismatch(req.get_full_url(), repr(data), repr(exp))
return self.__get_response(req.get_full_url(), **kwargs)
def __get_response(self, url, **kwargs):
++++++ osc.dsc ++++++
--- /var/tmp/diff_new_pack.gGO23M/_old 2016-08-03 11:44:15.000000000 +0200
+++ /var/tmp/diff_new_pack.gGO23M/_new 2016-08-03 11:44:15.000000000 +0200
@@ -1,6 +1,6 @@
Format: 1.0
Source: osc
-Version: 0.154.0
+Version: 0.155.0
Binary: osc
Maintainer: Adrian Schroeter
Architecture: any