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

OS field in RPM header for AIX (and further enum values) is off by one #142

Open
tonyabbott opened this issue Jul 31, 2019 · 0 comments
Open

Comments

@tonyabbott
Copy link

tonyabbott commented Jul 31, 2019

I'm creating an RPM for AIX using
builder.setPlatform(Architecture.PPC, Os.AIX)
which results in the value 6 for the OS field in the RPM lead instead of the expected 5.

The OS values in org.redline_rpm.header.Os are written by Lead.write() using the ordinal value of the enum:
buffer.putShort(( short) (os.ordinal() != 0 ? os.ordinal() : 0xFF));

In /usr/lib/rpm/rpmrc, the values for AmigaOS and AIX are the same (5), but the Os enum has constants for both AmigaOS and AIX. This results in all OSs from AIX onwards being off-by-one.

The simplest solution would to fold the AMIGAOS and AIX enum values into one called AMIGAOS_OR_AIX, otherwise a more sophisticated mapping is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant