diff --git a/NEWS b/NEWS index 7c1e7c67..e9b984b1 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,5 @@ 0.133 - - + - add --meta option also to "list", "cat" and "less" commands 0.132 - rdelete and undelete command requesting now a comment diff --git a/osc/commandline.py b/osc/commandline.py index e80fef90..f11096f9 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -218,8 +218,6 @@ class Osc(cmdln.Cmdln): help='specify repository (only for binaries)') @cmdln.option('-b', '--binaries', action='store_true', 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', help='expand linked package (only for sources)') @cmdln.option('-u', '--unexpand', action='store_true', @@ -230,6 +228,10 @@ class Osc(cmdln.Cmdln): help='print extra information') @cmdln.option('-D', '--deleted', action='store_true', 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): """${cmd_name}: List sources or binaries on the server @@ -389,6 +391,7 @@ class Osc(cmdln.Cmdln): package, verbose=opts.verbose, expand=opts.expand, + meta=opts.meta, revision=rev) link_seen = '_link' in l if opts.verbose: @@ -6280,6 +6283,8 @@ Please submit there instead, or use --nodevelproject to force direct submission. help='force expansion of linked packages.') @cmdln.option('-u', '--unexpand', action='store_true', help='always work with unexpanded packages.') + @cmdln.option('-M', '--meta', action='store_true', + help='list meta data files') @cmdln.alias('less') def do_cat(self, subcmd, opts, *args): """${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() query = { } + if opts.meta: + query['meta'] = 1 if opts.revision: query['rev'] = opts.revision 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) try: if subcmd == 'less': diff --git a/osc/core.py b/osc/core.py index a4e8dce5..d13adc80 100644 --- a/osc/core.py +++ b/osc/core.py @@ -2983,13 +2983,15 @@ def meta_get_packagelist(apiurl, prj, deleted=None): 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, or a list File() instances if verbose=True""" query = {} if expand: query['expand'] = 1 + if meta: + query['meta'] = 1 if revision: query['rev'] = revision else: