From d5c6e6b8e52dde90aa2b11c24b6945e42525cb40 Mon Sep 17 00:00:00 2001 From: codehelp Date: Wed, 5 May 2010 19:10:43 +0000 Subject: [PATCH] Clarify error reporting in the --simulate option, warn if sections are not defined. (Closes: #579627) git-svn-id: http://emdebian.org/svn/current@7183 563faec7-e20c-0410-992a-a66f704d0ccd --- cross/armel.conf | 2 +- debian/changelog | 4 +++- multistrap | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/cross/armel.conf b/cross/armel.conf index 6582b99..da88ac3 100644 --- a/cross/armel.conf +++ b/cross/armel.conf @@ -4,7 +4,7 @@ omitrequired=false configscript= setupscript=/usr/share/multistrap/setcrossarch.sh debootstrap=Debian Base Toolchains -aptsources=Debian Toolchains +aptsources=Debian Toolchains Foo tarballname=pdebuild-cross.tgz [Toolchains] diff --git a/debian/changelog b/debian/changelog index 104d4b5..1ebd9b3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,8 +4,10 @@ multistrap (2.1.4) unstable; urgency=low the chroot - using the dpkg-cross default_arch, if any. * Clarify documentation of bootstrap and aptsources sections (Closes: #579626) + * Clarify error reporting in the --simulate option, warn if + sections are not defined. (Closes: #579627) - -- Neil Williams Wed, 05 May 2010 19:49:22 +0100 + -- Neil Williams Wed, 05 May 2010 20:08:44 +0100 multistrap (2.1.3) experimental; urgency=low diff --git a/multistrap b/multistrap index 4c09712..afd38ed 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 %uniq %required /; + $omitpreinst @reinstall $tgzname %uniq %required $check @check %uniq /; setlocale(LC_MESSAGES, ""); textdomain("multistrap"); @@ -940,6 +940,17 @@ sub _g { sub dump_config { print "Bootstrap: ".join (", ", sort @debootstrap)."\n"; print "Apt sources: ".join (", ", sort @aptsources)."\n"; + @check=(); + %uniq=(); + push @check, @debootstrap; + push @check, @aptsources; + foreach my $sect (@check) { $uniq{$sect}++; } + foreach my $sect (sort keys %uniq) + { + if (not exists $keys{$sect}) { + $msg = sprintf (_g("ERROR: The '%s' section is not defined.\n"), $sect); + } + } print "Includes: ".join (", ", sort @includes)."\n"; print "Sources: ".join (", ", sort values %sources)."\n"; print "Packages: ".join (", ", sort values %packages)."\n"; @@ -958,5 +969,9 @@ sub dump_config { print "tidy_apt: $tidy\n" if (defined $tidy); print "no_authentication: $noauth\n" if (defined $noauth); print "source_dir: $sourcedir\n" if (defined $sourcedir); + if (defined $msg) { + warn ("\n$msg"); + exit 1; + } exit 0; }