1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-14 00:06:15 +01:00

Merge pull request #1576 from bmwiedemann/prjinfo

Add `info` command for projects
This commit is contained in:
Daniel Mach 2024-06-12 13:12:50 +02:00 committed by GitHub
commit f3119fa475
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 21 additions and 3 deletions

View File

@ -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',

View File

@ -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 -->

View File

@ -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)