How Emdebian makes a release, using reprepro

reprepro will gain a [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=515030 "read-only" mode] for a genuinely frozen distribution, but a few workarounds are necessary with the current version of reprepro.

The problem is that if stable is created within the existing repository, every action to include new or updated packages in the repository or modify repository data, causes the Release files for the stable distribution to be touched. This should not happen and it breaks the security signatures on the Release files.

The solution is to put stable into a second repository, all by itself, clearly identified as 'frozen' and then symlink that directory so that apt and similar tools can find it where they expect to find it. Naturally, this means removing stable from the existing repository.

The important point in this process is that suites can change, codenames must be pulled - i.e. reprepro can change a suite (unstable, testing, stable, oldstable) during a normal export but changing a codename (etch, lenny, squeeze, sid) can only be done by creating the codename you need and pulling packages from the old codename to the new.

Do NOT get [http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=515114 suites and codenames] confused!

Emdebian Release Plan

Create a frozen directory.
Copy conf/distributions into frozen/conf and delete all lines for unstable.
Rename testing as stable and remove any existing update and override rules.
Generate data for lenny (stable).
reprepro -b frozen/ export
reprepro -b frozen/ createsymlinks
Create an updates file in frozen/conf
Name: freeze
Method: file://opt/reprepro/grip/
Suite: testing
Add updates file to frozen/conf/distributions
Update: freeze
Update frozen from lenny (testing) in current repository.
reprepro -b frozen/ checkupdate
reprepro -b frozen/ update
Remove update rule from frozen/conf/distributions
Remove update file from frozen/conf/
        we now have a frozen lenny (stable)
Delete testing/ symlink in old repo
Change lenny in old repo to stable in conf/distributions
Add squeeze (testing) in old repo conf/distributions
reprepro export
reprepro createsymlinks
Pull lenny (testing) in old repo into new squeeze (testing)
Create the pulls file in conf/
Name: squeeze
From: lenny
reprepro checkpull
reprepro pull
Remove lenny from old repo conf/distributions
rm -rf dists/lenny
reprepro --delete clearvanished
reprepro createsymlinks
Now symlink frozen/dists/stable into dists/
cd dists/
ln -s ../frozen/dists/lenny/ .
ln -s lenny stable

Final dists/ directories:

$ ls -l dists/
total 8
lrwxrwxrwx 1 neil neil   22 2009-02-14 20:08 lenny -> ../frozen/dists/lenny/
drwxr-xr-x 3 neil neil 4096 2009-02-14 20:09 sid
drwxr-xr-x 3 neil neil 4096 2009-02-14 20:09 squeeze
lrwxrwxrwx 1 neil neil    5 2009-02-14 20:08 stable -> lenny
lrwxrwxrwx 1 neil neil    7 2009-02-14 20:06 testing -> squeeze
lrwxrwxrwx 1 neil neil    3 2009-01-19 08:15 unstable -> sid

Note that squeeze and sid are real directories, testing and unstable are symlinks. lenny is a real directory in ../frozen/dists/ as well, stable is the symlink.

Sample local test for apt

deb file:///opt/reprepro/grip/ lenny main

Sample apt-cache policy output:

$ apt-cache policyPackage files:
 100 /var/lib/dpkg/status
     release a=now
 500 file: lenny/main Packages
     release v=0.1,o=Debian,a=stable,l=EmdebianGrip,c=main
 500 http://www.emdebian.org unstable/main Packages
     release v=0.1,o=Debian,a=unstable,l=Emdebian-tools-unstable,c=main
     origin www.emdebian.org
 500 ftp://ftp.fr.debian.org unstable/main Packages
     release o=Debian,a=unstable,l=Debian,c=main
     origin ftp.fr.debian.org
Pinned packages:

For a specific test package:

$ apt-cache policy zlib1g
zlib1g:
  Installed: 1:1.2.3.3.dfsg-12
  Candidate: 1:1.2.3.3.dfsg-12em1
  Version table:
     1:1.2.3.3.dfsg-12em1 0
        500 file: lenny/main Packages
 *** 1:1.2.3.3.dfsg-12 0
        500 ftp://ftp.fr.debian.org unstable/main Packages
        100 /var/lib/dpkg/status

Remember to remove the local test sources (or comment them out).


CategoryEmdebian