DEBCLEAN(1)

πŸ“¦
version 2.26.11ubuntu1 Β· 2 versions
, in fedora 43, fedora 44, ubuntu resolute, ubuntu stonking

πŸ¦‹ 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 for debian/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, .changes and .build files from the parent directory 🧹
  • --nocleandebs β€” do not remove the .deb, .changes and .build files 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 run dpkg-checkbuilddeps to 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 to yes, then it is the same as the --cleandebs command 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 in devscripts.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