mirror of
https://github.com/openSUSE/osc.git
synced 2025-08-23 22:58:53 +02:00
Merge branch 'showlinked' of https://github.com/adrianschroeter/osc
Add "showlinked [<prj> <pkg>]" command that can be used to show which packages link to the "<prj>/<pkg>" package.
This commit is contained in:
2
NEWS
2
NEWS
@@ -1,5 +1,5 @@
|
|||||||
0.173.0
|
0.173.0
|
||||||
-
|
- add showlinked command to show all references of packages linking to a given one
|
||||||
|
|
||||||
0.172.0
|
0.172.0
|
||||||
- support --lastsucceeded/--last-succeeded in "osc buildlog", "osc
|
- support --lastsucceeded/--last-succeeded in "osc buildlog", "osc
|
||||||
|
@@ -739,6 +739,33 @@ class Osc(cmdln.Cmdln):
|
|||||||
set_devel_project(apiurl, project, package, devprj, devpkg)
|
set_devel_project(apiurl, project, package, devprj, devpkg)
|
||||||
|
|
||||||
|
|
||||||
|
def do_showlinked(self, subcmd, opts, *args):
|
||||||
|
"""${cmd_name}: Show all packages linking to a given one
|
||||||
|
|
||||||
|
Examples:
|
||||||
|
osc showlinked [PROJECT PACKAGE]
|
||||||
|
${cmd_option_list}
|
||||||
|
"""
|
||||||
|
|
||||||
|
args = slash_split(args)
|
||||||
|
apiurl = self.get_api_url()
|
||||||
|
localdir = os.getcwd()
|
||||||
|
project = package = None
|
||||||
|
if len(args) == 2:
|
||||||
|
project = args[0]
|
||||||
|
package = args[1]
|
||||||
|
elif is_package_dir(localdir):
|
||||||
|
project = store_read_project(localdir)
|
||||||
|
package = store_read_package(localdir)
|
||||||
|
else:
|
||||||
|
raise oscerr.WrongArgs('Either specify project and package or call it from a package working copy')
|
||||||
|
|
||||||
|
url = makeurl(apiurl, ['source', project, package], query={'cmd': 'showlinked'})
|
||||||
|
f = http_POST(url)
|
||||||
|
root = ET.parse(f).getroot()
|
||||||
|
for node in root.findall('package'):
|
||||||
|
print(node.get('project') + " " + node.get('name'))
|
||||||
|
|
||||||
@cmdln.option('-c', '--create', action='store_true',
|
@cmdln.option('-c', '--create', action='store_true',
|
||||||
help='Create a new token')
|
help='Create a new token')
|
||||||
@cmdln.option('-d', '--delete', metavar='TOKENID',
|
@cmdln.option('-d', '--delete', metavar='TOKENID',
|
||||||
|
Reference in New Issue
Block a user