Getting Git Again

|

Wow. That attempt at backporting Git really sucked. I did manage to find a thread on the Ubuntu Forums from the developer of prevu, jdong (real name), in which he mentions there’s a fix for my cp: cannot stat ./<maintainer@emailaddress.com> woes in the Hardy version. So I basically decided to start from scratch and update prevu before backporting anything. Of course the potentially mind-numbing paradox of doing sudo prevu prevu is a looming threat to our build chain - so let’s be really clean about this upgrade.

Half of the fix is actually in pbuilder itself according to jdong, which luckily has a Gutsy backport incorporating the patch to not mistake the maintainer field of a control file as an actual filename. The problem was that even when a build was completely successful, it would think it needed to clean up a nonexistent file and subsequently panic when it wasn’t actually there. So to get the fix, all we gotta do is add a line to our /etc/apt/sources.list like so:

deb http://archive.ubuntu.com/ubuntu/ gutsy-backports main restricted universe

At this point we could fetch our backported package, but we’re really setting ourself up for disaster if we don’t take extra care to only install backported patches when we really mean to. If we ran sudo apt-get upgrade right now or try to install any packages at all, chances are we’ll get the backport version if one exists - including all the available backported dependencies. A good rule of thumb is to only use a backport when you have a problem with a current package and know the nature of the problem in detail. Ubuntu changelogs really come in handy here. So we only want them installed explicitly, which requires a new apt configuration file at /etc/apt/preferences:

Package: * 
Pin: release a=gutsy-backports
Pin-Priority: 400

What this does is it lowers the priority of the gutsy-backports repository, preferring a current gutsy package whenever possible. This is called pinning in the biz, and could save your life. That said, let’s get the new pbuilder!

Be sure to sudo apt-get update so apt knows about the new repo, then you can just sudo apt-get install pbuilder/gutsy-backports to fetch it and upgrade to the new backport version. That solves our crappy email address problem, but now that I’ve read how quickly prevu was pushed out the door and how many changes there have been between gutsy and hardy, I’m going to go ahead and get the backport version of prevu too - which might have something to do with the weird email address issue. Ideally the updated package would depend on the backported version of pbuilder so it would automatically get installed too, but that’s not the case here. That’s why we got pbuilder from backports first. Now we can simply sudo apt-get install prevu/gutsy-backports to upgrade that package too.

Now we’re ready to try again.

$ sudo prevu-init
$ sudo prevu git-core
...
*** t9200-git-cvsexportcommit.sh ***
cvs [init aborted]: cannot get working directory: No such file or directory

Son of a bitch. Seriously this is getting frustrating. Let’s try with pbuilder again just to make sure…

$ apt-get source git-core
$ sudo pbuilder build *.dsc
...
*** t9600-cvsimport.sh ***
* skipping cvsimport tests, cvsps not found

It worked! But I don’t trust it. The build skipped a test group related to CVS, which easily may have failed if run correctly. No, I’m not comfortable with this at all. For one, what’s the explanation for the difference. Let’s see what prevu actually does.

def do_compile(self):
  '''Invokes the build. Call when source package is unpacked and version number is set'''
  ret=os.system('pdebuild --use-pdebuild-internal --buildresult %s/result  -- --basetgz /var/cache/prevu/%s.tgz --buildplace /var/cache/prevu/builds --bindmounts /var/cache/prevu/%s-debs ' % (self.working_path, self.target_distro, self.target_distro))

So that’s how it’s building the packages. But that sure is a lot of option overriding going on there. Wonder why. I’m skeptical, so let’s check prevu-update.

os.system('pbuilder update --basetgz /var/cache/prevu/%s.tgz --buildplace /var/cache/prevu/builds --distribution %s --override-config --othermirror "deb http://archive.ubuntu.com/ubuntu %s main restricted universe multiverse | deb http://archive.ubuntu.com/ubuntu %s-backports main restricted universe multiverse | deb http://archive.ubuntu.com/ubuntu %s-security main restricted universe multiverse | deb http://archive.ubuntu.com/ubuntu %s-updates main restricted universe multiverse | deb file:/var/cache/prevu/%s-debs ./" --bindmounts "/var/cache/prevu/%s-debs" --distribution %s' % (DIST,DIST,DIST,DIST,DIST,DIST,DIST,DIST,DIST) )

Aw man, that’s just ridiculous. When you prevu-update you’re basically overriding all of your pbuilderrc options! And is that gutsy-backports I see being automatically included sans pinning?! So that means every package we’ve built so far is built against dependencies pulled from the backports repository, NOT the versions that we’ll be using the packages with in a real install. What a mess. I’m going to start from scratch again - more soon.

Comments

Post a comment: