removes apt-preferences warning,
defaults arch to build arch if not set
errors out if not aptsources or sources URLs are given
errors out if initial update fails
--- em_multistrap~ 2009-09-07 13:47:26.000000000 +0100
+++ /usr/sbin/em_multistrap 2009-09-07 14:32:56.000000000 +0100
@@ -112,9 +112,24 @@
}
}
print "$progname $ourversion using $file\n";
+
+# Set some sensible defaults
$host = `dpkg-architecture -qDEB_BUILD_ARCH`;
chomp ($host);
+if (not defined $arch)
+{
+ $arch = $host;
+ print "Defaulting architecture to native: $arch\n;"
+}
$foreign++ if ($host ne $arch);
+
+unless (keys %sources and defined @aptsources)
+{
+ die "No sources defined - cannot proceed. \nYou must define at least
one package source and suite (and list them with aptsources=) in $file\n";
+ # For a native multistrap could get some defaults out
+ # of /etc/apt/ config in this case?
+}
+
print "$progname building '$arch' multistrap on '$host'\n";
$cachedir = "var/cache/apt/"; # archives
$libdir = "var/lib/apt/"; # lists
@@ -126,6 +141,7 @@
system ("mkdir -p ${dir}${libdir}");
system ("mkdir -p ${dir}${dpkgdir}");
system ("mkdir -p ${dir}etc/apt/sources.list.d/");
+system ("mkdir -p ${dir}etc/apt/preferences.d/");
@dirs = qw/ alternatives info parts updates/;
@touch = qw/ diversions statoverride status lock/;
foreach my $dpkgd (@dirs) {
@@ -214,9 +230,12 @@
$sourcesname = "sources.list.d/multistrap.sources.list";
$config_str .= " -o Dir::Etc::SourceList=${dir}${etcdir}$sourcesname";
$config_str .= " -o Dir::State=${dir}${libdir}";
-$config_str .= " -o Dir::State::Status=${dir}${dpkgdir}/status";
+$config_str .= " -o Dir::State::Status=${dir}${dpkgdir}status";
$config_str .= " -o Dir::Cache=${dir}${cachedir}";
-system ("apt-get $config_str update");
+print "Getting packages lists:apt-get $config_str update\n";
+$retval = system ("apt-get $config_str update");
+die ("apt update failed. Exit value: ".($retval/256)."\n")
+ if ($retval != 0);
$str = join (' ', values %packages) . " ";
chomp($str);
$str .= join (' ', values %keyrings) . " ";
Wookey
--
Principal hats: iEndian - Balloonboard - Toby Churchill - Emdebian
http://wookware.org/
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]