* `!locked`: cargo would reject `--locked`, so don't pass it. Hazardous.
* `!offline`: the build command would reject `--offline`, so never pass it. *Not* overridden by configuration or command line.
+ * `--just-linkfarm`: Make the out-of-tree linkfarm as if for
+ `--cargo-lock-update`, but do not actually run any command, nor
+ try to copy back a a generated `Cargo.lock`.
+
* `-h` | `--help`: Print usage summary.
* `--man` | `--manual`: Format this manual into html using `pandoc`
-T<arch> --target=<arch> Specify target architecture
-h --help Print this message
--man --manual Display complete manual (in w3m)
+ --just-linkfarm Make the linkfarm as for -u, then stop
-s<subcommand> Treat command as `cargo <subcommand>`
--subcommand-props=<prop>,... Override command props (see docs)
our $cargo_lock_update;
our $pass_options;
our $online;
+our $just_linkfarm;
#
our %subcmd_props = (
}
sub addargs () {
+ if ($just_linkfarm) {
+ die "$self: --just-linkfarm but not doing out-of-tree builds!\n"
+ unless defined $oot_dir;
+ @ARGV = ();
+ return;
+ }
+
if (!defined $online) {
$_ = cfg_uc qw(misc online);
if (!defined $_) {
}
sub cargo_lock_update_after () {
- if ($cargo_lock_update) {
+ if ($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";
OPTS: for (;;) {
if (!@ARGV) {
- die "$self: need cargo subcommand\n" unless $noact;
+ die "$self: need cargo subcommand\n"
+ unless $noact || $just_linkfarm;;
push @ARGV, "CARGO-SUBCOMMAND"; # dummy, user may see it
}
$target = $_;
} elsif (m{^--(on|off)line$}) {
$online = $1 eq 'on';
+ } elsif (m{^--just-linkfarm$}) {
+ $just_linkfarm = 1;
+ $cargo_lock_update= 1;
} elsif (s{^--subcommand-props=}{}) {
my @props = split /\,/, $_;
our %subcmd_prop_ok;