Issues With Creating Featherspec Archives

Kevin Polulak kpolulak at gmail.com
Mon Oct 24 18:51:17 UTC 2011


If any of you have been glancing at all the noise dalek has been making,
then you'll know that lately I've been doing a lot of work on Plumage. I've
got a lot of really great plans for it. I've designed a "real" package
format that Plumage will use and can fetch these packages - called
"feathers" - from a remote repository on parrot.org.

A feather is very similar to LuaRocks' "rocks". It is essentially just a zip
archive with a metadata file called a "featherspec". More details on
feathers and the featherspec can be found in the docs/feathers directory on
the soh-cah-toa/featherspec branch.

However, I've run into a bit of a problem. Something as simple as creating a
zip archive (or any compressed archive for that matter) has turned out to be
a total pain in the neck. Since our Archive;Zip and Archive;Tar libraries
are very incomplete, I've decided to go with using NCI to call into libzip.

The problem I'm having is with recursively adding directories to an archive.
The libzip library provides a function called zip_add_dir() that is supposed
to do this. Unfortunately, it has no relation to the user's fileystem
outside the archive. When you add a directory "foo", you are just creating
an entry within the archive for a directory; you are not actually copying
the "foo" directory from the user's filesystem. This means I have to iterate
over the directory tree to add files. I even contacted the libzip mailing
list and that is my only option apparently.

I turned to Rosella for this and experimented with
Rosella::FileSystem::Directory.walk(). However, it only walks through files
and does not include directories in the resulting array so I can't do
something like `if (is directory) { zip_add_dir() } else { zip_add() }`.

Does anybody have an idea how I could fix this problem? Suggestions?

-- 
- Kevin Polulak (soh_cah_toa)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.parrot.org/pipermail/parrot-dev/attachments/20111024/be32804e/attachment.html>


More information about the parrot-dev mailing list