debian-cd-clone/tools/generate_di_list

70 lines
1.9 KiB
Plaintext
Raw Normal View History

#!/usr/bin/perl -w
# Generate a list of packages required for debian-installer
# This script makes use of the following variables that need to be preset:
# MIRROR, DI_CODENAME, BASEDIR
die "Missing \$MIRROR variable" unless $ENV{MIRROR};
die "Missing \$DI_CODENAME variable" unless $ENV{DI_CODENAME};
die "Missing \$BASEDIR variable" unless $ENV{BASEDIR};
2008-05-04 17:38:52 +00:00
my @ARCHES=qw{alpha arm armel hppa hurd-i386 i386 ia64 mips mipsel
powerpc s390 sparc amd64};
my $DATE=`date`;
chomp $DATE;
open(OUT, ">debian-installer") || die "write: $!";
print OUT << "EOF";
/* List of udebs to be included so that debian-installer works fine
*
* This list can be generated with the command:
* ../tools/generate_di_list
*
- Since amd64 is not on standard debian mirrors, and generate_d-i+k_list must be runnable on them, make it chack for absence of amd64 Packages files and add a dummy kernel for amd64. This will need to be manually kept up-to-date by the amd64 people for now. - Didn't fix generate_di_list the same way, since doing so would be too hard. Next time tasks/debian-installer is updated using this script on a machine w/o the unofficial amd64 archive, the am64 info in the file will be lost. - Add DO NOT EDIT warning messages to generated files in cvs. - Check and revert manual modifications to tasks/base-sarge. This file is automatically generated and those mods would have been lost: - Add fileutils to generate_d-i+k_list, "until kernels get fixed", whatever that means. - arcboot was already in generate_d-i+k_list. - Update tasks/debian-installer+kernel using generate_d-i+k_list. - Sort package lists in tasks/base-sarge to ease comparisons when updating. - Update tasks/base-sarge for debootstrap 0.2.45. This includes the following removals: - aboot: already listed in debian-installer+kernel - gcc-3.2-base, libdb2, libgcrypt1, libgnutls7, libident, libdb2, libtasn1-0: obsolete - modconf: obsoleted by d-i - setserial: not base anymore - slang1: turned into slang1a-utf8 - libident: not needed by base anymore - lilo: in debian-installer+kernel - mbr: not installed anymore - pcmcia-cs: in debian-installer+kernel - syslinux: not installed - "filesutils": typo; fileutils in generate_d-i+k_list for m68k - quik: in debian-installer+kernel - yaboot: in debian-installer+kernel - arcboot: in debian-installer+kernel - delo: in debian-installer+kernel And the following additions: - libdb4.2, libgcrypt11, libgcrypt7, libgnutls10, libgnutls11, libgpg-error0, libtasn1-2: new libraries - console-tools: now installed by debootstrap even on s390
2005-01-02 22:31:45 -01:00
* DO NOT EDIT THIS FILE, edit the above script
*
* Last update: $DATE
*/
EOF
my @common_excludes = read_exclude("exclude-udebs");
foreach my $arch (@ARCHES) {
my $packagefile="$ENV{MIRROR}/dists/$ENV{DI_CODENAME}/main/debian-installer/binary-$arch/Packages.gz";
unless (-f $packagefile) {
print "Missing package file for arch $arch.\n";
next;
}
2004-07-11 15:35:36 +00:00
(my $cpparch = $arch) =~ s/-/_/g;
print OUT "#ifdef ARCH_$cpparch\n";
my @exclude = @common_excludes;
push @exclude, read_exclude("exclude-udebs-$arch")
if -e exclude_path("exclude-udebs-$arch");
2006-01-25 20:44:48 -01:00
UDEB: foreach my $udeb (map { chomp; $_ } `zcat $packagefile | awk '/^Package:/ {print \$2}'`) {
foreach my $pattern (@exclude) {
if ($udeb =~ /^$pattern$/) {
next UDEB;
}
}
print OUT "$udeb\n";
}
print OUT "#endif /* ARCH_$cpparch */\n";
}
sub read_exclude {
my $file=exclude_path(shift);
open (IN, "<$file") || warn "failed to read exclude file $file";
my @ret;
while (<IN>) {
chomp;
s/^#.*//;
next unless length;
$_=quotemeta($_);
$_=~s/\\\*/.*/g;
push @ret, $_;
}
close IN;
return @ret;
}
sub exclude_path {
my $file=shift;
return "$ENV{BASEDIR}/data/$ENV{DI_CODENAME}/$file";
}