chiark / gitweb /
Provide --clean-linkfarm and --keep-linkfarm, and document oot.clean
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 18:18:57 +0000 (19:18 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 25 Jul 2020 18:18:57 +0000 (19:18 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
README.md
nailing-cargo

index e7a5c52aa6a773d221fab3e2274a3cd83bb67ab6..4798d401bab264dc54ba8b809142942a6529a132 100644 (file)
--- 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
    `<user>@<host>`.
 
+ * `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
 ------------------------------------------
 
index 81e1d4ed02ce52960fc70863be070951472aefd7..294df34695e3b0798dac4d5b64df29cfacf1d3c5 100755 (executable)
@@ -26,8 +26,8 @@ options:
   -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
   --leave-nailed                  Leave the nailed Cargo.toml in place
+  --just-linkfarm | --clean-linkfarm | --keep-linkfarm (default)
 
   -s<subcommand>                  Treat command as `cargo <subcommand>`
   --subcommand-props=<prop>,...   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=}{}) {