7

I'm trying to build a package for my ppa that uses packages from two other ppas. I want to do a test build using pbuilder-dist. I have done this before and I know that I need a combination of:

  • OTHERMIRROR in ~/.pbuilderrc
  • --override-config, but I'm not sure when to add it to the pbuilder-dist call
  • pbuilder-dist raring update and pbuilder-dist raring build <pkg>.dsc
  • maybe other things?

Can someone give a detailed description? I have tried different combinations, but nothing seems to work.

The two ppas I need are ppa:gnome3-team/gnome3 and ppa:tkluck/gnome3. Thanks!

Timo Kluck
  • 9,193

2 Answers2

14

I'm using pbuilder with an enhanced config and not pbuilder-dist but the steps should be basically the same:

  1. Add your extra sources to the OTHERMIRROR variable in your ~/.pbuilderrc:

    OTHERMIRROR="deb http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu raring main|deb http://ppa.launchpad.net/tkluck/gnome3/ubuntu raring main"
    
  2. Chroot into your pbuilder environment to add the repository keys (or alternatively create a local keyring with those two keys and add it to APTKEYSTRINGS variable or add your local /etc/apt/trusted.gpg keyring):

    pbuilder-dist raring login --save-after-login
    apt-key adv --keyserver pgp.mit.edu --recv-keys 3B1510FD 568F2AD3
    exit
    

    (Of course you can extend your sources.list directly and skip step 1 and 3 but an pbuilder-dist update will reset the sources.list.)

  3. Update your pbuilder environment (with plain pbuilder you have to add --override-config):

    pbuilder-dist raring update --release-only
    

    Note: Since raring a development release has the proposed sources enabled as default. This is done by passing the proposed sources to pbuilder's --othermirror command line option - which overwrites the config file value. So you have to use the --release-only switch.

  4. Build your package:

    pbuilder-dist raring build YOURPACKAGE.dsc
    
Lasall
  • 3,733
  • Thanks for your answer! It doesn't seem to work for me, however. Any changes I make during a pbuilder-dist raring login session are discarded. According to the documentation in pbuilder, that's normal behaviour. – Timo Kluck Mar 12 '13 at 09:31
  • Also, even without importing the keys, I would expect the update step to complain for missing keys for some sources. It doesn't, so it seems to completely ignore the OTHERMIRROR variable. – Timo Kluck Mar 12 '13 at 09:32
  • Sorry, forgot the important --save-after-login. Now it will work with a plain ~/.pbuilderrc (I have checked it myself). – Lasall Mar 12 '13 at 12:49
  • This works for me if, inside the login --save-after-login session, I add the deb line to /etc/apt/sources.list and call apt-get update. It seems to fail with just pbuilder-dist raring update, and I'm not sure if I can call it again or that it will just overwrite what I had just accomplished. Maybe you can explain and update your answer? – Timo Kluck Mar 12 '13 at 12:59
  • I'm not sure why it doesn't work. Is there any other content in your ~/.pbuilderrc or did you misspelled this file? I will update the answer that an update will reset the sources.list. – Lasall Mar 12 '13 at 13:30
  • Here's my ~/.pbuilderrc file: http://paste.ubuntu.com/5607994/ It looks good to me, no spelling errors, right? – Timo Kluck Mar 12 '13 at 15:20
  • It does work very well with your config. Please show some debug output: pbuilder-dist raring update --debug-echo – Lasall Mar 12 '13 at 16:20
  • Here's the debug output: http://paste.ubuntu.com/5618176/ Maybe the raring-proposed that's passed as an --other-mirror flag overrides the one in .pbuilderrc? – Timo Kluck Mar 16 '13 at 01:34
  • Yes that's exactly the problem, I will update the answer. – Lasall Mar 16 '13 at 12:55
  • thanks! i'm awarding you the bounty now because it ends soon. I will accept your answer after testing it. – Timo Kluck Mar 17 '13 at 23:14
  • @TimoKluck: Have you tested it yet? – Lasall Apr 07 '13 at 14:48
  • Sorry Lasall, I have been working on other things for a while. This seems very complete so I'll just accept the answer. If I run into any troubles while testing, I'll update the answer with any extra steps I need. – Timo Kluck Apr 11 '13 at 13:48
5

You can also create a Dsomething file stating the repository you want to add. If you have HOOKDIR="${HOME}/.pbuilder-hooks/" in your ~/.pbuilderrc, then a file called $HOME/.pbuilder-hooks/D10addppa could exist with the following content:

#!/bin/sh

echo "deb deb http://ppa.launchpad.net/gnome3-team/gnome3/ubuntu raring main" >> /etc/apt/sources.list
echo "deb http://ppa.launchpad.net/tkluck/gnome3/ubuntu raring main"  >> /etc/apt/sources.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B1510FD 568F2AD3
apt-get update

This method also keeps the PPA changes temporal.

David Foerster
  • 36,900
  • 56
  • 98
  • 152