Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add synthetic pkg.fmri.name attribute to pkgmogrify (fix build) #498

Merged
merged 1 commit into from
Oct 2, 2024
Merged
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
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
Loading