[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian mirror scripts

Cajus Pollmeier <cajus@naasa.net> writes:

> Am 30.01.2005 um 16:01 schrieb Thiemo Seufer:
>> Cajus Pollmeier wrote:
>>> Hi,
>>> I'm looking for a script that regenerates Packages* and Release
>>> files for a complete mirror. Due to some installer development, I
>>> currently need to switch the mirrors during installation in order to
>>> get up to date packages.
>>> Tried to work around this with a simple script that merges my
>>> packages into the local mirror and regenerates everything as
>>> needed. But sadly this doesn't seem to be perfect :-( The installer
>>> just doesn't want to get some of these packages, even if the md5's
>>> are correct. Switching from http to ftp gets some more of them and
>>> stucks some packages later. Grrr.
>> You might want to compare your script with the one for partial d-i
>> test mirrors, available from d-i SVN in trunk/scripts/testmirror.
> Here's the result of some testing:
> debpool:	is fine for new pools, but recreating the whole mirror with
> 		.deb and .udeb packages didn't work and I'm not the perl
> 		guy who's capable of fixing it.
> dak:		too complicated for fire and forget
> mirrorer:	not tested because alioth is still down
> departialmirror: not a package, after resolving some dependencies,
> 		it actually did not do what I wanted.
> Finally I fixed the quick'n dirty bash script. It lacks features like
> gpg
> signing, SHA entries in Releases, etc., but for a local test mirror its
> failrly enough ;-) If someone's interested, I can clean it up an put it
> somewhere.
> Thanks for your hints!
> Cheers,
> Cajus

>From the amd64 archive on alioth. Enjoy.



  # Rebuild Packages, Sources and Release files
  for SUITE in testing unstable; do
    case $SUITE in
      testing) CODENAME=sarge;;
      unstable) CODENAME=sid;;
    echo  > "$STRUCT/dists/$CODENAME/Release" "Origin: Debian-amd64"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Label: Debian-amd64"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Suite: $SUITE"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Codename: $CODENAME"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Date: `date -u`"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Architectures: $ARCHS"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Components: main main/debian-installer"
    echo >> "$STRUCT/dists/$CODENAME/Release" "Description: Debian amd64 port"
    echo >> "$STRUCT/dists/$CODENAME/Release" "MD5Sum:"
    for FILE in main/source/Release main/source/Sources.gz main/binary-amd64/Release main/binary-amd64/Packages main/binary-amd64/Packages.gz main/debian-installer/binary-amd64/Packages main/debian-installer/binary-amd64/Packages.gz contrib/source/Release contrib/source/Sources.gz contrib/binary-amd64/Release contrib/binary-amd64/Packages contrib/binary-amd64/Packages.gz non-free/source/Release non-free/source/Sources.gz non-free/binary-amd64/Release non-free/binary-amd64/Packages non-free/binary-amd64/Packages.gz; do
      echo " `md5sum $STRUCT/dists/$CODENAME/$FILE | cut -b0-32` `wc -c < $STRUCT/dists/$CODENAME/$FILE` $FILE" >> "$STRUCT/dists/$CODENAME/Release"
    echo "Creator: $0" >> "$STRUCT/dists/$CODENAME/Release"

    # sign Release file
    gpg --default-key "Debian-amd64 archive key (2004) <debian-amd64@lists.debian.org>" --armor --detach-sign "$STRUCT/dists/$CODENAME/Release"
    mv "$STRUCT/dists/$CODENAME/Release.asc" "$STRUCT/dists/$CODENAME/Release.gpg"

Reply to: