lcollect - remove obsolete files and dirs
lcollect [OPTION]... [FILE]...
While open-lmake is used and the repo evolves, new files are generated and some files become obsolete. But these obsolete files are not removed from disk and after a while, this may occupy a substantial disk space. lcollect can be used to remove all such files.
Files ignored as specified in lmake.config.collect are kept, though. This is particularly useful if files are generated with the ignore flag, in which case open-lmake does not see they have been generated and lcollect would consider them as foreign files to be quarantined.
lcollect is harmless: only files generated by open-lmake are removed. If a file is determined as useless but it is not sure that it was generated by an old job, it is quarantined (i.e. it is moved to the LMAKE/quarantine dir) instead of being removed. It is is then easy to execute rm -rf LMAKE/quarantine if such a backup is not desirable.
lcollect manages a fully coherent dir called a repo. When it starts, it first determines the root of the repo (cf. FILES below).
Arguments and reports are systematically localized to the current working dir. For example, if you launch lcollect b from dir a in your repo, the argument is file a/b from the root of the repo and reports containing file names (initially seen from the root of the repo) will be shown relative the the current working dir.
These options
are common to all tools of the open-lmake set of
utilities :
--version
Print version and exit. Version is in the form "year.month.tag (key)" where "year.month" forms the major version, "tag" the minor version and "key" is indicates the format of the persistent information.
-h, --help
Print a short help and exit. It is composed of:
• |
The command line synoptic. | ||
• |
Version as described above. | ||
• |
A line for each supported option with its short name, long name, whether it has an argument and a short explanation. |
-q, --quiet
Do not generate user oriented messages. Strictly generate what is asked. This is practical if output is meant for automatic processing.
-S, --sync
Ensure server is launched (i.e. do not connect to an existing server) and wait for its termination. This is exceptionally useful in scripts that modify Lmakefile.py.
-v, --verbose
Generate more prolix output.
-V mode, --video=mode
Explicitly ask for a video mode instead of interrogating connected terminal. If mode starts with n or N, normal video (black on white) is assumed. If it starts with r or R, reverse video (white on black) is assumed. Else output is not colorized. video mode has an impact on generated colors as nice looking colors are not the same in each case.
These options
are specific to lcollect :
-n, --dry-run
report only, dont actually execute actions.
The files Lmakefile.py or Lmakefile/__init__.py are searched in the current dir and in parent dirs. If a single one is found, this determines the root of the repo. If several are found, the existence of an LMAKE dir is checked. If a single one is found, this determines the root of the repo. In other cases, lcollect will not start.
lcollect does not prune open-lmake internal book-keeping data. Use lrepair(1) for that.
lautodep(1), lcheck_deps(1), ldebug(1), ldecode(1), ldepend(1), ldircache_repair(1), lencode(1), lforget(1), lmake(1), lmark(1), lrepair(1), lrun_cc(1), lshow(1), ltarget(1), xxhsum(1)
The python module lmake.
The full open-lmake documentation in <open-lmake-installation-dir>/docs/index.html.
Copyright © 2023-2025, Doliam. This file is part of open-lmake.
open-lmake is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 3 of the License.
open-lmake is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.