google / rpmpack

rpmpack (tar2rpm) - package rpms in pure golang or cli
Apache License 2.0
116 stars 32 forks source link

Allow users to write custom index entries. #35

Closed jarondl closed 4 years ago

jarondl commented 4 years ago

AddCustomTag and AddCustomSig Add OR OVERWRITE tags in the index or signature. This means that a user can add a tag we don't know about, or overwrite one we don't usually allow to change. This is a major footgun, because users can break their rpms, but so what.

Also exposed IndexEntry, and IndexEntry creating methods, one for each type. (yay generics :( ). This allows safe compile time checking of input types, but does add some bookchecking for the coder.

Note that tags are saved in a separate map and added after adding our own tags, but before serializing to bytes. That way the users can add tags whenever they want.

Fixes #29

jarondl commented 4 years ago

@djgilcrease any comments or can I submit this?