From 912d989da9488a8338a45437b28e2bd5556da5c5 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 25 Jul 2020 11:36:53 +0100 Subject: [PATCH] nailing-cargo: Pass $why to read_manifest This will help with error messages. Not used yet. Signed-off-by: Ian Jackson --- nailing-cargo | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/nailing-cargo b/nailing-cargo index 46d5597..87dd033 100755 --- a/nailing-cargo +++ b/nailing-cargo @@ -290,8 +290,8 @@ sub consider_oot () { our %manifests; our %packagemap; -sub read_manifest ($) { - my ($subdir) = @_; +sub read_manifest ($$) { + my ($subdir, $why) = @_; my $manifest = "../$subdir/Cargo.toml"; print STDERR "$self: reading $manifest...\n" if $verbose>=4; if (defined $manifests{$manifest}) { @@ -317,7 +317,7 @@ sub readorigs () { foreach my $p (keys %{ $nail->{packages} }) { my $v = $nail->{packages}{$p}; my $subdir = ref($v) ? $v->{subdir} : $v; - my $gotpackage = read_manifest($subdir) // ''; + my $gotpackage = read_manifest($subdir, "from [packages]") // ''; if ($gotpackage ne $p) { print STDERR "$self: warning: honouring Cargo.nail packages.$subdir=$p even though $subdir contains package $gotpackage!\n"; @@ -326,7 +326,7 @@ sub readorigs () { $packagemap{$p} = $subdir; } foreach my $subdir (@{ $nail->{subdirs} }) { - my $gotpackage = read_manifest($subdir); + my $gotpackage = read_manifest($subdir, "from [subdirs]"); if (!defined $gotpackage) { print STDERR "$self: warning: ignoring subdir $subdir which has no (suitable) Cargo.toml\n"; -- 2.30.2