1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 01:16:14 +01:00

- add the --meta handling also to list, cat and less commands

This commit is contained in:
Adrian Schröter 2011-06-08 10:25:15 +02:00
parent 8bc3f3a6d2
commit a6716337f5
3 changed files with 14 additions and 5 deletions

2
NEWS
View File

@ -1,5 +1,5 @@
0.133 0.133
- - add --meta option also to "list", "cat" and "less" commands
0.132 0.132
- rdelete and undelete command requesting now a comment - rdelete and undelete command requesting now a comment

View File

@ -218,8 +218,6 @@ class Osc(cmdln.Cmdln):
help='specify repository (only for binaries)') help='specify repository (only for binaries)')
@cmdln.option('-b', '--binaries', action='store_true', @cmdln.option('-b', '--binaries', action='store_true',
help='list built binaries instead of sources') help='list built binaries instead of sources')
@cmdln.option('-R', '--revision', metavar='REVISION',
help='specify revision (only for sources)')
@cmdln.option('-e', '--expand', action='store_true', @cmdln.option('-e', '--expand', action='store_true',
help='expand linked package (only for sources)') help='expand linked package (only for sources)')
@cmdln.option('-u', '--unexpand', action='store_true', @cmdln.option('-u', '--unexpand', action='store_true',
@ -230,6 +228,10 @@ class Osc(cmdln.Cmdln):
help='print extra information') help='print extra information')
@cmdln.option('-D', '--deleted', action='store_true', @cmdln.option('-D', '--deleted', action='store_true',
help='show only the former deleted projects or packages') help='show only the former deleted projects or packages')
@cmdln.option('-M', '--meta', action='store_true',
help='list meta data files')
@cmdln.option('-R', '--revision', metavar='REVISION',
help='specify revision (only for sources)')
def do_list(self, subcmd, opts, *args): def do_list(self, subcmd, opts, *args):
"""${cmd_name}: List sources or binaries on the server """${cmd_name}: List sources or binaries on the server
@ -389,6 +391,7 @@ class Osc(cmdln.Cmdln):
package, package,
verbose=opts.verbose, verbose=opts.verbose,
expand=opts.expand, expand=opts.expand,
meta=opts.meta,
revision=rev) revision=rev)
link_seen = '_link' in l link_seen = '_link' in l
if opts.verbose: if opts.verbose:
@ -6280,6 +6283,8 @@ Please submit there instead, or use --nodevelproject to force direct submission.
help='force expansion of linked packages.') help='force expansion of linked packages.')
@cmdln.option('-u', '--unexpand', action='store_true', @cmdln.option('-u', '--unexpand', action='store_true',
help='always work with unexpanded packages.') help='always work with unexpanded packages.')
@cmdln.option('-M', '--meta', action='store_true',
help='list meta data files')
@cmdln.alias('less') @cmdln.alias('less')
def do_cat(self, subcmd, opts, *args): def do_cat(self, subcmd, opts, *args):
"""${cmd_name}: Output the content of a file to standard output """${cmd_name}: Output the content of a file to standard output
@ -6311,10 +6316,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
apiurl = self.get_api_url() apiurl = self.get_api_url()
query = { } query = { }
if opts.meta:
query['meta'] = 1
if opts.revision: if opts.revision:
query['rev'] = opts.revision query['rev'] = opts.revision
if opts.expand: if opts.expand:
query['rev'] = show_upstream_srcmd5(apiurl, args[0], args[1], expand=True, revision=opts.revision) query['rev'] = show_upstream_srcmd5(apiurl, args[0], args[1], expand=True, revision=opts.revision, meta=opts.meta)
u = makeurl(apiurl, ['source', args[0], args[1], args[2]], query=query) u = makeurl(apiurl, ['source', args[0], args[1], args[2]], query=query)
try: try:
if subcmd == 'less': if subcmd == 'less':

View File

@ -2983,13 +2983,15 @@ def meta_get_packagelist(apiurl, prj, deleted=None):
return [ node.get('name') for node in root.findall('entry') ] return [ node.get('name') for node in root.findall('entry') ]
def meta_get_filelist(apiurl, prj, package, verbose=False, expand=False, revision=None): def meta_get_filelist(apiurl, prj, package, verbose=False, expand=False, revision=None, meta=False):
"""return a list of file names, """return a list of file names,
or a list File() instances if verbose=True""" or a list File() instances if verbose=True"""
query = {} query = {}
if expand: if expand:
query['expand'] = 1 query['expand'] = 1
if meta:
query['meta'] = 1
if revision: if revision:
query['rev'] = revision query['rev'] = revision
else: else: