mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-12 15:46:15 +01:00
Merge pull request #1576 from bmwiedemann/prjinfo
Add `info` command for projects
This commit is contained in:
commit
f3119fa475
@ -7868,9 +7868,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
"""
|
||||
|
||||
args = parseargs(args)
|
||||
pacs = Package.from_paths(args)
|
||||
|
||||
for p in pacs:
|
||||
for pdir in args:
|
||||
store = osc_store.get_store(pdir)
|
||||
if store.is_package:
|
||||
p = Package(pdir)
|
||||
else:
|
||||
p = Project(pdir, getPackageList=False, wc_check=False)
|
||||
print(p.info())
|
||||
|
||||
@cmdln.option('-M', '--multibuild-package', metavar='FLAVOR', action='append',
|
||||
|
@ -235,6 +235,13 @@ Revision: %s
|
||||
Link info: %s
|
||||
"""
|
||||
|
||||
project_info_templ = """\
|
||||
Project name: %s
|
||||
Path: %s
|
||||
API URL: %s
|
||||
Source URL: %s
|
||||
"""
|
||||
|
||||
new_pattern_template = """\
|
||||
<!-- See https://github.com/openSUSE/libzypp/tree/master/zypp/parser/yum/schema/patterns.rng -->
|
||||
|
||||
|
@ -242,6 +242,14 @@ class Project:
|
||||
else:
|
||||
return None
|
||||
|
||||
def info(self):
|
||||
from ..core import project_info_templ
|
||||
from ..core import makeurl
|
||||
|
||||
source_url = makeurl(self.apiurl, ['source', self.name])
|
||||
r = project_info_templ % (self.name, self.absdir, self.apiurl, source_url)
|
||||
return r
|
||||
|
||||
def new_package_entry(self, name, state):
|
||||
ET.SubElement(self.pac_root, 'package', name=name, state=state)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user