X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=scripts%2Fdebian%2Fmkfilesindices;h=f7a14a0064ab97300583a9f7dc1bbcea048ae21e;hb=ea17738cea735d71766bfc2bd082f59b3adf2dbb;hp=8bc57e30a7274ab7cb8b7fdf1fa0959593b7396e;hpb=85ed53dc6e2638d71cc0f95e8b7fbf0311deea53;p=dak.git diff --git a/scripts/debian/mkfilesindices b/scripts/debian/mkfilesindices index 8bc57e30..f7a14a00 100755 --- a/scripts/debian/mkfilesindices +++ b/scripts/debian/mkfilesindices @@ -1,14 +1,16 @@ #!/bin/sh -e +export SCRIPTVARS=/srv/ftp.debian.org/dak/config/debian/vars +. $SCRIPTVARS umask 002 -cd /org/ftp.debian.org/ftp/indices/files/components +cd $base/ftp/indices/files/components ARCHLIST=$(tempfile) echo "Querying projectb..." -echo 'SELECT l.path, f.filename, a.arch_string FROM location l JOIN files f ON (f.location = l.id) LEFT OUTER JOIN (binaries b JOIN architecture a ON (b.architecture = a.id)) ON (f.id = b.file)' | psql projectb -At | sed 's/|//;s/|all$/|/;s,^/org/ftp.debian.org/ftp,.,' | sort >$ARCHLIST +echo 'SELECT l.path, f.filename, a.arch_string FROM location l JOIN files f ON (f.location = l.id) LEFT OUTER JOIN (binaries b JOIN architecture a ON (b.architecture = a.id)) ON (f.id = b.file)' | psql projectb -At | sed 's/|//;s/|all$/|/;s,^/srv/ftp.debian.org/ftp,.,' | sort >$ARCHLIST includedirs () { perl -ne 'print; while (m,/[^/]+$,) { $_=$`; print $_ . "\n" unless $d{$_}++; }' @@ -22,7 +24,7 @@ echo "Generating sources list..." ( sed -n 's/|$//p' $ARCHLIST - cd /org/ftp.debian.org/ftp + cd $base/ftp find ./dists -maxdepth 1 \! -type d find ./dists \! -type d | grep "/source/" ) | sort -u | gzip -9 > source.list.gz @@ -33,7 +35,7 @@ ARCHES=$( (<$ARCHLIST sed -n 's/^.*|//p'; echo amd64) | grep . | sort -u) for a in $ARCHES; do (sed -n "s/|$a$//p" $ARCHLIST - cd /org/ftp.debian.org/ftp; + cd $base/ftp find ./dists -maxdepth 1 \! -type d find ./dists \! -type d | grep -E "(proposed-updates.*_$a.changes$|/main/disks-$a/|/main/installer-$a/|/Contents-$a|/binary-$a/)" if echo X sparc mips mipsel hppa X | grep -q " $a "; then @@ -52,22 +54,22 @@ suite_list () { printf 'SELECT id, suite_name FROM suite\n' | psql -F' ' -At projectb | while read id suite; do - [ -e /org/ftp.debian.org/ftp/dists/$suite ] || continue + [ -e $base/ftp/dists/$suite ] || continue ( - (cd /org/ftp.debian.org/ftp; + (cd $base/ftp distname=$(cd dists; readlink $suite || echo $suite) find ./dists/$distname \! -type d for distdir in ./dists/*; do [ "$(readlink $distdir)" != "$distname" ] || echo $distdir done ) - suite_list $id | tr -d ' ' | sed 's,^/org/ftp.debian.org/ftp,.,' + suite_list $id | tr -d ' ' | sed 's,^/srv/ftp.debian.org/ftp,.,' ) | sort -u | gzip -9 > suite-${suite}.list.gz done echo "Finding everything on the ftp site to generate sundries $(date +"%X")..." -(cd /org/ftp.debian.org/ftp; find . \! -type d \! -name 'Archive_Maintenance_In_Progress' | sort) >$ARCHLIST +(cd $base/ftp; find . \! -type d \! -name 'Archive_Maintenance_In_Progress' | sort) >$ARCHLIST rm -f sundries.list zcat *.list.gz | cat - *.list | sort -u | @@ -81,7 +83,7 @@ for a in $ARCHES; do sort -u | poolfirst > ../arch-$a.files done -(cat ../arch-i386.files ../arch-amd64.files; zcat suite-stable.list.gz) | +(cat ../arch-i386.files ../arch-amd64.files; zcat suite-oldstable.list.gz suite-proposed-updates.list.gz) | sort -u | poolfirst > ../typical.files rm -f $ARCHLIST