From f0895d7c5bf73ae833565d44f01467af99f12433 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 25 Jul 2020 16:57:52 +0100 Subject: [PATCH] nailing-cargo: Pass $org_subdir to read_manifest Currently this is just $subdir. But we are going to recursively chase down workspaces and path dependencies, and we want to know where they came from so we can check the paths for sanity. No functional change 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 db1d49b..d18e3ad 100755 --- a/nailing-cargo +++ b/nailing-cargo @@ -290,8 +290,8 @@ sub consider_oot () { our %manifests; our %packagemap; -sub read_manifest ($$) { - my ($subdir, $why) = @_; +sub read_manifest ($$$) { + my ($subdir, $org_subdir, $why) = @_; my $manifest = "../$subdir/Cargo.toml"; print STDERR "$self: reading $manifest...\n" if $verbose>=4; if (defined $manifests{$manifest}) { @@ -318,7 +318,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, "from [packages]") // ''; + my $gotpackage = read_manifest($subdir, $subdir, "from [packages]") // ''; if ($gotpackage ne $p) { print STDERR "$self: warning: honouring Cargo.nail packages.$subdir=$p even though $subdir contains package $gotpackage!\n"; @@ -327,7 +327,7 @@ sub readorigs () { $packagemap{$p} = $subdir; } foreach my $subdir (@{ $nail->{subdirs} }) { - my $gotpackage = read_manifest($subdir, "from [subdirs]"); + my $gotpackage = read_manifest($subdir, $subdir, "from [subdirs]"); if (!defined $gotpackage) { print STDERR "$self: warning: ignoring subdir $subdir which has no (suitable) Cargo.toml\n"; -- 2.30.2