summaryrefslogtreecommitdiffhomepage
path: root/blog/entry/reprepro-rebuilder.mdwn
blob: 7f7bc83778927b1e9cb87d9d0dd6e41fefb819cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
I've come up with a new [reprepro](https://manpages.debian.org/reprepro)
wrapper for adding rebuilds of existing Debian packages to a local repository:
[reprepro-rebuilder](https://git.spwhitton.name/dotfiles/tree/bin/reprepro-rebuilder).
It should make it quicker to update local rebuilds of existing packages,
patched or unpatched, working wholly out of git.  Here's how it works:

1. Start with a git branch corresponding to the existing Debian package you
   want to rebuild.  Probably you want `dgit clone foo`.

2. Say `reprepro-rebuilder unstable`, and the script will switch you to a
   branch `PREFIX/unstable`, where PREFIX is a short name for your reprepro
   repository, and update `debian/changelog` for a local rebuild.  If the
   branch already exists, it will be updated with a merge.
   
3. You can now do any local patching you might require.  Then, say
   `reprepro-rebuilder --release`.  (The command from step (2) will offer to
   release immediately for the case that no additional patching is required.)

4. At this point, your reprepro will contain a source package coresponding to
   your local rebuild.  You can say `reprepro-rebuilder --wanna-build` to
   build any missing binaries for all suites, for localhost's Debian
   architecture.  (Again, the command from step (3) will offer to do this
   immediately after adding the source package.)

Additionally, if you're rebuilding for unstable, reprepro-rebuilder will offer
to rebuild for backports, too, and there are a few more convenience features,
such as offering to build binaries for testing between steps (2) and (3).  You
can leave the script waiting to release while you do the testing.

I think that the main value of this script is keeping track of the distinct
steps of a relatively fiddly, potentially slow-running workflow for you,
including offering to perform your likely next step immediately.  This means
that you can be doing something else while the rebuilds are trundling along:
you just start `reprepro-rebuilder unstable` in a shell, and unless additional
patching is required between steps (2) and (3), you just have to answer script
prompts as they show up and everything gets done.

If you need to merge from upstream fairly regularly, and then produce binary
packages for both unstable and backports, that's quite a lot of manual steps
that reprepro-rebuilder takes care of for you.  But the script's command line
interface is flexible enough for the cases where more intervention is
required, too.  For example, for my Emacs snapshot builds, I have another
script to replace steps (1) and (2), which merges from a specific branch that
I know has been manually tested, and generates a special version number.  Then
I say `reprepro-rebuilder --release` and the script takes care of preparing
packages for unstable and bullseye-backports, and I can have my snapshots on
all of my machines without a lot of work.