chiark / gitweb /
nailing-cargo: Do not pass --target= to commands which reject it
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 11 May 2020 00:28:38 +0000 (01:28 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 11 May 2020 00:28:38 +0000 (01:28 +0100)
These are just the commands I know right now to reject it.  This list
may well need to be expanded.

It may later become necessary to have two ifs, if the set of
Cargo.lock updating commands, and the set of --target= rejecting ones,
are not the same.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
nailing-cargo

index 529066b6f4c838634b8028afb3d3125af2dbf158..f9d766b186eff3f14ec64b0bc013030a7e65e6e7 100755 (executable)
@@ -379,8 +379,9 @@ sub calculate () {
 sub addargs () {
   if (@ARGV>=2 &&
       $ARGV[0] =~ m{\bcargo\b} &&
-      $ARGV[1] =~ m/generate-lockfile|update/) {
+      $ARGV[1] =~ m/^(?:generate-lockfile|update)$/) {
     $cargo_lock_update //= 1;
+    $target = undef;
   } else {
     $cargo_lock_update //= 0;
   }