diff --git a/tools/my-dpkg-scanpackages b/tools/my-dpkg-scanpackages deleted file mode 100755 index aaf9c07d..00000000 --- a/tools/my-dpkg-scanpackages +++ /dev/null @@ -1,264 +0,0 @@ -#! /usr/bin/perl - -$version="1.9.17"; # diverted from dpkg 1.9.17 - -%kmap= ('optional','suggests', - 'recommended','recommends', - 'class','priority', - 'package_revision','revision'); - -@fieldpri= ('Package', - 'Version', - 'Priority', - 'Section', - 'Essential', - 'Maintainer', - 'Pre-Depends', - 'Depends', - 'Recommends', - 'Suggests', - 'Conflicts', - 'Provides', - 'Replaces', - 'Architecture', - 'Filename', - 'Size', - 'MD5sum', - 'Description'); - -$written=0; -$i=100; grep($pri{$_}=$i--,@fieldpri); - -if ($#ARGV > -1 && $ARGV[0] eq "-m") { - shift(@ARGV); - $opt_medium = shift(@ARGV); } -if ($#ARGV > -1 && $ARGV[0] eq "-a") { - shift(@ARGV); - $opt_arch = shift(@ARGV); } -$#ARGV == 1 || $#ARGV == 2 - or die "Usage: dpkg-scanpackages [-m medium] [-a architecture ] binarypath overridefile [pathprefix] > Packages -\te.g. dpkg-scanpackages -m 'Debian GNU/Linux -a i386 binary-i386' \\ -\t\tbinary-i386 /pub/debian/indices/override.hamm.gz \\ -\t\tdists/stable/ > binary-i386/Packages\n"; - -($binarydir, $override, $pathprefix) = @ARGV; --d $binarydir or die "Binary dir $binarydir not found\n"; --e $override or die "Override file $override not found\n"; - -sub vercmp { - ($a,$b)=@_; - return $vercache{$a,$b} if defined($vercache{$a,$b}); - system("dpkg --compare-versions $a le $b"); - $vercache{$a,$a}=$?; - return $?; -} - -# The extra slash causes symlinks to be followed. -open(F,"find $binarydir/ -follow -name '*.deb' -print |") - or die "Couldn't open pipe to find: $!\n"; - -# Note: contrib and other sections are written as contrib/foo in -# the overrides and control file -($sectdir) = "$pathprefix/$binarydir" =~ m:dists/[^\\]+/([^/]+/):; -$sectdir =~ s:(main|hamm)/::; - -while () { - chomp($fn=$_); - substr($fn,0,length($binarydir)) eq $binarydir - or die "$fn not in binary dir $binarydir\n"; - $t= `dpkg-deb -I $fn control`; - if ($t eq "") { - warn "Couldn't call dpkg-deb on $fn: $!, skipping package\n"; - next; - } - if ($?) { - warn "\`dpkg-deb -I $fn control' exited with $?, skipping package\n"; - next; - } - - undef %tv; - $o= $t; - while ($t =~ s/^\n*(\S+):[ \t]*(.*(\n[ \t].*)*)\n//) { - $k= lc $1; $v= $2; - if (defined($kmap{$k})) { $k= $kmap{$k}; } - if (@kn= grep($k eq lc $_, @fieldpri)) { - @kn==1 || die $k; - $k= $kn[0]; - } - $v =~ s/\s+$//; - $tv{$k}= $v; - } - $t =~ /^\n*$/ - or die "Unprocessed text from $fn control file; info:\n$o / $t\n"; - - defined($tv{'Package'}) - or die "No Package field in control file of $fn\n"; - $p= $tv{'Package'}; delete $tv{'Package'}; - - $arch=$tv{'Architecture'}; - if (defined($opt_arch)) { - if ($arch =~ $opt_arch || $arch =~ "all") { -# print(STDERR " ! Package $p ($fn) is for the correct architecture $opt_arch: $arch\n"); - } else { -# print(STDERR " ! Package $p ($fn) is not for the correct architecture $opt_arch: $arch\n"); - next; - } - } - - if (defined($p1{$p})) { - if (&vercmp($tv{'Version'}, $pv{$p,'Version'})) { - print(STDERR " ! Package $p (filename $fn) is repeat but newer version;\n". - " used that one and ignored data from $pfilename{$p} !\n") - || die $!; - delete $p1{$p}; - for $k (keys %k1) { - delete $pv{$p,$k}; - } - } else { - print(STDERR " ! Package $p (filename $fn) is repeat;\n". - " ignored that one and using data from $pfilename{$p} !\n") - || die $!; - next; - } - } - print(STDERR " ! Package $p (filename $fn) has Filename field!\n") || die $! - if defined($tv{'Filename'}); - - $tv{'Filename'}= "$pathprefix$fn"; - - open(C,"md5sum $fn |") || die "$fn $!"; - chop($_=); close(C); $? and die "\`md5sum < $fn' exited with $?\n"; - /^[0-9a-f]{32}/ or die "Strange text from \`md5sum < $fn': \`$_'\n"; - s/\ .*$//; - $tv{'MD5sum'}= $_; - - @stat= stat($fn) or die "Couldn't stat $fn: $!\n"; - $stat[7] or die "$fn is empty\n"; - $tv{'Size'}= $stat[7]; - - if (length($tv{'Revision'})) { - $tv{'Version'}.= '-'.$tv{'Revision'}; - delete $tv{'Revision'}; - } - - for $k (keys %tv) { - $pv{$p,$k}= $tv{$k}; - $k1{$k}= 1; - $p1{$p}= 1; - } - - $_= substr($fn,length($binarydir)); - s#/[^/]+$##; s#^/*##; - $psubdir{$p}= $_; - $pfilename{$p}= $fn; -} -close(F); -$? and warn "find exited with $?\n"; - -select(STDERR); $= = 1000; select(STDOUT); - -format STDERR = - ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< -$packages -. - -sub writelist { - $title= shift(@_); - return unless @_; - print(STDERR " $title\n") || die $!; - $packages= join(' ',sort @_); - while (length($packages)) { write(STDERR) || die $!; } - print(STDERR "\n") || die $!; -} - -@samemaint=(); - -if ($override =~ /\.gz$/) { -open(O, "zcat $override|") - or die "Couldn't open override file $override: $!\n"; -} else { -open(O, $override) - or die "Couldn't open override file $override: $!\n"; -} -while () { - s/\#.*//; - s/\s+$//; - ($p,$priority,$section,$maintainer)= split(/\s+/,$_,4); - next unless defined($p1{$p}); - if (length($maintainer)) { - if ($maintainer =~ m/\s*=\>\s*/) { - $oldmaint= $`; $newmaint= $'; $debmaint= $pv{$p,'Maintainer'}; - if (!grep($debmaint eq $_, split(m:\s*//\s*:, $oldmaint))) { - push(@changedmaint, - " $p (package says $pv{$p,'Maintainer'}, not $oldmaint)\n"); - } else { - $pv{$p,'Maintainer'}= $newmaint; - } - } elsif ($pv{$p,'Maintainer'} eq $maintainer) { - push(@samemaint," $p ($maintainer)\n"); - } else { - print(STDERR " * Unconditional maintainer override for $p *\n") || die $!; - $pv{$p,'Maintainer'}= $maintainer; - } - } - $pv{$p,'Priority'}= $priority; - $pv{$p,'Section'}= $section; - ($sectioncut = $section) =~ s:^[^/]*/::; - if (length($psubdir{$p}) && $section ne $psubdir{$p} && - $sectioncut ne $psubdir{$p}) { - print(STDERR " !! Package $p has \`Section: $section',". - " but file is in \`$psubdir{$p}' !!\n") || die $!; - $ouches++; - } - $o1{$p}= 1; -} -close(O); -print(STDERR "\n") || die $! if $ouches; - -$k1{'Maintainer'}= 1; -$k1{'Priority'}= 1; -$k1{'Section'}= 1; - -@missingover=(); - -for $p (sort keys %p1) { - if (!defined($o1{$p})) { - push(@missingover,$p); - } - $r= "Package: $p\n"; - for $k (sort { $pri{$b} <=> $pri{$a} } keys %k1) { - next unless length($pv{$p,$k}); - $r.= "$k: $pv{$p,$k}\n"; - } - $r.= "X-Medium: $opt_medium\n" if (defined $opt_medium); - $r.= "\n"; - $written++; - $p1{$p}= 1; - print(STDOUT $r) or die "Failed when writing stdout: $!\n"; -} -close(STDOUT) or die "Couldn't close stdout: $!\n"; - -@spuriousover= grep(!defined($p1{$_}),sort keys %o1); - -&writelist("** Packages in archive but missing from override file: **", - @missingover); -if (@changedmaint) { - print(STDERR - " ++ Packages in override file with incorrect old maintainer value: ++\n", - @changedmaint, - "\n") || die $!; -} -if (@samemaint) { - print(STDERR - " -- Packages specifying same maintainer as override file: --\n", - @samemaint, - "\n") || die $!; -} -if (@spuriousover) { - print(STDERR - " -- Packages in override file but not in archive: --\n", - @spuriousover, - "\n") || die $!; -} - -print(STDERR " Wrote $written entries to output Packages file.\n") || die $!; diff --git a/tools/scanpackages.old b/tools/scanpackages.old deleted file mode 100755 index 5e6aa5d7..00000000 --- a/tools/scanpackages.old +++ /dev/null @@ -1,238 +0,0 @@ -#!/bin/sh - -# Copyright 1999 Raphaël Hertzog -# See the README file for the license - -# This script will create the Packages.gz and the Packages.cd files -# First arg = "scan" or "install" -# Second arg = directory of the CD - -#set -e - -CDPACKAGES=1 -DPKG_SCANPACKAGES=$BASEDIR/tools/my-dpkg-scanpackages - -if [ "$1"x = "-noPackages.cd"x ] ; then - shift 1 - CDPACKAGES=0 -fi - -BDIR=$TDIR/$CODENAME-$ARCH - -PREFIX=`echo $2 | sed "s?$BDIR/CD?$BDIR/?"` - -NUM=${PREFIX##$BDIR/} -NUM=`echo $NUM | sed 's/_NONUS//g'` -if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then - SECTIONS="main contrib non-free" - SECTIONSNONUS="non-US/main non-US/contrib non-US/non-free" -else - SECTIONS="main contrib" - SECTIONSNONUS="non-US/main non-US/contrib" -fi - -cd "$2" - -if [ "$1" = "install" ]; then - -if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then - # Strip the MD5Sum and SHA1 fields - # Update some other information as well - sed -e "s/^Architectures: .*$/Architectures: $ARCH/" \ - $MIRROR/dists/$CODENAME/Release | \ - sed -e "s|^Components: .*$|Components: $SECTIONS|" | \ - perl -ne 'if (/^(MD5Sum|SHA1):/i) { $f=1; next } - if ($f) { - unless (/^ /) { print; $f=0 } - } else { print }' > dists/$CODENAME/Release -fi -if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then - # Strip the MD5Sum and SHA1 fields - # Update some other information as well - sed -e "/^ /d" -e "s/^Architectures: .*$/Architectures: $ARCH/" \ - $NONUS/dists/$CODENAME/non-US/Release | \ - sed -e "s|^Components: .*$|Components: $SECTIONSNONUS|" | \ - perl -ne 'if (/^(MD5Sum|SHA1):/i) { $f=1; next } - if ($f) { - unless (/^ /) { print; $f=0 } - } else { print }' > dists/$CODENAME/non-US/Release -fi - -for SECT in $SECTIONS; do - # Install the release files - cp $MIRROR/dists/$CODENAME/$SECT/binary-$ARCH/Release \ - dists/$CODENAME/$SECT/binary-$ARCH/ - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - cp $NONUS/dists/$CODENAME/non-US/$SECT/binary-$ARCH/Release \ - dists/$CODENAME/non-US/$SECT/binary-$ARCH/ - fi - # Install the Packages and Packages.gz files - grep -v ^X-Medium $PREFIX.Packages-$SECT \ - >dists/$CODENAME/$SECT/binary-$ARCH/Packages - grep -v ^X-Medium $PREFIX.Packages-$SECT | gzip --best \ - >dists/$CODENAME/$SECT/binary-$ARCH/Packages.gz - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - grep -v ^X-Medium $PREFIX.Packages-non-US-$SECT \ - >dists/$CODENAME/non-US/$SECT/binary-$ARCH/Packages - grep -v ^X-Medium $PREFIX.Packages-non-US-$SECT | gzip --best \ - >dists/$CODENAME/non-US/$SECT/binary-$ARCH/Packages.gz - fi - # Install the Packages.cd and Packages.cd.gz files - # Each CD know about all prior CDs - # We use "?.packages" here so that we always use US-safe - # packages files only - we don't want later (supposedly - # common) CDs having dependencies on a non-US CD#1... - if [ $CDPACKAGES -eq 1 ] ; then - for i in $TDIR/$CODENAME-$ARCH/?.packages; do - dir=${i%%.packages} - n=${dir##$TDIR/$CODENAME-$ARCH/} - if [ $n -le $NUM ]; then - cat $dir.Packages-$SECT \ - >>dists/$CODENAME/$SECT/binary-$ARCH/Packages.cd - cat $dir.Packages-$SECT | gzip --best \ - >>dists/$CODENAME/$SECT/binary-$ARCH/Packages.cd.gz - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - cat $dir.Packages-non-US-$SECT \ - >>dists/$CODENAME/non-US/$SECT/binary-$ARCH/Packages.cd - cat $dir.Packages-non-US-$SECT | gzip --best \ - >>dists/$CODENAME/non-US/$SECT/binary-$ARCH/Packages.cd.gz - fi - fi - done - fi -done - -if [ -n "$NONUS" -a "$CODENAME" = "slink" ]; then - cp $NONUS/dists/$CODENAME/non-US/binary-$ARCH/Release \ - dists/$CODENAME/non-US/binary-$ARCH/ - grep -v ^X-Medium $PREFIX.Packages-non-US \ - >dists/$CODENAME/non-US/binary-$ARCH/Packages - grep -v ^X-Medium $PREFIX.Packages-non-US | gzip --best \ - >dists/$CODENAME/non-US/binary-$ARCH/Packages.gz - for i in $TDIR/$CODENAME-$ARCH/?.packages; do - dir=${i%%.packages} - n=${dir##$TDIR/$CODENAME-$ARCH/} - if [ $n -le $NUM ]; then - cat $dir.Packages-non-US \ - >>dists/$CODENAME/non-US/binary-$ARCH/Packages.cd - cat $dir.Packages-non-US | gzip --best \ - >>dists/$CODENAME/non-US/binary-$ARCH/Packages.cd.gz - fi - done -fi - -if [ -n "$LOCAL" ]; then - if [ -e ${LOCALDEBS:-$MIRROR}/dists/$CODENAME/local/binary-$ARCH/Release ]; then - cp ${LOCALDEBS:-$MIRROR}/dists/$CODENAME/local/binary-$ARCH/Release \ - dists/$CODENAME/local/binary-$ARCH/ - fi - grep -v ^X-Medium $PREFIX.Packages-local \ - >dists/$CODENAME/local/binary-$ARCH/Packages - grep -v ^X-Medium $PREFIX.Packages-local | gzip --best \ - >dists/$CODENAME/local/binary-$ARCH/Packages.gz - - for i in $TDIR/$CODENAME-$ARCH/?.packages; do - dir=${i%%.packages} - n=${dir##$TDIR/$CODENAME-$ARCH/} - if [ $n -le $NUM ]; then - cat $dir.Packages-local \ - >>dists/$CODENAME/local/binary-$ARCH/Packages.cd - cat $dir.Packages-local | gzip --best \ - >>dists/$CODENAME/local/binary-$ARCH/Packages.cd.gz - fi - done -fi - - -fi - -# Creates the temp Packages-$SECT files -if [ "$1" != "scan" ]; then exit 0; fi - - -if [ ! -e "../overrides" ]; then - # Create an override file with all sections - for SECT in $SECTIONS; do - zcat $MIRROR/indices/override.$CODENAME.$SECT.gz >> ../overrides - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - zcat $NONUS/indices-non-US/override.$CODENAME.$SECT.gz \ - >> ../overrides - fi - done -fi - -# -# Create a Packages file for all packages on the CD -# -if [ -d pool ]; then - $DPKG_SCANPACKAGES -m "`cat .disk/info`" -a $ARCH pool ../overrides \ - > $PREFIX.Packages-BOTH -fi -# We have to scan all possible dists where packages can be -DISTS="" -DISTSNONUS="" -for i in `cd dists; echo *; cd ..`; do - if [ ! -L "dists/$i" -a -d "dists/$i" ]; then - if [ -d "dists/$i/main/binary-$ARCH" -o \ - -d "dists/$i/non-free/binary-$ARCH" -o \ - -d "dists/$i/contrib/binary-$ARCH" ]; then - DISTS="$DISTS $i" - fi - if [ -d "dists/$i/non-US/main/binary-$ARCH" -o \ - -d "dists/$i/non-US/non-free/binary-$ARCH" -o \ - -d "dists/$i/non-US/contrib/binary-$ARCH" ]; then - DISTSNONUS="$DISTSNONUS $i" - fi - fi -done -for SECT in $SECTIONS; do - for DIST in $DISTS; do - $DPKG_SCANPACKAGES -m "`cat .disk/info`" -a $ARCH dists/$DIST/$SECT/binary-$ARCH \ - ../overrides >> $PREFIX.Packages-BOTH - done - for DIST in $DISTSNONUS; do - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - $DPKG_SCANPACKAGES -m "`cat .disk/info`" -a $ARCH \ - dists/$DIST/non-US/$SECT/binary-$ARCH \ - ../overrides >> $PREFIX.Packages-BOTH - fi - done -done -# Separate non-US from the rest -grep-dctrl -FFilename -e '/non-[Uu][Ss]/' $PREFIX.Packages-BOTH \ - > $PREFIX.Packages-ALLNONUS -grep-dctrl -v -FFilename -e '/non-[Uu][Ss]/' $PREFIX.Packages-BOTH \ - > $PREFIX.Packages-ALL - -# Split the Packages file by section -for SECT in $SECTIONS; do - grep-dctrl -FFilename -e "/$SECT/" $PREFIX.Packages-ALL \ - > $PREFIX.Packages-$SECT - - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - grep-dctrl -FFilename -e "/$SECT/" $PREFIX.Packages-ALLNONUS \ - > $PREFIX.Packages-non-US-$SECT - fi -done - -# Slink special case -if [ -n "$NONUS" -a "$CODENAME" = "slink" ]; then - $DPKG_SCANPACKAGES -m "`cat .disk/info`" -a $ARCH \ - dists/$CODENAME/non-US/binary-$ARCH \ - $NONUS/indices-non-US/override.$CODENAME.gz \ - > $PREFIX.Packages-non-US -fi - -if [ -n "$LOCAL" ]; then - $DPKG_SCANPACKAGES -m "`cat .disk/info`" -a $ARCH \ - dists/$CODENAME/local/binary-$ARCH \ - /dev/null > $PREFIX.Packages-local - - if [ -d pool/local ] - then - $DPKG_SCANPACKAGES -m "`cat .disk/info`" -a $ARCH \ - pool/local /dev/null >> $PREFIX.Packages-local - fi -fi - -exit 0 diff --git a/tools/scansources.old b/tools/scansources.old deleted file mode 100755 index d960329f..00000000 --- a/tools/scansources.old +++ /dev/null @@ -1,100 +0,0 @@ -#!/bin/sh - -# Copyright 1999 Raphaël Hertzog -# See the README file for the license - -# This script will create the Sources.gz files -# First arg = directory of the CD - -set -e - -PREFIX=$1 -if [ -n "$NONFREE" -o -n "$EXTRANONFREE" ]; then - SECTIONS="main contrib non-free" -else - SECTIONS="main contrib" -fi - -cd $PREFIX - -# We have to scan all possible dists where sources can be -DISTS="" -DISTSNONUS="" -for i in `cd dists; echo *; cd ..`; do - if [ ! -L "dists/$i" -a -d "dists/$i" ]; then - if [ -d "dists/$i/main/source" -o \ - -d "dists/$i/non-free/source" -o \ - -d "dists/$i/contrib/source" ]; then - DISTS="$DISTS $i" - fi - if [ -d "dists/$i/non-US/main/source" -o \ - -d "dists/$i/non-US/non-free/source" -o \ - -d "dists/$i/non-US/contrib/source" ]; then - DISTSNONUS="$DISTSNONUS $i" - fi - fi -done - -if [ -e "$MIRROR/dists/$CODENAME/Release" ]; then - # Strip the MD5Sum and SHA1 field - perl -ne 'if (/^(MD5Sum|SHA1):/) { $f=1; next; } - if ($f) { - unless (/^ /) { print; $f=0 } - } else { print }' \ - $MIRROR/dists/$CODENAME/Release > dists/$CODENAME/Release -fi -if [ -n "$NONUS" -a -e "$NONUS/dists/$CODENAME/non-US/Release" ]; then - # Strip the MD5Sum and SHA1 field - perl -ne 'if (/^(MD5Sum|SHA1):/) { $f=1; next; } - if ($f) { - unless (/^ /) { print; $f=0 } - } else { print }' \ - $NONUS/dists/$CODENAME/non-US/Release \ - > dists/$CODENAME/non-US/Release -fi - -for SECT in $SECTIONS; do - - if [ -d "pool/$SECT" ]; then - dpkg-scansources pool/$SECT > dists/$CODENAME/$SECT/source/Sources - fi - for DIST in $DISTS; do - if [ -d "dists/$DIST/$SECT/source" ] ; then - dpkg-scansources dists/$DIST/$SECT/source \ - >> dists/$CODENAME/$SECT/source/Sources - fi - done - if [ -f dists/$CODENAME/$SECT/source/Sources ] ; then - gzip --best dists/$CODENAME/$SECT/source/Sources - fi - - if [ -n "$NONUS" -a "$CODENAME" != "slink" ]; then - if [ -d "pool/non-US/$SECT" ]; then - dpkg-scansources pool/non-US/$SECT \ - > dists/$CODENAME/non-US/$SECT/source/Sources - fi - for DIST in $DISTSNONUS; do - if [ -d "dists/$DIST/non-US/$SECT/source" ] ; then - dpkg-scansources dists/$DIST/non-US/$SECT/source \ - >> dists/$CODENAME/non-US/$SECT/source/Sources - fi - done - if [ -f dists/$CODENAME/non-US/$SECT/source/Sources ] ; then - gzip --best dists/$CODENAME/non-US/$SECT/source/Sources - fi - fi - -done - -# Slink special case -if [ -n "$NONUS" -a "$CODENAME" = "slink" ]; then - dpkg-scansources dists/$CODENAME/non-US/source \ - | gzip --best > dists/$CODENAME/non-US/source/Sources.gz -fi - -if [ -n "$LOCAL" ]; then - dpkg-scansources dists/$CODENAME/local/source \ - | gzip --best > dists/$CODENAME/local/source/Sources.gz -fi - -exit 0