Ideally, we just let `mmap()` handle that.  That's what OSTree does for 
metadata by default.  It'd probably work for packed RPMs as well...except in 
practice we byteswap in `regionSwab()` so require a writable mapping =/  For 
OSTree, GVariant handles a lot of this automatically for interior data, for 
"exterior" integers we just byteswap on access.

Anyways, one option I looked at would be for OSTree to store *everything* from 
the original RPM (lead, signature, header), then attempt to re-synthesize it 
from the ostree commit when RPM asks for it.  

Downsides:
  - A pipe-to-self is just ugly and inefficient
  - I think I'd have to parse the RPM myself to accurately extract the start of 
the cpio stream

Positives:
 - We'd also store the original gpg sigs

I guess regardless, it'd be nice if RPM supported (somehow) a mode where the 
calling application could optionally provide just a `Header` reference, not a 
full fd to an RPM.


---
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/52#issuecomment-173925491
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to