--leave-nailed Leave the nailed Cargo.toml in place
--just-linkfarm | --clean-linkfarm | --keep-linkfarm (default)
--no-nail Do not nail, just run the command.
- --no-lock Do not take the lock.
+ --no-cargo-lock-manip Do not manipulate Cargo.lock.
+ --no-lock Do not take the concurrency lock.
-s<subcommand> Treat command as `cargo <subcommand>`
--subcommand-props=<prop>,... Override command props (see docs)
our $leave_nailed;
our $oot_clean;
our $do_nail=1;
+our $do_cargo_lock=1;
our $do_lock=1;
#
# User should *either* have Cargo.lock in .gitignore,
# or expect to commit Cargo.lock.example ($alt_cargo_lock)
+ return unless $do_cargo_lock;
+
$alt_cargo_lock = (cfg_uc @ck);
my $force = 0;
clean () { find -lname "$1/*" -print0 | xargs -0r rm --; }; clean;
find "$1" -maxdepth 1 \! -name Cargo.lock -print0 | xargs -0r -I_ ln -sf -- _ .;
END
- $pre .= <<'ENDLK' if stat_exists 'Cargo.lock', 'working cargo lockfile';
+ $pre .= <<'ENDLK' if $do_cargo_lock && stat_exists 'Cargo.lock', 'working cargo lockfile';
rm -f Cargo.lock;
cp -- "$1"/Cargo.lock .;
ENDLK
}
if (defined($alt_cargo_lock)) {
+ die 'internal error' unless $do_cargo_lock;
if (@alt_cargo_lock_stat) {
print STDERR "$self: using alt_cargo_lock `$alt_cargo_lock'..."
if $verbose>=3;
}
sub cargo_lock_update_after () {
- if ($cargo_lock_update && !$just_linkfarm) {
+ if ($do_cargo_lock && $cargo_lock_update && !$just_linkfarm) {
# avoids importing File::Copy and the error handling is about as good
$!=0; $?=0;
my $r= system qw(cp --), "$build_absdir/Cargo.lock", "Cargo.lock";
sub unaltcargolock ($) {
my ($enoentok) = @_;
return unless $cleanup_cargo_lock;
- die 'internal error!' unless defined $alt_cargo_lock;
+ die 'internal error!' unless $do_cargo_lock && defined $alt_cargo_lock;
# we ignore $enoentok because we don't know if one was supposed to
# have been created.
$oot_clean = $1 eq 'clean';
} elsif (m{^--(no)?-nail$}) {
$do_nail = !$1;
+ } elsif (m{^--(no)?-cargo-lock-manip$}) {
+ $do_cargo_lock = !$1;
} elsif (m{^--(no)?-lock$}) {
$do_lock = !$1;
} elsif (m{^--leave-nailed$}) {