From 9c545d4325146de29636746ff6af0250d4698bab Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 18 Jun 2020 00:51:46 +0100 Subject: [PATCH] nailing-cargo: Spot an obvious mistake Signed-off-by: Ian Jackson --- nailing-cargo | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/nailing-cargo b/nailing-cargo index 31eefe7..6511612 100755 --- a/nailing-cargo +++ b/nailing-cargo @@ -710,7 +710,18 @@ sub nailed ($) { } sub install () { + my @our_unfound_stab = stat_exists('Cargo.toml', 'local Cargo.toml') + ? (stat _) : (); foreach my $mf (keys %manifests) { + if (@our_unfound_stab) { + if (stat_exists $mf, "manifest in to-be-nailed directory") { + my @mf_stab = stat _ ; + if ("@mf_stab[0..1]" eq "@our_unfound_stab[0..1]") { + @our_unfound_stab = (); + } + } + } + my $nailing = "$mf.nailing~"; my $nailed = nailed($mf); my ($use, $rm); @@ -733,6 +744,11 @@ sub install () { unlink_or_enoent $rm or die "$self: remove old $rm: $!\n"; print STDERR "$self: nailed $mf\n" if $verbose>=3; } + + if (@our_unfound_stab) { + print STDERR + "$self: *WARNING* cwd is not in Cargo.nail thbough it has Cargo.toml!\n"; + } } sub invoke () { -- 2.30.2