Skip to content

Commit

Permalink
Add synthetic pkg.fmri.name attribute to pkgmogrify (fix build)
Browse files Browse the repository at this point in the history
  • Loading branch information
citrus-it committed Oct 2, 2024
1 parent 4c0b4e2 commit 052a6f9
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/modules/mogrify.py
Original file line number Diff line number Diff line change
Expand Up @@ -886,15 +886,20 @@ def process_mog(
pkg_attrs.setdefault(name, []).append(value)
else:
pkg_attrs.setdefault(name, []).extend(value)
if name == "pkg.fmri":
pfmri = pkg.fmri.PkgFmri(value)
pkg_attrs.setdefault("pkg.fmri.name", []).append(
pfmri.get_name()
)
comment, a = apply_transforms(
transforms, act, pkg_attrs, verbose, filename, lineno
)
output.append((comment, a, prepended_macro))
# Build additional synthetic attributes based on the final pkg.fmri
if act.name == 'set' and act.attrs['name'] == "pkg.fmri":
try:
pfmri = pkg.fmri.PkgFmri(value)
pkg_attrs.setdefault("pkg.fmri.name", []).append(
pfmri.get_name()
)
except:
pass

except RuntimeError as e:
process_error(
"File {0} line {1:d}: {2}".format(filename, lineno, e), error_cb
Expand Down

0 comments on commit 052a6f9

Please sign in to comment.