diff --git a/cross/crosschroot-lenny.conf b/cross/crosschroot-lenny.conf new file mode 100644 index 0000000..e1f2c0f --- /dev/null +++ b/cross/crosschroot-lenny.conf @@ -0,0 +1,26 @@ +# Example multistrap configuration file for a cross chroot for armel +# Need to use cascading to select the toolchain for the requested arch. + +[General] +arch= +directory= +# same as --tidy-up option if set to true +cleanup=true +# same as --no-auth option if set to true +# keyring packages listed in each debootstrap will +# still be installed. +noauth=false +# extract all downloaded archives (default is true) +unpack=true +# the order of sections is not important. +# the debootstrap option determines which repository +# is used to calculate the list of Priority: required packages. +debootstrap=Debian Base Toolchains +aptsources=Debian Toolchains + +# Lenny toolchains need -base from Lenny. +[Base] +packages=gcc-4.2-base dpkg-dev binutils-multiarch +source=http://ftp.uk.debian.org/debian +keyring=debian-archive-keyring +suite=stable diff --git a/cross/crosschroot-squeeze.conf b/cross/crosschroot-squeeze.conf new file mode 100644 index 0000000..f87bba0 --- /dev/null +++ b/cross/crosschroot-squeeze.conf @@ -0,0 +1,33 @@ +# Example multistrap configuration file for a cross chroot for armel +# Need to use cascading to select the toolchain for the requested arch. + +[General] +arch= +directory= +# same as --tidy-up option if set to true +cleanup=true +# same as --no-auth option if set to true +# keyring packages listed in each debootstrap will +# still be installed. +noauth=false +# extract all downloaded archives (default is true) +unpack=true +# the order of sections is not important. +# the debootstrap option determines which repository +# is used to calculate the list of Priority: required packages. +debootstrap=Debian Base Toolchains +aptsources=Debian Toolchains + +# Lenny toolchains need -base from Lenny. +[Base] +packages=gcc-4.2-base +source=http://ftp.uk.debian.org/debian +keyring=debian-archive-keyring +suite=stable + +# this is a duplicate if the suite is the same as the toolchain. +[Debian] +packages=dpkg-dev binutils-multiarch +source=http://ftp.uk.debian.org/debian +keyring=debian-archive-keyring +suite=testing diff --git a/cross/crosschroot.conf b/cross/crosschroot.conf index 337e9d2..90a0f7b 100644 --- a/cross/crosschroot.conf +++ b/cross/crosschroot.conf @@ -25,8 +25,9 @@ source=http://ftp.uk.debian.org/debian keyring=debian-archive-keyring suite=stable +# this is a duplicate if the suite is the same as the toolchain. [Debian] packages=dpkg-dev binutils-multiarch source=http://ftp.uk.debian.org/debian keyring=debian-archive-keyring -suite=stable +suite=unstable diff --git a/debian/changelog b/debian/changelog index b19d0c8..eabf89b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -10,8 +10,10 @@ multistrap (2.1.2) experimental; urgency=low * Add support for reinstalling packages known to fail due to preinst problems. * Add a simple C file to test the compiler inside the chroot + * sort duplicate sources list entries and use dedicated sources list + files - -- Neil Williams Tue, 20 Apr 2010 18:15:22 +0100 + -- Neil Williams Wed, 21 Apr 2010 15:23:23 +0100 multistrap (2.1.1) experimental; urgency=low diff --git a/multistrap b/multistrap index 06066be..477dbab 100755 --- a/multistrap +++ b/multistrap @@ -31,7 +31,7 @@ use vars qw/ $progname $ourversion $dstrap $extra @aptsources $mirror $component $repo @dirs @touch %sources $section %keys $host $key $value $type $file $config $tidy $noauth $keyring %keyrings $deflist $cfgdir @extrapkgs @includes %source $setupsh $configsh $omitrequired $dryrun - $omitpreinst @reinstall $tgzname /; + $omitpreinst @reinstall $tgzname %uniq /; setlocale(LC_MESSAGES, ""); textdomain("multistrap"); @@ -237,7 +237,14 @@ foreach $repo (sort keys %suites) mkdir "$dir/${cachedir}archives/partial"; } } -foreach my $aptsrc (@aptsources) +%uniq=(); +foreach my $line (@debootstrap) +{ + $uniq{$line}++; +} +@debootstrap=sort keys %uniq; +%uniq=(); +foreach my $aptsrc (@debootstrap) { if (defined $deflist) { @@ -248,7 +255,7 @@ foreach my $aptsrc (@aptsources) } elsif (-d "${dir}etc/apt/") { - open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap.sources.list") + open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list") or die _g("Cannot open sources list"). $!; $mirror = $sources{$aptsrc}; $suite = $suites{$aptsrc}; @@ -324,7 +331,7 @@ foreach my $sect (sort keys %packages) chomp($str); $str .= " " . join (' ', values %keyrings) . " "; chomp($str); -my %uniq=(); +%uniq=(); @s = split (' ', $str); foreach my $a (@s) { @@ -353,11 +360,28 @@ if (-l "${dir}lib64" ) { } else { - printf (_g("\nMultistrap system installed successfully in %s.\n\n"), $dir); + printf (_g("\nMultistrap system installed successfully in %s.\n"), $dir); } } +# cleanly separate the debootstrap sources from the final apt sources. unlink ("${dir}etc/apt/sources.list.d/multistrap.sources.list") if (-f "${dir}etc/apt/sources.list.d/multistrap.sources.list"); +opendir (LISTS, "${dir}etc/apt/sources.list.d/") + or die (_g("Cannot read apt sources list directory.\n")); +my @sources=grep(!m:\.\.?$:, readdir LISTS); +closedir (LISTS); +foreach my $filelist (@sources) +{ + next if (-d $filelist); + unlink ("${dir}etc/apt/sources.list.d/$filelist"); +} +%uniq=(); +foreach my $line (@aptsources) +{ + $uniq{$line}++; +} +@aptsources=sort keys %uniq; +%uniq=(); foreach my $aptsrc (@aptsources) { if (defined $deflist) @@ -369,7 +393,7 @@ foreach my $aptsrc (@aptsources) } elsif (-d "${dir}etc/apt/") { - open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap.sources.list") + open (SOURCES, ">>${dir}etc/apt/sources.list.d/multistrap-${aptsrc}.list") or die _g("Cannot open sources list"). $!; $mirror = $sources{$aptsrc}; $suite = $suites{$aptsrc}; @@ -381,6 +405,8 @@ END close SOURCES; } } +# altered the sources, so get apt to update. +(not defined $tidy) ? system ("apt-get $config_str update") : &tidy_apt; if (defined $tgzname) { @@ -391,12 +417,14 @@ if (defined $tgzname) $retval /= 256; if ($retval == 0) { - printf (_g("\nRemoving build directory: '%s'\n\n"), $dir); + printf (_g("\nRemoving build directory: '%s'\n"), $dir); system ("rm -rf $dir/*"); } - printf (_g("\nMultistrap system packaged successfully as %s.\n\n"), $tgzname); + my $final_path=`realpath $dir/../$tgzname`; + chomp ($final_path); + printf (_g("\nMultistrap system packaged successfully as %s.\n"), $final_path); } - +print "\n"; exit 0; sub our_version {