mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-27 23:16:14 +01:00
+ - make buildhist command usable without checked out package
+ - rename old "platform/s" names to "repository/ies" (internal cleanup only)
This commit is contained in:
parent
7ea7ecee3d
commit
48e96a96fb
2
NEWS
2
NEWS
@ -7,6 +7,8 @@
|
|||||||
- added default project to new getpac and bco subcommand. .oscrc:getpac_default_project = OpenSUSE:Factory
|
- added default project to new getpac and bco subcommand. .oscrc:getpac_default_project = OpenSUSE:Factory
|
||||||
(not added to branch subcommand, to not interfere with its syntax.)
|
(not added to branch subcommand, to not interfere with its syntax.)
|
||||||
- add support for generic python-keyring lib, supports KWallet, Gnome keyring, MacOS and Windows.
|
- add support for generic python-keyring lib, supports KWallet, Gnome keyring, MacOS and Windows.
|
||||||
|
- make buildhist command usable without checked out package
|
||||||
|
- rename old "platform/s" names to "repository/ies" (internal cleanup only)
|
||||||
#
|
#
|
||||||
# Features which require OBS 1.7
|
# Features which require OBS 1.7
|
||||||
#
|
#
|
||||||
|
12
README
12
README
@ -176,10 +176,10 @@ Generates a diff, to view the changes
|
|||||||
|
|
||||||
Shows the build results of the package
|
Shows the build results of the package
|
||||||
osc results
|
osc results
|
||||||
osc results [platform]
|
osc results [repository]
|
||||||
|
|
||||||
Shows the log file of a package (you need to be inside a package directory)
|
Shows the log file of a package (you need to be inside a package directory)
|
||||||
osc log <platform> <arch>
|
osc log <repository> <arch>
|
||||||
|
|
||||||
Shows the URLs of .repo files which are packages sources for Yum/YaST/smart
|
Shows the URLs of .repo files which are packages sources for Yum/YaST/smart
|
||||||
osc repourls [dir]
|
osc repourls [dir]
|
||||||
@ -187,11 +187,11 @@ Shows the URLs of .repo files which are packages sources for Yum/YaST/smart
|
|||||||
Triggers a package rebuild for all repositories/architectures of a package
|
Triggers a package rebuild for all repositories/architectures of a package
|
||||||
osc rebuildpac [dir]
|
osc rebuildpac [dir]
|
||||||
|
|
||||||
Shows available platforms/build targets
|
Shows available repository/build targets
|
||||||
osc platforms
|
osc repository
|
||||||
|
|
||||||
Shows the configured platforms/build targets of a project
|
Shows the configured repository/build targets of a project
|
||||||
osc platforms <project>
|
osc repository <project>
|
||||||
|
|
||||||
Shows meta information
|
Shows meta information
|
||||||
osc meta Apache
|
osc meta Apache
|
||||||
|
@ -245,7 +245,7 @@ class Osc(cmdln.Cmdln):
|
|||||||
|
|
||||||
if opts.binaries and (not opts.repo or not opts.arch):
|
if opts.binaries and (not opts.repo or not opts.arch):
|
||||||
raise oscerr.WrongOptions('Sorry, -r <repo> -a <arch> missing\n'
|
raise oscerr.WrongOptions('Sorry, -r <repo> -a <arch> missing\n'
|
||||||
'You can list repositories with: \'osc platforms <project>\'')
|
'You can list repositories with: \'osc repositories <project>\'')
|
||||||
if opts.binaries and opts.expand:
|
if opts.binaries and opts.expand:
|
||||||
raise oscerr.WrongOptions('Sorry, --binaries and --expand are mutual exclusive.')
|
raise oscerr.WrongOptions('Sorry, --binaries and --expand are mutual exclusive.')
|
||||||
|
|
||||||
@ -1534,9 +1534,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
url_tmpl = 'http://download.opensuse.org/repositories/%s/%s/%s.repo'
|
url_tmpl = 'http://download.opensuse.org/repositories/%s/%s/%s.repo'
|
||||||
for p in pacs:
|
for p in pacs:
|
||||||
platforms = get_platforms_of_project(p.apiurl, p.prjname)
|
repositories = get_repositories_of_project(p.apiurl, p.prjname)
|
||||||
for platform in platforms:
|
for repository in repositories:
|
||||||
print url_tmpl % (p.prjname.replace(':', ':/'), platform, p.prjname)
|
print url_tmpl % (p.prjname.replace(':', ':/'), repository, p.prjname)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1623,7 +1623,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
elif project:
|
elif project:
|
||||||
prj_dir = project
|
prj_dir = project
|
||||||
if sys.platform[:3] == 'win':
|
if sys.repository[:3] == 'win':
|
||||||
prj_dir = prj_dir.replace(':', ';')
|
prj_dir = prj_dir.replace(':', ';')
|
||||||
if os.path.exists(prj_dir):
|
if os.path.exists(prj_dir):
|
||||||
sys.exit('osc: project \'%s\' already exists' % project)
|
sys.exit('osc: project \'%s\' already exists' % project)
|
||||||
@ -2118,15 +2118,16 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
p.clear_from_conflictlist(filename)
|
p.clear_from_conflictlist(filename)
|
||||||
|
|
||||||
|
|
||||||
def do_platforms(self, subcmd, opts, *args):
|
@cmdln.alias('platforms')
|
||||||
"""${cmd_name}: Shows available platforms
|
def do_repositories(self, subcmd, opts, *args):
|
||||||
|
"""${cmd_name}: Shows available repositories
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
1. osc platforms
|
1. osc repositories
|
||||||
Shows all available platforms/build targets
|
Shows all available repositories/build targets
|
||||||
|
|
||||||
2. osc platforms <project>
|
2. osc repositories <project>
|
||||||
Shows the configured platforms/build targets of a project
|
Shows the configured repositories/build targets of a project
|
||||||
|
|
||||||
${cmd_usage}
|
${cmd_usage}
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
@ -2134,9 +2135,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
|
|
||||||
if args:
|
if args:
|
||||||
project = args[0]
|
project = args[0]
|
||||||
print '\n'.join(get_platforms_of_project(conf.config['apiurl'], project))
|
print '\n'.join(get_repositories_of_project(conf.config['apiurl'], project))
|
||||||
else:
|
else:
|
||||||
print '\n'.join(get_platforms(conf.config['apiurl']))
|
print '\n'.join(get_repositories(conf.config['apiurl']))
|
||||||
|
|
||||||
|
|
||||||
@cmdln.hide(1)
|
@cmdln.hide(1)
|
||||||
@ -2293,14 +2294,14 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
@cmdln.alias('bl')
|
@cmdln.alias('bl')
|
||||||
@cmdln.option('-s', '--start', metavar='START',
|
@cmdln.option('-s', '--start', metavar='START',
|
||||||
help='get log starting from the offset')
|
help='get log starting from the offset')
|
||||||
def do_buildlog(self, subcmd, opts, platform, arch):
|
def do_buildlog(self, subcmd, opts, repository, arch):
|
||||||
"""${cmd_name}: Shows the build log of a package
|
"""${cmd_name}: Shows the build log of a package
|
||||||
|
|
||||||
Shows the log file of the build of a package. Can be used to follow the
|
Shows the log file of the build of a package. Can be used to follow the
|
||||||
log while it is being written.
|
log while it is being written.
|
||||||
Needs to be called from within a package directory.
|
Needs to be called from within a package directory.
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH are the first two columns in the 'osc
|
The arguments REPOSITORY and ARCH are the first two columns in the 'osc
|
||||||
results' output.
|
results' output.
|
||||||
|
|
||||||
${cmd_usage}
|
${cmd_usage}
|
||||||
@ -2316,7 +2317,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if opts.start:
|
if opts.start:
|
||||||
offset = int(opts.start)
|
offset = int(opts.start)
|
||||||
|
|
||||||
print_buildlog(apiurl, project, package, platform, arch, offset)
|
print_buildlog(apiurl, project, package, repository, arch, offset)
|
||||||
|
|
||||||
|
|
||||||
@cmdln.alias('rbl')
|
@cmdln.alias('rbl')
|
||||||
@ -2328,9 +2329,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
log while it is being written.
|
log while it is being written.
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc remotebuildlog project package platform arch
|
osc remotebuildlog project package repository arch
|
||||||
or
|
or
|
||||||
osc remotebuildlog project/package/platform/arch
|
osc remotebuildlog project/package/repository/arch
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
args = slash_split(args)
|
args = slash_split(args)
|
||||||
@ -2360,11 +2361,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
The returned data is XML and contains a list of the packages used in
|
The returned data is XML and contains a list of the packages used in
|
||||||
building, their source, and the expanded BuildRequires.
|
building, their source, and the expanded BuildRequires.
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH can be taken from the first two columns
|
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
||||||
of the 'osc repos' output.
|
of the 'osc repos' output.
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc buildinfo PLATFORM ARCH [BUILD_DESCR]
|
osc buildinfo REPOSITORY ARCH [BUILD_DESCR]
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
@ -2380,7 +2381,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
print
|
print
|
||||||
raise oscerr.WrongArgs('Missing argument')
|
raise oscerr.WrongArgs('Missing argument')
|
||||||
|
|
||||||
platform = args[0]
|
repository = args[0]
|
||||||
arch = args[1]
|
arch = args[1]
|
||||||
|
|
||||||
# were we given a specfile (third argument)?
|
# were we given a specfile (third argument)?
|
||||||
@ -2393,12 +2394,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
print ''.join(get_buildinfo(apiurl,
|
print ''.join(get_buildinfo(apiurl,
|
||||||
project, package, platform, arch,
|
project, package, repository, arch,
|
||||||
specfile=spec,
|
specfile=spec,
|
||||||
addlist=opts.extra_pkgs))
|
addlist=opts.extra_pkgs))
|
||||||
|
|
||||||
|
|
||||||
def do_buildconfig(self, subcmd, opts, platform, arch):
|
def do_buildconfig(self, subcmd, opts, repository, arch):
|
||||||
"""${cmd_name}: Shows the build config
|
"""${cmd_name}: Shows the build config
|
||||||
|
|
||||||
Shows the build configuration which is used in building a package.
|
Shows the build configuration which is used in building a package.
|
||||||
@ -2409,7 +2410,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
which is directly readable by the build script. It contains RPM macros
|
which is directly readable by the build script. It contains RPM macros
|
||||||
and BuildRequires expansions, for example.
|
and BuildRequires expansions, for example.
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH can be taken from the first two columns
|
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
||||||
of the 'osc repos' output.
|
of the 'osc repos' output.
|
||||||
|
|
||||||
${cmd_usage}
|
${cmd_usage}
|
||||||
@ -2421,7 +2422,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
apiurl = store_read_apiurl(wd)
|
apiurl = store_read_apiurl(wd)
|
||||||
|
|
||||||
print ''.join(get_buildconfig(apiurl, project, package, platform, arch))
|
print ''.join(get_buildconfig(apiurl, project, package, repository, arch))
|
||||||
|
|
||||||
|
|
||||||
def do_repos(self, subcmd, opts, *args):
|
def do_repos(self, subcmd, opts, *args):
|
||||||
@ -2440,8 +2441,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
args = parseargs(args)
|
args = parseargs(args)
|
||||||
|
|
||||||
for arg in args:
|
for arg in args:
|
||||||
for platform in get_repos_of_project(store_read_apiurl(arg), store_read_project(arg)):
|
for repository in get_repos_of_project(store_read_apiurl(arg), store_read_project(arg)):
|
||||||
print platform
|
print repository
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('--clean', action='store_true',
|
@cmdln.option('--clean', action='store_true',
|
||||||
@ -2499,7 +2500,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
You need to call the command inside a package directory, which should be a
|
You need to call the command inside a package directory, which should be a
|
||||||
buildsystem checkout. (Local modifications are fine.)
|
buildsystem checkout. (Local modifications are fine.)
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH can be taken from the first two columns
|
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
||||||
of the 'osc repos' output. BUILD_DESCR is either a RPM spec file, or a
|
of the 'osc repos' output. BUILD_DESCR is either a RPM spec file, or a
|
||||||
Debian dsc file.
|
Debian dsc file.
|
||||||
|
|
||||||
@ -2519,11 +2520,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
osc build [OPTS] --alternative-project openSUSE:10.3 standard i586 BUILD_DESCR
|
osc build [OPTS] --alternative-project openSUSE:10.3 standard i586 BUILD_DESCR
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc build [OPTS] PLATFORM ARCH BUILD_DESCR
|
osc build [OPTS] REPOSITORY ARCH BUILD_DESCR
|
||||||
osc build [OPTS] PLATFORM (ARCH = hostarch, BUILD_DESCR is detected automatically)
|
osc build [OPTS] REPOSITORY (ARCH = hostarch, BUILD_DESCR is detected automatically)
|
||||||
osc build [OPTS] ARCH (PLATFORM = build_platform (config option), BUILD_DESCR is detected automatically)
|
osc build [OPTS] ARCH (REPOSITORY = build_repository (config option), BUILD_DESCR is detected automatically)
|
||||||
osc build [OPTS] BUILD_DESCR (PLATFORM = build_platform (config option), ARCH = hostarch)
|
osc build [OPTS] BUILD_DESCR (REPOSITORY = build_repository (config option), ARCH = hostarch)
|
||||||
osc build [OPTS] (PLATFORM = build_platform (config option), ARCH = hostarch, BUILD_DESCR is detected automatically)
|
osc build [OPTS] (REPOSITORY = build_repository (config option), ARCH = hostarch, BUILD_DESCR is detected automatically)
|
||||||
|
|
||||||
# Note:
|
# Note:
|
||||||
# Configuration can be overridden by envvars, e.g.
|
# Configuration can be overridden by envvars, e.g.
|
||||||
@ -2548,7 +2549,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if len(args) > 3:
|
if len(args) > 3:
|
||||||
raise oscerr.WrongArgs('Too many arguments')
|
raise oscerr.WrongArgs('Too many arguments')
|
||||||
|
|
||||||
arg_arch = arg_platform = arg_descr = None
|
arg_arch = arg_repository = arg_descr = None
|
||||||
if len(args) < 3:
|
if len(args) < 3:
|
||||||
for arg in args:
|
for arg in args:
|
||||||
if arg.endswith('.spec') or arg.endswith('.dsc'):
|
if arg.endswith('.spec') or arg.endswith('.dsc'):
|
||||||
@ -2557,36 +2558,36 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if arg in osc.build.can_also_build.get(osc.build.hostarch, []) or \
|
if arg in osc.build.can_also_build.get(osc.build.hostarch, []) or \
|
||||||
arg in osc.build.hostarch:
|
arg in osc.build.hostarch:
|
||||||
arg_arch = arg
|
arg_arch = arg
|
||||||
elif not arg_platform:
|
elif not arg_repository:
|
||||||
arg_platform = arg
|
arg_repository = arg
|
||||||
else:
|
else:
|
||||||
raise oscerr.WrongArgs('unexpected argument: \'%s\'' % arg)
|
raise oscerr.WrongArgs('unexpected argument: \'%s\'' % arg)
|
||||||
else:
|
else:
|
||||||
arg_platform, arg_arch, arg_descr = args
|
arg_repository, arg_arch, arg_descr = args
|
||||||
|
|
||||||
arg_arch = arg_arch or osc.build.hostarch
|
arg_arch = arg_arch or osc.build.hostarch
|
||||||
|
|
||||||
platforms = get_platforms_of_project( \
|
repositories = get_repositories_of_project( \
|
||||||
store_read_apiurl('.'), \
|
store_read_apiurl('.'), \
|
||||||
opts.alternative_project or store_read_project('.'))
|
opts.alternative_project or store_read_project('.'))
|
||||||
if not arg_platform:
|
if not arg_repository:
|
||||||
|
|
||||||
if len(platforms) == 0:
|
if len(repositories) == 0:
|
||||||
arg_platform = conf.config['build_platform']
|
arg_repository = conf.config['build_repository']
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|
||||||
# Use a default value from config, but just even if it's available
|
# 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
|
||||||
for platform in (conf.config['build_platform'], 'standard', 'openSUSE_Factory'):
|
for repository in (conf.config['build_repository'], 'standard', 'openSUSE_Factory'):
|
||||||
if platform in platforms:
|
if repository in repositories:
|
||||||
arg_platform = platform
|
arg_repository = repository
|
||||||
break
|
break
|
||||||
|
|
||||||
arg_platform = arg_platform or platforms[len(platforms)-1]
|
arg_repository = arg_repository or repositories[len(repositories)-1]
|
||||||
|
|
||||||
if not arg_platform in platforms:
|
if not arg_repository in repositories:
|
||||||
raise oscerr.WrongArgs('%s is not a valid platform, use one of: %s' % (arg_platform, ", ".join(platforms)))
|
raise oscerr.WrongArgs('%s is not a valid repository, use one of: %s' % (arg_repository, ", ".join(repositories)))
|
||||||
|
|
||||||
# check for source services
|
# check for source services
|
||||||
if os.listdir('.').count("_service"):
|
if os.listdir('.').count("_service"):
|
||||||
@ -2608,7 +2609,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
pass
|
pass
|
||||||
raise oscerr.WrongArgs(msg)
|
raise oscerr.WrongArgs(msg)
|
||||||
|
|
||||||
args = (arg_platform, arg_arch, arg_descr)
|
args = (arg_repository, arg_arch, arg_descr)
|
||||||
|
|
||||||
if opts.prefer_pkgs:
|
if opts.prefer_pkgs:
|
||||||
for d in opts.prefer_pkgs:
|
for d in opts.prefer_pkgs:
|
||||||
@ -2621,7 +2622,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
print >> sys.stderr, 'Preferred save location \'%s\' is not a directory' % opts.keep_pkgs
|
print >> sys.stderr, 'Preferred save location \'%s\' is not a directory' % opts.keep_pkgs
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
print 'Building %s for %s/%s' % (arg_descr, arg_platform, arg_arch)
|
print 'Building %s for %s/%s' % (arg_descr, arg_repository, arg_arch)
|
||||||
return osc.build.main(opts, args)
|
return osc.build.main(opts, args)
|
||||||
|
|
||||||
|
|
||||||
@ -2629,34 +2630,47 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
@cmdln.option('', '--csv', action='store_true',
|
@cmdln.option('', '--csv', action='store_true',
|
||||||
help='generate output in CSV (separated by |)')
|
help='generate output in CSV (separated by |)')
|
||||||
@cmdln.alias('buildhist')
|
@cmdln.alias('buildhist')
|
||||||
def do_buildhistory(self, subcmd, opts, platform, arch):
|
def do_buildhistory(self, subcmd, opts, *args):
|
||||||
"""${cmd_name}: Shows the build history of a package
|
"""${cmd_name}: Shows the build history of a package
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH can be taken from the first two columns
|
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
||||||
of the 'osc repos' output.
|
of the 'osc repos' output.
|
||||||
|
|
||||||
${cmd_usage}
|
usage:
|
||||||
|
osc buildhist REPOSITORY ARCHITECTURE
|
||||||
|
osc buildhist PROJECT PACKAGE REPOSITORY ARCHITECTURE
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
if len(args) == 4:
|
||||||
|
apiurl = conf.config['apiurl']
|
||||||
|
project = args[0]
|
||||||
|
package = args[1]
|
||||||
|
repository = args[2]
|
||||||
|
arch = args[3]
|
||||||
|
elif len(args) == 2:
|
||||||
wd = os.curdir
|
wd = os.curdir
|
||||||
package = store_read_package(wd)
|
package = store_read_package(wd)
|
||||||
project = store_read_project(wd)
|
project = store_read_project(wd)
|
||||||
|
repository = args[0]
|
||||||
|
arch = args[1]
|
||||||
apiurl = store_read_apiurl(wd)
|
apiurl = store_read_apiurl(wd)
|
||||||
|
else:
|
||||||
|
raise oscerr.WrongArgs('Wrong number of arguments')
|
||||||
|
|
||||||
format = 'text'
|
format = 'text'
|
||||||
if opts.csv:
|
if opts.csv:
|
||||||
format = 'csv'
|
format = 'csv'
|
||||||
|
|
||||||
print '\n'.join(get_buildhistory(apiurl, project, package, platform, arch, format))
|
print '\n'.join(get_buildhistory(apiurl, project, package, repository, arch, format))
|
||||||
|
|
||||||
@cmdln.option('', '--csv', action='store_true',
|
@cmdln.option('', '--csv', action='store_true',
|
||||||
help='generate output in CSV (separated by |)')
|
help='generate output in CSV (separated by |)')
|
||||||
@cmdln.alias('jobhist')
|
@cmdln.alias('jobhist')
|
||||||
def do_jobhistory(self, subcmd, opts, platform, arch):
|
def do_jobhistory(self, subcmd, opts, repository, arch):
|
||||||
"""${cmd_name}: Shows the job history of a project
|
"""${cmd_name}: Shows the job history of a project
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH can be taken from the first two columns
|
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
||||||
of the 'osc repos' output.
|
of the 'osc repos' output.
|
||||||
|
|
||||||
${cmd_usage}
|
${cmd_usage}
|
||||||
@ -2676,7 +2690,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if opts.csv:
|
if opts.csv:
|
||||||
format = 'csv'
|
format = 'csv'
|
||||||
|
|
||||||
print_jobhistory(apiurl, project, package, platform, arch, format)
|
print_jobhistory(apiurl, project, package, repository, arch, format)
|
||||||
|
|
||||||
@cmdln.hide(1)
|
@cmdln.hide(1)
|
||||||
def do_rlog(self, subcmd, opts, *args):
|
def do_rlog(self, subcmd, opts, *args):
|
||||||
@ -2744,11 +2758,11 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
Note the --failed option, which can be used to rebuild all failed
|
Note the --failed option, which can be used to rebuild all failed
|
||||||
packages.
|
packages.
|
||||||
|
|
||||||
The arguments PLATFORM and ARCH can be taken from the first two columns
|
The arguments REPOSITORY and ARCH can be taken from the first two columns
|
||||||
of the 'osc repos' output.
|
of the 'osc repos' output.
|
||||||
|
|
||||||
usage:
|
usage:
|
||||||
osc rebuild PROJECT [PACKAGE [PLATFORM [ARCH]]]
|
osc rebuild PROJECT [PACKAGE [REPOSITORY [ARCH]]]
|
||||||
${cmd_option_list}
|
${cmd_option_list}
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -83,8 +83,8 @@ DEFAULTS = { 'apiurl': 'https://api.opensuse.org',
|
|||||||
'do_package_tracking': '1',
|
'do_package_tracking': '1',
|
||||||
# default for osc build
|
# default for osc build
|
||||||
'extra-pkgs': 'vim gdb strace',
|
'extra-pkgs': 'vim gdb strace',
|
||||||
# default platform
|
# default repository
|
||||||
'build_platform': 'openSUSE_Factory',
|
'build_repository': 'openSUSE_Factory',
|
||||||
# default project for branch or bco
|
# default project for branch or bco
|
||||||
'getpac_default_project': 'openSUSE:Factory',
|
'getpac_default_project': 'openSUSE:Factory',
|
||||||
# alternate filesystem layout: have multiple subdirs, where colons were.
|
# alternate filesystem layout: have multiple subdirs, where colons were.
|
||||||
@ -137,7 +137,7 @@ apiurl = %(apiurl)s
|
|||||||
#extra-pkgs = vim gdb strace
|
#extra-pkgs = vim gdb strace
|
||||||
|
|
||||||
# build platform is used if the platform argument is omitted to osc build
|
# build platform is used if the platform argument is omitted to osc build
|
||||||
#build_platform = %(build_platform)s
|
#build_repository = %(build_repository)s
|
||||||
|
|
||||||
# default project for getpac or bco
|
# default project for getpac or bco
|
||||||
#getpac_default_project = %(getpac_default_project)s
|
#getpac_default_project = %(getpac_default_project)s
|
||||||
@ -464,6 +464,8 @@ def get_config(override_conffile = None,
|
|||||||
if config.has_key('apisrv') or config.has_key('scheme'):
|
if config.has_key('apisrv') or config.has_key('scheme'):
|
||||||
print >>sys.stderr, 'Warning: Use of the \'scheme\' or \'apisrv\' in ~/.oscrc is deprecated!\n' \
|
print >>sys.stderr, 'Warning: Use of the \'scheme\' or \'apisrv\' in ~/.oscrc is deprecated!\n' \
|
||||||
'Warning: See README for migration details.'
|
'Warning: See README for migration details.'
|
||||||
|
if config.has_key('build_platform') and not config.has_key('build_repository'):
|
||||||
|
config['build_repository'] = config['build_platform']
|
||||||
|
|
||||||
for i in boolean_opts:
|
for i in boolean_opts:
|
||||||
try:
|
try:
|
||||||
|
30
osc/core.py
30
osc/core.py
@ -3106,7 +3106,11 @@ def delete_files(apiurl, prj, pac, files):
|
|||||||
u = makeurl(apiurl, ['source', prj, pac, file], query={'comment': 'removed %s' % (file, )})
|
u = makeurl(apiurl, ['source', prj, pac, file], query={'comment': 'removed %s' % (file, )})
|
||||||
http_DELETE(u)
|
http_DELETE(u)
|
||||||
|
|
||||||
|
# old compat lib call
|
||||||
def get_platforms(apiurl):
|
def get_platforms(apiurl):
|
||||||
|
return get_repositories(apiurl)
|
||||||
|
|
||||||
|
def get_repositories(apiurl):
|
||||||
f = http_GET(makeurl(apiurl, ['platform']))
|
f = http_GET(makeurl(apiurl, ['platform']))
|
||||||
tree = ET.parse(f)
|
tree = ET.parse(f)
|
||||||
r = [ node.get('name') for node in tree.getroot() ]
|
r = [ node.get('name') for node in tree.getroot() ]
|
||||||
@ -3114,7 +3118,11 @@ def get_platforms(apiurl):
|
|||||||
return r
|
return r
|
||||||
|
|
||||||
|
|
||||||
|
# old compat lib call
|
||||||
def get_platforms_of_project(apiurl, prj):
|
def get_platforms_of_project(apiurl, prj):
|
||||||
|
return get_repositories_of_project(apiurl, prj)
|
||||||
|
|
||||||
|
def get_repositories_of_project(apiurl, prj):
|
||||||
f = show_project_meta(apiurl, prj)
|
f = show_project_meta(apiurl, prj)
|
||||||
tree = ET.parse(StringIO(''.join(f)))
|
tree = ET.parse(StringIO(''.join(f)))
|
||||||
|
|
||||||
@ -3338,26 +3346,26 @@ def streamfile(url, http_meth = http_GET, bufsize=8192):
|
|||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
|
||||||
def print_buildlog(apiurl, prj, package, platform, arch, offset = 0):
|
def print_buildlog(apiurl, prj, package, repository, arch, offset = 0):
|
||||||
"""prints out the buildlog on stdout"""
|
"""prints out the buildlog on stdout"""
|
||||||
query = {'nostream' : '1', 'start' : '%s' % offset}
|
query = {'nostream' : '1', 'start' : '%s' % offset}
|
||||||
while True:
|
while True:
|
||||||
query['start'] = offset
|
query['start'] = offset
|
||||||
start_offset = offset
|
start_offset = offset
|
||||||
u = makeurl(apiurl, ['build', prj, platform, arch, package, '_log'], query=query)
|
u = makeurl(apiurl, ['build', prj, repository, arch, package, '_log'], query=query)
|
||||||
for data in streamfile(u):
|
for data in streamfile(u):
|
||||||
offset += len(data)
|
offset += len(data)
|
||||||
sys.stdout.write(data)
|
sys.stdout.write(data)
|
||||||
if start_offset == offset:
|
if start_offset == offset:
|
||||||
break
|
break
|
||||||
|
|
||||||
def get_buildinfo(apiurl, prj, package, platform, arch, specfile=None, addlist=None):
|
def get_buildinfo(apiurl, prj, package, repository, arch, specfile=None, addlist=None):
|
||||||
query = []
|
query = []
|
||||||
if addlist:
|
if addlist:
|
||||||
for i in addlist:
|
for i in addlist:
|
||||||
query.append('add=%s' % quote_plus(i))
|
query.append('add=%s' % quote_plus(i))
|
||||||
|
|
||||||
u = makeurl(apiurl, ['build', prj, platform, arch, package, '_buildinfo'], query=query)
|
u = makeurl(apiurl, ['build', prj, repository, arch, package, '_buildinfo'], query=query)
|
||||||
|
|
||||||
if specfile:
|
if specfile:
|
||||||
f = http_POST(u, data=specfile)
|
f = http_POST(u, data=specfile)
|
||||||
@ -3366,15 +3374,15 @@ def get_buildinfo(apiurl, prj, package, platform, arch, specfile=None, addlist=N
|
|||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def get_buildconfig(apiurl, prj, package, platform, arch):
|
def get_buildconfig(apiurl, prj, package, repository, arch):
|
||||||
u = makeurl(apiurl, ['build', prj, platform, '_buildconfig'])
|
u = makeurl(apiurl, ['build', prj, repository, '_buildconfig'])
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
return f.read()
|
return f.read()
|
||||||
|
|
||||||
|
|
||||||
def get_buildhistory(apiurl, prj, package, platform, arch, format = 'text'):
|
def get_buildhistory(apiurl, prj, package, repository, arch, format = 'text'):
|
||||||
import time
|
import time
|
||||||
u = makeurl(apiurl, ['build', prj, platform, arch, package, '_history'])
|
u = makeurl(apiurl, ['build', prj, repository, arch, package, '_history'])
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
root = ET.parse(f).getroot()
|
root = ET.parse(f).getroot()
|
||||||
|
|
||||||
@ -3397,12 +3405,12 @@ def get_buildhistory(apiurl, prj, package, platform, arch, format = 'text'):
|
|||||||
|
|
||||||
return r
|
return r
|
||||||
|
|
||||||
def print_jobhistory(apiurl, prj, current_package, platform, arch, format = 'text'):
|
def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 'text'):
|
||||||
import time
|
import time
|
||||||
if current_package:
|
if current_package:
|
||||||
u = makeurl(apiurl, ['build', prj, platform, arch, '_jobhistory'], "package=%s" % (current_package))
|
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], "package=%s" % (current_package))
|
||||||
else:
|
else:
|
||||||
u = makeurl(apiurl, ['build', prj, platform, arch, '_jobhistory'])
|
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'])
|
||||||
f = http_GET(u)
|
f = http_GET(u)
|
||||||
root = ET.parse(f).getroot()
|
root = ET.parse(f).getroot()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user