From f2a7bfaf390094b2c0ac9472c4589aebcdca2f64 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 25 Jul 2020 19:18:57 +0100 Subject: [PATCH] Provide --clean-linkfarm and --keep-linkfarm, and document oot.clean Signed-off-by: Ian Jackson --- README.md | 12 +++++++++++- nailing-cargo | 4 +++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e7a5c52..4798d40 100644 --- a/README.md +++ b/README.md @@ -365,7 +365,12 @@ Options * `--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`. + try to copy back a a generated `Cargo.lock`. Forces + `--keep-linkfarm` (even if the contrary is also specified). + + * `--keep-linkfarm` | `--clean-linkfarm`: When doing an out-of-tree + lockfile update, controls whether the linkfarm is kept afterwards. + Overrides the `oot.clean` config option. (Default: keep.) * `--leave-nailed`: At the end, leave all the `Cargo.toml` files in their edited state, rather than (trying to) clean them up. To @@ -541,6 +546,11 @@ To control use of alternative `Cargo.lock` filename, use the section be just the local username (meaning `@localhost`), or `@`. + * `clean` (boolean): When doing a `Cargo.lock` update, which involves + linkfarming in the build directory, whether the clean up the + linkfarm afterwards. Default: `true`. Can be overridden by + `--keep-linkfarm` or `--clean-linkfarm`. + `[arch]`: Architecture convenience aliases ------------------------------------------ diff --git a/nailing-cargo b/nailing-cargo index 81e1d4e..294df34 100755 --- a/nailing-cargo +++ b/nailing-cargo @@ -26,8 +26,8 @@ options: -T --target= 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 --leave-nailed Leave the nailed Cargo.toml in place + --just-linkfarm | --clean-linkfarm | --keep-linkfarm (default) -s Treat command as `cargo ` --subcommand-props=,... Override command props (see docs) @@ -932,6 +932,8 @@ sub parse_args () { } elsif (m{^--just-linkfarm$}) { $just_linkfarm = 1; $cargo_lock_update= 1; + } elsif (m{^--(clean|keep)-linkfarm$}) { + $oot_clean = $1 eq 'clean'; } elsif (m{^--leave-nailed$}) { $leave_nailed = 1; } elsif (s{^--subcommand-props=}{}) { -- 2.30.2