summaryrefslogtreecommitdiff
path: root/share
diff options
context:
space:
mode:
authorSascha Roloff <sascha.roloff@huawei.com>2022-12-23 15:03:04 +0100
committerKlaus Aehlig <klaus.aehlig@huawei.com>2023-01-20 15:47:43 +0100
commit5129bc284cf2372bfbc87b00d3b9bd1117734c43 (patch)
tree0a9b36478fab08ff55dd854e45f6e262931e2e1b /share
parent0db0064273920c835342dd168f8213b6a567e8c9 (diff)
downloadjustbuild-5129bc284cf2372bfbc87b00d3b9bd1117734c43.tar.gz
Add gc subcommand
Diffstat (limited to 'share')
-rw-r--r--share/just_complete.bash10
-rw-r--r--share/man/just-mr.1.org2
-rw-r--r--share/man/just.1.org16
3 files changed, 18 insertions, 10 deletions
diff --git a/share/just_complete.bash b/share/just_complete.bash
index a45ca7c7..1ada0d1d 100644
--- a/share/just_complete.bash
+++ b/share/just_complete.bash
@@ -78,7 +78,7 @@ EOF
}
_just_completion(){
- local readonly SUBCOMMANDS=(build analyse describe install-cas install rebuild -h --help version)
+ local readonly SUBCOMMANDS=(build analyse describe install-cas install rebuild gc -h --help version)
local word=${COMP_WORDS[$COMP_CWORD]}
local prev=${COMP_WORDS[$((COMP_CWORD-1))]}
local cmd=${COMP_WORDS[1]}
@@ -86,7 +86,7 @@ _just_completion(){
local conf
# first check if the current word matches a subcommand
# if we check directly with cmd, we fail to autocomplete install to install-cas
- if [[ $word =~ ^(build|analyse|describe|install-cas|install|rebuild) ]]
+ if [[ $word =~ ^(build|analyse|describe|install-cas|install|rebuild|gc) ]]
then
COMPREPLY=($(compgen -W "${SUBCOMMANDS[*]}" -- $word))
elif [[ $cmd =~ ^(install-cas) ]]
@@ -94,7 +94,7 @@ _just_completion(){
local _opts=($(_just_subcommand_options $cmd))
COMPREPLY=($(compgen -f -W "${_opts[*]}" -- $word ))
compopt -o plusdirs -o bashdefault -o default
- elif [[ $cmd =~ ^(build|analyse|describe|install|rebuild) ]]
+ elif [[ $cmd =~ ^(build|analyse|describe|install|rebuild|gc) ]]
then
local _opts=($(_just_subcommand_options $cmd))
# look for -C and --main
@@ -162,7 +162,7 @@ EOF
}
_just-mr_completion(){
- local readonly SUBCOMMANDS=(setup setup-env fetch update "do" version build analyse describe install-cas install rebuild)
+ local readonly SUBCOMMANDS=(setup setup-env fetch update "do" version build analyse describe install-cas install rebuild gc)
local word=${COMP_WORDS[$COMP_CWORD]}
local prev=${COMP_WORDS[$((COMP_CWORD-1))]}
local cmd=$(_just-mr_parse_subcommand "${COMP_WORDS[@]}")
@@ -184,7 +184,7 @@ _just-mr_completion(){
local _opts=($(_just-mr_options "just-mr $cmd"))
local _repos=($(_just-mr_repos $prev))
COMPREPLY=($(compgen -f -W "${_opts[*]} ${_repos[*]}" -- $word ))
- elif [[ "$cmd" =~ ^(version|build|analyse|describe|install-cas|install|rebuild) ]]
+ elif [[ "$cmd" =~ ^(version|build|analyse|describe|install-cas|install|rebuild|gc) ]]
then
# just subcommand options and modules/targets eventually using the
# auto-generated configuration
diff --git a/share/man/just-mr.1.org b/share/man/just-mr.1.org
index 9e8e6bbe..2292943a 100644
--- a/share/man/just-mr.1.org
+++ b/share/man/just-mr.1.org
@@ -148,7 +148,7 @@ be provided in the configuration or on the command line. If no main repository
is provided, the lexicographical first repository from the configuration is
used.
-** version|describe|analyse|build|install|install-cas|rebuild
+** version|describe|analyse|build|install|install-cas|rebuild|gc
This subcommand is the explicit way of specifying /known/ just subcommands and
calling ~just~ via *execvp(2)*. The same description as for the ~do~ subcommand
diff --git a/share/man/just.1.org b/share/man/just.1.org
index c79c73e1..a2d7260f 100644
--- a/share/man/just.1.org
+++ b/share/man/just.1.org
@@ -13,7 +13,8 @@ just install -o <OUTPUT_DIR> [OPTIONS] [[module] target]\\
just install-cas [OPTIONS] <OBJECT_ID>\\
just describe [OPTIONS] [[module] target]\\
just rebuild [OPTIONS] [[module] target]\\
-just traverse -g <GRAPH_FILE> -o <OUT_DIR> [OPTIONS]
+just traverse -g <GRAPH_FILE> -o <OUT_DIR> [OPTIONS]\\
+just gc [OPTIONS]
* DESCRIPTION
@@ -237,6 +238,15 @@ the artifact is a tree, it will cause an error.
It allows for the building and staging of requested artifacts from a
well-defined graph file. See *just-graph-file(5)* for more details.
+** gc
+
+The *gc* subcommand triggers garbage collection of the local cache.
+More precisely, it rotates the cache and CAS generations. During
+a build, upon cache hit, everything related to that cache hit is
+uplinked to the youngest generation; therefore, upon a call to ~gc~
+everything not referenced since the last call to ~gc~ is purged
+and the corresponding disk space reclaimed.
+
* OPTIONS
** Generic program information
@@ -311,7 +321,7 @@ well-defined graph file. See *just-graph-file(5)* for more details.
*--local-build-root* PATH\\
Root for local CAS, cache, and build directories. The path will be
created if it does not exist already.\\
- Supported by: build|install-cas|install|rebuild|traverse.
+ Supported by: build|install-cas|install|rebuild|traverse|gc.
*--main* NAME\\
The repository to take the target from.\\
@@ -525,8 +535,6 @@ well-defined graph file. See *just-graph-file(5)* for more details.
corresponding artifact map, which maps the path to the artifact
description.
-** *install-cas* specific options
-
** *rebuild* specific options
*--vs* NAME:PORT|"local"\\