DEBCLEAN(1)
π¦ debclean(1) π¦
okay bestie, welcome to the General Commands Manual page for debclean β yes that's the manual name, section 1, we're doing this π
β¨ NAME β¨
debclean β clean up a sourcecode tree. that's it. that's the whole job. she's a cleaner and she's iconic for it π§Ήβ¨
πΈ SYNOPSIS πΈ
debclean [options]
that's it. that's the whole vibe. options only, no positional args, no drama π«Ά
π DESCRIPTION π
so here's the tea β β debclean walks through the directory tree starting at the directory tree it was invoked in (yes, in which it was invoked, we're being precise, it's giving main character energy), and for each Debian source directory it encounters, it runs debuild -- clean.
how does she know a directory is a Debian source directory? she recognises them by them containing a debian/changelog file for a package whose name matches that of the directory. the name matching situation is described below, don't worry, we get there π
π¨ lowkey important: if debclean is invoked from a directory that is already a Debian source package, she will not descend into its subdirectories. periodt.
also!! if the --cleandebs option is given, then in every directory containing a Debian source tree, all files named *.deb, *.changes and *.build are removed π₯
but listen β the .dsc, .diff.gz and the (.orig).tar.gz files are not touched, so that the release can be reconstructed if necessary π«Ά and the .upload files are left alone so that debchange functions correctly. she's thoughtful like that.
the --nocleandebs option prevents this extra cleaning behaviour and the --cleandebs option forces it. and the default? the default is not to clean these files. no cap.
debclean uses debuild(1) to clean the source tree. shoutout to her collaborator π€
π§ Directory name checking π§
in common with several other scripts in the devscripts package, debclean will walk through the directory tree searching for debian/changelog files π
and as a safeguard against stray files causing potential problems, once she finds a debian/changelog file she will examine the name of the parent directory and check that the directory name corresponds to the package name. safety first, bestie π‘οΈ
precisely how she does this is controlled by two configuration file variables β DEVSCRIPTS_CHECK_DIRNAME_LEVEL and DEVSCRIPTS_CHECK_DIRNAME_REGEX β and their corresponding command-line options --check-dirname-level and --check-dirname-regex.
DEVSCRIPTS_CHECK_DIRNAME_LEVEL can take the following values:
0β never check the directory name. living dangerously, we love that for you π1β only check the directory name if we have had to change directory in our search fordebian/changelog. this is the default behaviour. β¨2β always check the directory name. strict queen π
the directory name is checked by testing whether the current directory name (as determined by pwd(1)) matches the regex given by the configuration file option DEVSCRIPTS_CHECK_DIRNAME_REGEX or by the command line option --check-dirname-regex regex.
here regex is a Perl regex (see perlre(3perl)), which will be anchored at the beginning and the end π
- if regex contains a
/, then it must match the full directory path. - if not, then it must match the full directory name.
- if regex contains the string
'PACKAGE', this will be replaced by the source package name, as determined from the changelog π
the default value for the regex is:
'PACKAGE(-.+)?'
thus matching directory names such as PACKAGE and PACKAGE-version β¨
π OPTIONS π
--cleandebsβ also remove all.deb,.changesand.buildfiles from the parent directory π§Ή--nocleandebsβ do not remove the.deb,.changesand.buildfiles from the parent directory; this is the default behaviour π«Ά--check-dirname-level Nβ see the above section Directory name checking for an explanation of this option π--check-dirname-regex regexβ see the above section Directory name checking for an explanation of this option π--no-conf,--noconfβ do not read any configuration files. β οΈ this can only be used as the first option given on the command-line. first or it doesn't count, bestie.-dβ do not rundpkg-checkbuilddepsto check build dependencies.--helpβ display a help message and exit successfully π₯°--versionβ display version and copyright information and exit successfully π₯°
π CONFIGURATION VARIABLES π
the two configuration files /etc/devscripts.conf and ~/.devscripts are sourced in that order to set configuration variables. command line options can be used to override configuration file settings. β οΈ environment variable settings are ignored for this purpose.
the currently recognised variables are:
DEBCLEAN_CLEANDEBSβ if this is set toyes, then it is the same as the--cleandebscommand line parameter being used β¨DEVSCRIPTS_CHECK_DIRNAME_LEVEL,DEVSCRIPTS_CHECK_DIRNAME_REGEXβ see the above section Directory name checking for an explanation of these variables. π note that these are package-wide configuration variables, and will therefore affect all devscripts scripts which check their value, as described in their respective manpages and indevscripts.conf(5). so like, she's not just your queen, she's everyone's queen π
π SEE ALSO π
debuild(1), devscripts.conf(5)
π AUTHOR π
Christoph Lameter <clameter@debian.org>; modifications by Julian Gilbey <jdg@debian.org>.
and that's the whole page, bestie π this came out of the DEBIAN corner of things, filed under Debian Utilities, stamped with the name DEBCLEAN(1) at the top and bottom. go clean something, you ate π¦β¨π
π¦ where this page comes from
- fedora 43: devscripts 2.25.33-1.fc43 Β· GPL-2.0-or-later
- fedora 44: devscripts 2.26.5-1.fc44 Β· GPL-2.0-or-later
- ubuntu resolute: devscripts 2.26.7 Β· GPL-2.0-or-later
- ubuntu stonking: devscripts 2.26.11ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms