mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-02 17:56:15 +01:00
- new command 'develproject' to print the devel project from the package meta.
This commit is contained in:
parent
b5f234f59d
commit
cb534d09b6
1
NEWS
1
NEWS
@ -1,4 +1,5 @@
|
|||||||
0.131
|
0.131
|
||||||
|
- new command 'develproject' to print the devel project from the package meta.
|
||||||
- add blt and rblt commands, aka "buildlogtail" and "remotebuildlogtail" to show
|
- add blt and rblt commands, aka "buildlogtail" and "remotebuildlogtail" to show
|
||||||
just the end of a build log (for getting the fail reason faster).
|
just the end of a build log (for getting the fail reason faster).
|
||||||
CHANGE: the --start parameter is now called --offset
|
CHANGE: the --start parameter is now called --offset
|
||||||
|
@ -454,6 +454,34 @@ class Osc(cmdln.Cmdln):
|
|||||||
filename = project_dir + "/" + patchinfo + "/_patchinfo"
|
filename = project_dir + "/" + patchinfo + "/_patchinfo"
|
||||||
run_editor(filename)
|
run_editor(filename)
|
||||||
|
|
||||||
|
@cmdln.alias('bsdevelproject')
|
||||||
|
@cmdln.option('-r', '--raw', default=False, action="store_true", help='print raw xml snippet')
|
||||||
|
def do_develproject(self, subcmd, opts, *args):
|
||||||
|
"""${cmd_name}: print the bsdevelproject of a package
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
osc develproject PRJ PKG
|
||||||
|
osc develproject
|
||||||
|
${cmd_option_list}
|
||||||
|
"""
|
||||||
|
args = slash_split(args)
|
||||||
|
apiurl = self.get_api_url()
|
||||||
|
|
||||||
|
if len(args) != 2:
|
||||||
|
if len(args) == 0:
|
||||||
|
project = store_read_project(os.curdir)
|
||||||
|
package = store_read_package(os.curdir)
|
||||||
|
else:
|
||||||
|
raise oscerr.WrongArgs('need Project and Package')
|
||||||
|
project = args[0]
|
||||||
|
package = args[1]
|
||||||
|
m = show_package_meta(apiurl, project, package)
|
||||||
|
d = ET.fromstring(''.join(m)).find('devel')
|
||||||
|
if opts.raw:
|
||||||
|
print ET.tostring(d)
|
||||||
|
else:
|
||||||
|
print d.get('project')
|
||||||
|
|
||||||
|
|
||||||
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
|
@cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',
|
||||||
help='affect only a given attribute')
|
help='affect only a given attribute')
|
||||||
|
Loading…
Reference in New Issue
Block a user