generating pristine tarballs from git repositories

With pristine-tar version 0.5, I've added a new feature: The ability to easily inject enough information into a git repository so that a pristine tarball can later be regenerated from that repository.

If a package's upstream branch contains the upstream source corresponding to the tarball to be imported, it's very simple to use.

joey@kodama:~/src/fbreader> pristine-tar commit ~/lib/debian/unstable/fbreader_0.8.12.orig.tar.gz 
pristine-tar: committed fbreader_0.8.12.orig.tar.gz.delta to branch pristine-tar

Otherwise, you also have to specify a tag (or any tree-ish really) where the upstream source can be found.

joey@kodama:~/src/fbreader> pristine-tar commit ~/fbreader_0.8.9.orig.tar.gz upstream/0.8.9
pristine-tar: committed fbreader_0.8.9.orig.tar.gz.delta to branch pristine-tar

Here's what it puts in the pristine-tar branch that it creates. In this example, the delta files are 40-some kilobytes, which is much nicer than if I'd had to check the 2 megabyte tarballs into git directly.

joey@kodama:~/src/fbreader> git checkout pristine-tar 
Switched to branch "pristine-tar"
joey@kodama:~/src/fbreader> ls -l
total 104
-rw-r--r-- 1 joey joey 46583 Jan 31 21:26 fbreader_0.8.12.orig.tar.gz.delta
-rw-r--r-- 1 joey joey    40 Jan 31 21:26 fbreader_0.8.12.orig.tar.gz.id
-rw-r--r-- 1 joey joey 45267 Jan 31 21:26 fbreader_0.8.9.orig.tar.gz.delta
-rw-r--r-- 1 joey joey    40 Jan 31 21:26 fbreader_0.8.9.orig.tar.gz.id

Don't forget to push the pristine-tar branch to your server for safekeeping.

joey@kodama:~/src/fbreader> git push origin pristine-tar

Once a tarball's delta is checked in, you can easily and quickly regenerate the original tarball.

joey@kodama:~/src/fbreader> pristine-tar checkout ../fbreader_0.8.12.orig.tar.gz
pristine-tar: successfully generated ../fbreader_0.8.12.orig.tar.gz

Yes, it's really the same file. :-)

joey@kodama:~/src/fbreader> md5sum ~/lib/debian/unstable/fbreader_0.8.12.orig.tar.gz ../fbreader_0.8.12.orig.tar.gz 
8045abe1acc75dbdd220400df541f23f  /home/joey/lib/debian/unstable/fbreader_0.8.12.orig.tar.gz
8045abe1acc75dbdd220400df541f23f  ../fbreader_0.8.12.orig.tar.gz

The above example is from the perspective of a maintainer of a Debian package. But this can also be used by the authors who generate the pristine tarballs in the first place. Check them into git using pristine-tar. Then you can regenerate any tarball you've ever released using just your project's git repository.

joey@kodama:~/src/pristine-tar> pristine-tar commit ../pristine-tar_0.5.tar.gz tags/0.5
pristine-tar: committed pristine-tar_0.5.tar.gz.delta to branch pristine-tar

One word of warning: For pristine-tar to check out the tarball, git needs to be able to check out the tree that you referred to when you committed it in the first place. If that was a tag that you've told git to delete, you're SOL. If it was a branch and the branch has changed in the meantime, that's fine, so long as git can find the original id that is stored in the .tar.gz.id file.


I hope that tools like git-import-orig and git-debimport can get support for automatically calling pristine-tar commit when importing tarballs into git, and that tools like git-buildpackage and gitpkg can use it to check out the tarballs.

Posted
at anna's

Dinner at Anna's, I had a nice dish of Lad Na. Hung out afterwards and fought with automount and DVD stuff in Ubuntu. I don't want this post to be a rant about desktops, Ubuntu, or gnome. Suffice to say that I'm much happier with the technology of the zero-degree sleeping bag that's keeping me nice and warm camping in the woods tonight, despite a wet foot from the scary creek crossing I took three times today with my laptop in tow.

Posted
bleh

I've been a bit feverish and fragile this weekend, nothing serious, but not good for much besides reading a lot of fiction. Two books totaling some 700 pages last night alone.. That and February insomnia have been keeping me up later than is wise.

Posted
hospitals

Two random blog-worthy observations about hospitals after the first night I've ever spent in one..

At least my local hospital has a simple social engineering security hole that could allow an attacker to be treated without ever being billed. No CVE ID has been assigned, and this hole has not been exploited in the wild. :-P

They're awfully social places for we introverts for whom prolonged (and indeed, unrelenting) polite social interaction tends to be a drain.


Anyway, I'm feeling better aside from a tendency to write "hotel" when I mean "hospital" and "evil-midnight-nose-wiring-demons" when I mean "nurses".

discussion

Posted
grapefruit

Today's xkcd reminds me that about 15 pounds of grapefruit into this year, I tried to calculate how many I could eat a day, if I were to do were peel and eat grapefruit, all day. I may have been trying to figure out if it is possible to live on a pure grapefruit diet. I remember arriving at a figure around 70.

My actual daily consumption at the height of grapefruit season is 3 to 5. It's become my favorite winter fruit and quite puts one off nasty sweet oranges. There's a trick to both the peeling and the eating of grapefruit which the xkcd guy has apparently never learned, that avoids the healhful skin and leaves only the delicious tart flavour droplets behind.

I'm available for lessons, the first 2 or 3 weeks that the Texas ruby reds are in season.


(Of course as wrong as Randall is about grapefruit, he's 5 million times as wrong about a proper tomato..)

discussion

Posted