Release Files für Debian Repositories#

Inhaltsverzeichnis

[#1]

Triviale Depots#

Ausschnitt von debian.org

Triviale Depots bestehen aus einem Hauptverzeichnis und so vielen Unterverzeichnissen wie Sie wollen. 
Da der Benutzer den Pfad zum Hauptverzeichnis des Depots und den relativen Pfad vom Hauptverzeichnis zum 
Verzeichnis mit den Index-Dateien angeben muss, können Sie machen was Sie wollen (sogar alles in das 
Hauptverzeichnis des Depots packen. In dem Fall ist der relative Pfad sehr leicht „/“).

Beispiel 2. Ein triviales Depot mit zwei Unterverzeichnisen

(Ihr Depot-Verzeichnisbaum)
|
|-binary
+-source


Erstellen der Index-Dateien

dpkg-scanpackages generiert die Packages-Datei und dpkg-scansources die Sources-Datei.

Beide schicken ihre Ausgabe an stdout. Dadurch können Sie, zum Erstellen einer komprimierten Datei, 
ein Kommando wie dieses verwenden: dpkg-scanpackages Argumente | gzip -9c > Packages.gz.

Die zwei Werkzeuge arbeiten auf die selbe Weise; beide erhalten zwei Argumente (in Wirklichkeit sind es mehr, 
aber ich möchte hier nicht näher darauf eingehen; Sie können gerne die Handbuchseiten lesen, wenn Sie mehr 
wissen wollen). Als erstes das Verzeichnis in dem die Pakete liegen und das zweite ist die Überschreibdatei 
(override). Für einfache Depots brauchen wir keine Überscheibdateien, aber da es ein benötigtes Argument ist, 
geben wir einfach /dev/null an.

dpkg-scanpackages durchsucht die .deb-Pakete; dpkg-scansources durchsucht die .dsc-Dateien. Folglich ist es 
nötig die .orig.gz-, .diff.gz- und .dsc-Dateien an die selbe Stelle zu legen. Die .changes-Dateien werden nicht 
gebraucht.

Falls Sie ein »triviales Depot« wie das aus Beispiel 2, „Ein triviales Depot mit zwei Unterverzeichnisen“ haben,
können Sie die zwei Index-Dateien wie folgt generieren:

$ cd mein-Depot
$ dpkg-scanpackages binary /dev/null | gzip -9c > binary/Packages.gz
$ dpkg-scansources source /dev/null | gzip -9c > source/Sources.gz

[...]

Die »Release«-Datei erstellen

Wenn Sie dem Benutzer Ihres Depots erlauben wollen Pinning (Anheften) mit Ihrem Depot zu nutzen, 
müssen Sie eine Release-Datei in jedem Verzeichnis mit Index-Dateien hinzufügen. 
(Sie können mehr über Anheften im APT-HOWTO) erfahren.

Die Release-Dateien sind einfache und kurze Textdateien der folgenden Form:

Archive: Archiv
Component: Gruppe
Origin: Ihre Firma
Label: Debian-Depot Ihrer Firma
Architecture: Architektur

Archive

    Der Name der Distribution von Debian zu der die Pakete in diesem Verzeichnis gehören 
(oder entwickelt wurden), z.B. stable, testing oder unstable.
Component

    Die Gruppe der Pakete in diesem Verzeichnis, zum Beispiel main, non-free oder contrib.
Origin

    Der Name des Paketautors.
Label

    Ein angemessenes Kennzeichen für das Paket oder für Ihr Depot. Benutzen Sie Ihre Fantasie.
Architecture

    Die Architektur der Pakete in diesem Verzeichnis, wie i386, sparc oder source.

Es ist wichtig Archive und Architecture korrekt anzugeben, da sie am meisten zum Anheften verwendet werden. 
Die anderen sind dagegen weniger wichtig.

[...]

Ein Depot benutzen

Ein Depot zu benutzen ist sehr einfach, hängt aber davon ab, was für eine Art von Depot Sie erstellt haben: 
Binär- oder Quellpaket, automatisch oder trivial.

Jedes Depot bekommt eine Zeile in der sources.list; 
für ein binäres benutzen Sie das deb-Schlüsselwort und für 
ein Quellpaket benutzen Sie das deb-src-Schlüsselwort.

Jede Zeile gehorcht der folgenden Syntax:

deb|deb-src uri Distribution [Gruppe1] [Gruppe2] [...]

Die uri ist die URI des Hauptverzeichnisses des Depots, so wie beispielsweise ftp://ftp.IhrServer.de/debian, 
http://IhrServer.de/debian oder – für lokale Dateien – file::///home/joe/mein-debian-depot. 
Der folgende Schrägstrich ist optional.

Für automatische Depots müssen Sie eine Distribution und mindestens eine Gruppe angeben. 
Die Distribution darf nicht mit einem Schrägstrich enden.

Beispiel 3. Zwei automatische Depots aus meiner sources.list

deb ftp://sunsite.cnlab-switch.ch/mirror/debian/ unstable main contrib non-free
deb-src ftp://sunsite.cnlab-switch.ch/mirror/debian/ unstable main contrib non-free

Diese zwei Zeilen definieren ein automatisches Binär- und Quell-Depot mit Hauptverzeichnis 
ftp://sunsite.cnlab-switch.ch/mirror/debian/, der Distribution unstable und den Gruppen main, 
contrib und non-free.

Wenn das Depot nicht automatisch ist, definiert distribution den relativen Pfad zu den Index-Dateien und muss 
mit einem Schrägstrich enden, außerdem darf keine Gruppe angegeben werden. 

[...]

Werkzeuge

Es gibt verschiedene Werkzeuge, um die Erstellung eines Debian-Archivs zu automatisieren und vereinfachen. 
Ich habe die bekanntesten Werkzeuge hier aufgezählt.

apt-ftparchive wird benutzt, um eine Kollektion von Debian-Paketdateien in eine geeignete Archivhierarchie, 
wie die vom offiziellen Debian-Archiv, einzugliedern. Es ist ein Teil des apt-utils-Paketes.

apt-move wird benutzt um eine Kollektion von Debian-Paketdateien in eine geeignete Archivhierarchie, 
wie sie vom offiziellen Debian-Archiv verwendet wird, zu verschieben.

[#2]

Rekonstruktion des originalen Forum-Artikelbaums von debianplanet.org#

(Rekonstruktion von archive.org)


Merging multiple CDs into one repository
Submitted by ashridah on Tuesday, June 18, 2002 - 20:02
CD ImagesIs there any way of merging a set of Debian CDs to form one large repository producing apropriate "Packages.gz" files. I have tried debmirror and apt-move to no avail.
Category: Q & A	


Subject: 	Re: Merging multiple cds into one repository. 	
Author:	Anonymous
Date:	Wednesday, 2002/06/19 - 23:03
So does someone wish to volunteer to create an intuitive GUI replacement/front-end for dpkg-scanpackages, apt-move and mkisofs? Drag and drop your debs folder, and voila an iso ready to burn! Or even just a clever script that asks all the right questions. Might take some expert programming. Not for the faint-hearted. Seems there would be demand for such a tool.
[ Please login, or register ]

 	
Subject: 	Please do 	
Author:	Yorric
Date:	Sunday, 2003/07/20 - 08:36
I am in almost the same position with a 28.8k connection and no broadband options. At the moment I have relatively current images of sarge on CD-rw's which took over a month to download. Consequently I have been looking for a program to do this function. The closest I have found is PGI which is no longer being worked on but exists in debian. It looks like it is only compatible with ext2 and doesn't have a nice gui.
[ Please login, or register ]

 	
Subject: 	Re: Merging multiple cds into one repository. 	
Author:	grolschie
Date:	Saturday, 2002/06/22 - 00:13
Wonderful, some-one please do. :-)
[ Please login, or register ]

Subject: 	Quetion on the same topic: 	
Author:	Anonymous
Date:	Wednesday, 2002/06/19 - 00:36
Sorry, to bust in on your thread Ashridah.

Is there a newbie-friendly way to backup .deb files onto an 'apt-cdrom' friendly CD? I mean is there a program or nice script that will scan the debs, create the package lists (and whatever else is needed) and write an ISO.

I have downloaded the debian-cd package, but it seems complicated and overkill for a newbie just wanting to backup debs onto CD (and have apt-cdrom be able to add these to the /etc/apt/sources.list file). Not wanting to create an entire official Debian Distribution CD.

Thanks.
[ Please login, or register ]

 	
Subject: 	Re: Quetion on the same topic: 	
Author:	glenalec
Date:	Wednesday, 2002/06/19 - 02:11
I maintain my own minimal Debian install disk with just the packages I use (about 320M worth) because on a 14.4 line I don't want to be downloading ISOs.

I keep all my upgraded packages in a folder (apt-move is set up to do this) and periodically run a script:

#!/bin/sh
apt-move local
mkisofs -J -R -l -L -d -b rescue.bin -o /home/cd.iso ./

then I run a separate script:

#!/bin/sh
cdrecord -v dev=0,0 speed=4 /home/cd.iso

If you don't want a full install CD, modify the mkiso command to not have the -b rescue.bin

Apt-move is a bit tricky to set up. Something that wasn't documented when I set it up last year was that the local directory has to be at the *top* of the sources.list file:

deb file:/home/Debian testing main contrib non-free # Local repository
deb ftp://ftp.jp.debian.org/debian testing main contrib non-free
deb ftp://ftp.jp.debian.org/debian-non-US testing non-US/main non-US/contrib non-US/non-free
deb ftp://metalab.unc.edu/pub/linux/devel/lang/java/blackdown.org/debian woody non-free #blackdown java

Hope this helps
[ Please login, or register ]

 	
Subject: 	Re: Quetion on the same topic: 	
Author:	Anonymous
Date:	Wednesday, 2002/06/19 - 06:06
Thanks for that. However, I do not wish to mirror a distribution or a website (eg: non-us.debian.org as apt-move seems to need). apt-move expects a url to mirror. To clarify, I don't need a boot cd. I have Debian CD's. I just need to back up nicely, a pile of downloaded unofficial debs, and some rolled by me debs.

If I just create a Packages.gz file and write the directory with it and the debs to a cd, will apt-cdrom work with this cd?

Sorry if I sound thick. I nice GUI app would be in order. Seems the original question on this thread would be solved by such a program. :-)

[ Please login, or register ]

 	
Subject: 	Re: Quetion on the same topic: 	
Author:	glenalec
Date:	Wednesday, 2002/06/19 - 11:37
Ignore all the external URL stuff - that's just how I get my debs onto the system in dribs and drabs (via 14.4k connection which thankfully I don't pay for). apt-move local just takes everything in your /var/cache/apt/packages folder (ie all the updates you have apt-getted) and puts them somewhere else properly sorted and in correct disrto folders. Oh, and it also puts in appropriate sources lists. If you then dump this folder to a CD-R you should have an apt-cd-able CD.

When I had a catastrophic hardware failure recently, I re-installed the Potato image, then rebooted as usual. Once the basic system is on there, it is just a matter of mounting the CDs - just like you want - and this is where the part done by apt-move local is used.

It's really just a way of creating a mini-archive of everything already in your /var/cache/apt/packages folder! And apt-get sync is supposed to load up /var/cache/apt/packages with everything already installed on your system if some packages have gone missing (it didn't work too well for me, but that was ages ago).

I'd recomend downloading apt-move and reading the docs. You're not thick, I'm just having trouble describing what I sort of worked out by feel when I really had no clue what I was doing! ;-)

Regards, glenalec
[ Please login, or register ]

 	
Subject: 	Re: Question on the same topic: 	
Author:	OmniscientFerret
Date:	Wednesday, 2002/06/19 - 13:38
This is also usable with apt-zip, to update lots of packages on a computer without a network connection.

apt-get uses the label in /.info on the CD (I think) to request a specific CD; it's useful to put a datestamp there.
[ Please login, or register ]

Subject: 	Re: Merging multiple cds into one repository. 	
Author:	lordsutch
Date:	Tuesday, 2002/06/18 - 21:13
Rough draft:

for CD in CDS:


   1. insert CD
   2. mount /dev/cdrom /cdrom
   3. rsync -avz /cdrom/{indices,dists,pool} /MY_REPOSITORY
   4. umount /dev/cdrom
   5. eject CD



cd /MY_REPOSITORY
apt-ftparchive packages dists/woody/main/binary-ARCH/ > dists/woody/main/binary-ARCH/Packages
[ Please login, or register ]

 	
Subject: 	Re: Merging multiple cds into one repository. 	
Author:	ashridah
Date:	Wednesday, 2002/06/19 - 00:26
and to follow up again:
does anyone have a sample config file for the apt-ftparchive generate command?
the package doesn't include one, and i'm having trouble wrapping my head around it.

ashridah
[ Please login, or register ]

 	
Subject: 	Re: Merging multiple cds into one repository. 	
Author:	ex-bart
Date:	Wednesday, 2002/06/19 - 12:53
joe@tegenfeldt:~$ cd /var/spool/mirror/debian/
joe@tegenfeldt:/var/spool/mirror/debian$ ls
apt-ftparchive.conf cache.db dists generate
joe@tegenfeldt:/var/spool/mirror/debian$ cat apt-ftparchive.conf
DIR {
ArchiveDir "/var/spool/mirror/debian";
}
TREEDEFAULT {
BinCacheDB "/var/spool/mirror/debian/cache.db";
}
TREE "dists/local" {
Sections "non-free main";
Architectures "i386 source";
}
TREE "dists/debian" {
Sections "main";
Architectures "i386";
}
joe@tegenfeldt:/var/spool/mirror/debian$ cat generate
#!/bin/sh
apt-ftparchive generate apt-ftparchive.conf
joe@tegenfeldt:/var/spool/mirror/debian$
[ Please login, or register ]

 	
Subject: 	Re: Merging multiple cds into one repository. 	
Author:	ex-bart
Date:	Wednesday, 2002/06/19 - 12:55
ah, fsck. hopefully this won't be magled.

joe@tegenfeldt:~$ cd /var/spool/mirror/debian/
joe@tegenfeldt:/var/spool/mirror/debian$ ls
apt-ftparchive.conf cache.db dists generate
joe@tegenfeldt:/var/spool/mirror/debian$ cat apt-ftparchive.conf
DIR {
ArchiveDir "/var/spool/mirror/debian";
}
TREEDEFAULT {
BinCacheDB "/var/spool/mirror/debian/cache.db";
}
TREE "dists/local" {
Sections "non-free main";
Architectures "i386 source";
}
TREE "dists/debian" {
Sections "main";
Architectures "i386";
}
joe@tegenfeldt:/var/spool/mirror/debian$ cat generate
#!/bin/sh
apt-ftparchive generate apt-ftparchive.conf
joe@tegenfeldt:/var/spool/mirror/debian$
[ Please login, or register ]

 	
Subject: 	Re: Merging multiple cds into one repository. 	
Author:	ashridah
Date:	Thursday, 2002/06/20 - 05:57
sweet. thanks
ash
[ Please login, or register ]

 	
Subject: 	Re: Merging multiple cds into one repository. 	
Author:	ashridah
Date:	Tuesday, 2002/06/18 - 23:57
ah. interesting. after modifying it a bit to cope with the fact that the packages are in pool/* now, it seems like it's the right tool.

thanks
[ Please login, or register ]

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-3) was last changed on 12-Mar-2009 11:39 by MarkusMonderkamp