Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions lib/rift/Controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1056,27 +1056,27 @@ def action_query(args, config):
logging.debug('Loading package %s', pkg.name)
try:
pkg.load()
spec = Spec(config=config)
if args.spec:
spec.filepath = pkg.buildfile
spec.load()
except RiftError as exp:
logging.error("%s: %s", pkg.name, str(exp))
continue

date = str(time.strftime("%Y-%m-%d", time.localtime(spec.changelog_time)))
# Represent changelog time if defined on package.
if pkg.changelog_time:
date = str(time.strftime("%Y-%m-%d", time.localtime(pkg.changelog_time)))
else:
date = None
modulemanager = staff.get(modules.get(pkg.module).get('manager')[0])
tbl.append({'name': pkg.name,
'module': pkg.module,
'origin': pkg.origin,
'reason': pkg.reason,
'tests': str(len(list(pkg.tests()))),
'version': spec.version,
'arch': spec.arch,
'release': spec.release,
'changelogname': spec.changelog_name,
'version': pkg.version,
'arch': pkg.arch,
'release': pkg.release,
'changelogname': pkg.changelog_name,
'changelogtime': date,
'buildrequires': spec.buildrequires,
'buildrequires': pkg.buildrequires,
'modulemanager': modulemanager['email'],
'maintainers': ', '.join(pkg.maintainers)})
print(tbl)
Expand Down
8 changes: 8 additions & 0 deletions lib/rift/package/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ def __init__(self, name, config, staff, modules, _format, buildfile):

self.sources = set()

# Optionally set in load() by concrete children classes.
self.version = None
self.release = None
self.arch = None
self.changelog_name = None
self.changelog_time = None
self.buildrequires = None

def check(self):
"""Load package and check info."""
message('Validate package info...')
Expand Down
9 changes: 8 additions & 1 deletion lib/rift/package/rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,17 @@ def _deserialize_specific_metadata(self, data):
self.ignore_rpms = data.get('ignore_rpms', [])

def load(self, infopath=None):
"""Load package metadata, check its content and load RPM spec file."""
"""Load package metadata, check its content and load RPM spec file with
its main attributes."""
# load infos.yaml with parent class
super().load(infopath)
self.spec = Spec(self.buildfile, config=self._config)
self.version = self.spec.version
self.release = self.spec.release
self.arch = self.spec.arch
self.changelog_name = self.spec.changelog_name
self.changelog_time = self.spec.changelog_time
self.buildrequires = self.spec.buildrequires

def check(self):
# Check generic package metadata
Expand Down