So, it seems that I’m destined to blog a lot today! š
pkgcore
I’ve started working on pkgcore this (fine, sunny) afternoon, and I’ll be working on supporting binpkgs completely in pkgcore – hopefully! š Thus far, I have a minimal doc (which will appear in my overlay shortly) with some random musings about, essentially, how we tac metadata onto a binpkg .tbz2 archive. Since binpkg code will be easy to do – it’s mainly just keeping the metadata packed on the end of a binpkg up-to-date and reading/writing said metadata; basically, being able to introspect metadata for a binpkg easily… š
I currently have a following “not all all pseudo” code:
- mmap() open binpkg fd;
- cast base + offset to a struct containing metadata;
- … manipulate data …;
- write-out data (if write operation) with a memcpy and msync();
- munmap() binpkg fd.
Once this is done, we essentially do the following for all write operations:
- fsync() all fds;
- fsync all binpkg directory fds (to ensure sync!);
- … wait for disk for flush …;
- report status to user.
Pretty simple, fast, and effective. š Note that this is just for the “update all binpkgs” case, not a single inspect/change binpkg metadata… Time to put this to the test! :>