mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-25 22:36:13 +01:00
Add info for projects
Without this change, `osc info` in a project checkout dir returned Directory '.' is not an OBS SCM working copy of a package
This commit is contained in:
parent
84524b565d
commit
29d44d540b
@ -7868,9 +7868,12 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
args = parseargs(args)
|
args = parseargs(args)
|
||||||
pacs = Package.from_paths(args)
|
for pdir in args:
|
||||||
|
store = osc_store.get_store(pdir)
|
||||||
for p in pacs:
|
if store.is_package:
|
||||||
|
p = Package(pdir)
|
||||||
|
else:
|
||||||
|
p = Project(pdir, getPackageList=False, wc_check=False)
|
||||||
print(p.info())
|
print(p.info())
|
||||||
|
|
||||||
@cmdln.option('-M', '--multibuild-package', metavar='FLAVOR', action='append',
|
@cmdln.option('-M', '--multibuild-package', metavar='FLAVOR', action='append',
|
||||||
|
@ -235,6 +235,13 @@ Revision: %s
|
|||||||
Link info: %s
|
Link info: %s
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
project_info_templ = """\
|
||||||
|
Project name: %s
|
||||||
|
Path: %s
|
||||||
|
API URL: %s
|
||||||
|
Source URL: %s
|
||||||
|
"""
|
||||||
|
|
||||||
new_pattern_template = """\
|
new_pattern_template = """\
|
||||||
<!-- See https://github.com/openSUSE/libzypp/tree/master/zypp/parser/yum/schema/patterns.rng -->
|
<!-- See https://github.com/openSUSE/libzypp/tree/master/zypp/parser/yum/schema/patterns.rng -->
|
||||||
|
|
||||||
|
@ -242,6 +242,14 @@ class Project:
|
|||||||
else:
|
else:
|
||||||
return None
|
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):
|
def new_package_entry(self, name, state):
|
||||||
ET.SubElement(self.pac_root, 'package', name=name, state=state)
|
ET.SubElement(self.pac_root, 'package', name=name, state=state)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user