{"id":6,"date":"2006-09-16T20:53:19","date_gmt":"2006-09-06T17:59:04","guid":{"rendered":""},"modified":"2017-03-07T16:04:34","modified_gmt":"2017-03-07T16:04:34","slug":"title_13","status":"publish","type":"post","link":"https:\/\/blogs.gentoo.org\/beu\/2006\/09\/16\/title_13\/","title":{"rendered":"Package Musings From the Core&#8230;"},"content":{"rendered":"<p>So, it seems that I&#8217;m destined to blog <strong>a lot<\/strong> today! \ud83d\ude09<\/p>\n<p><strong>pkgcore<\/strong><br \/>\nI&#8217;ve started working on pkgcore this (fine, sunny) afternoon, and I&#8217;ll be working on supporting binpkgs completely in pkgcore &#8211; hopefully! \ud83d\ude09  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 &#8211; it&#8217;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&#8230; \ud83d\ude42<\/p>\n<p>I currently have a following &#8220;not all all pseudo&#8221; code:<\/p>\n<ol>\n<li>mmap() open binpkg fd;<\/li>\n<li>cast base + offset to a struct containing metadata;<\/li>\n<li>&#8230; manipulate data &#8230;;<\/li>\n<li>write-out data (if write operation) with a memcpy and msync();<\/li>\n<li>munmap() binpkg fd.<\/li>\n<\/ol>\n<p>Once this is done, we essentially do the following for all write operations:<\/p>\n<ol>\n<li>fsync() all fds;<\/li>\n<li>fsync all binpkg directory fds (to ensure sync!);<\/li>\n<li>&#8230; wait for disk for flush &#8230;;<\/li>\n<li>report status to user.<\/li>\n<\/ol>\n<p>Pretty simple, fast, and effective. \ud83d\ude42  Note that this is just for the &#8220;update all binpkgs&#8221; case, not a single inspect\/change binpkg metadata&#8230;  Time to put this to the test! :><\/p>\n","protected":false},"excerpt":{"rendered":"<p>So, it seems that I&#8217;m destined to blog a lot today! \ud83d\ude09 pkgcore I&#8217;ve started working on pkgcore this (fine, sunny) afternoon, and I&#8217;ll be working on supporting binpkgs completely in pkgcore &#8211; hopefully! \ud83d\ude09 Thus far, I have a minimal doc (which will appear in my overlay shortly) with some random musings about, essentially, &hellip; <a href=\"https:\/\/blogs.gentoo.org\/beu\/2006\/09\/16\/title_13\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Package Musings From the Core&#8230;<\/span><\/a><\/p>\n","protected":false},"author":51,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/posts\/6"}],"collection":[{"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/users\/51"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/comments?post=6"}],"version-history":[{"count":1,"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/posts\/6\/revisions"}],"predecessor-version":[{"id":22,"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/posts\/6\/revisions\/22"}],"wp:attachment":[{"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/media?parent=6"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/categories?post=6"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.gentoo.org\/beu\/wp-json\/wp\/v2\/tags?post=6"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}