From this thread: http://boards.openpandora.org/index.php/topic/13088-some-repo-statistics-for-you/
Anyone sufficiently fluent in bash (or whatever) to make something like this?
Basically we need a tool
pnd_diff <OLD_PND> <NEW_PND> <DIFF_FILE>
and a tool
pnd_merge <OLD_PND> <DIFF_FILE> <NEW_PND>
where in both cases, the first two arguments are input files and the last one is the output.
Something like this should work:Looking at the massive bandwidth use, I wonder if using a diff to update a pnd instead of downloading the whole pnd would be viable
Server-side:
When a PND gets uploaded that already existed (so it's an update), if the PXML contains something specific to allow incremental updates, then unpack both the current version and the most recent archived version. Create a list of all modified, added or deleted files, and put the modified or added files, together with the list of deleted files and maybe some other meta-data, in a .tar.bz2 (you could also do more detailed diffs but since most files will be binaries, that will probably not be worth the effort). You could include a checksum of the full PND in this meta-data, as well as instructions on how the PND has to be created (compressed or not? what icon? basically the parameters to pnd_make.sh). Make both the full PND and the incremental update .tar.bz2 available for download.
Client-side:
Make a shell script that takes an old PND and an update .tar.bz2, unpacks the PND, copies the files from the .tar.bz2 and removes the files to be removed, repacks the PND according to the instructions in the metadata, and checks the checksum to verify that everything went well.
Add an automated feature in PNDManager to download the incremental update instead of the full PND and call the shell script.
You could also allow authors to upload the diff instead of the full PND, which would be really useful if you want to do stuff like edit the PXML a bit or add some screenshots without having to reupload the entire thing again.
Anyone sufficiently fluent in bash (or whatever) to make something like this?
Basically we need a tool
pnd_diff <OLD_PND> <NEW_PND> <DIFF_FILE>
and a tool
pnd_merge <OLD_PND> <DIFF_FILE> <NEW_PND>
where in both cases, the first two arguments are input files and the last one is the output.
Last edited by a moderator: