From b3a430029360800e1b2cb6dfc385c5182f74fcb8 Mon Sep 17 00:00:00 2001 From: Gábor Németh Date: Fri, 15 Dec 2023 12:57:54 +0100 Subject: Test and document 'dist-clean' --- doc/apt-get.8.xml | 8 +++++++- test/integration/test-apt-get-clean | 9 +++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/apt-get.8.xml b/doc/apt-get.8.xml index bb7678e34..0e5092f57 100644 --- a/doc/apt-get.8.xml +++ b/doc/apt-get.8.xml @@ -14,7 +14,7 @@ &apt-email; &apt-product; - 2023-07-20T00:00:00Z + 2023-12-15T00:00:00Z @@ -250,6 +250,12 @@ erased if it is set to off. + (and the alias) + Like clean, distclean clears out the local + repository of retrieved package files, plus all list files except Release, + Release.gpg, and InRelease. + + (and the alias since 1.1) autoremove is used to remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed. diff --git a/test/integration/test-apt-get-clean b/test/integration/test-apt-get-clean index d05073218..24db45d43 100755 --- a/test/integration/test-apt-get-clean +++ b/test/integration/test-apt-get-clean @@ -24,6 +24,9 @@ testsuccess aptget clean -s # generate some dirt and clean it up generatedirt() { touch rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en + touch rootdir/var/lib/apt/lists/deb.debian.org_debian_dists_sid_InRelease + touch rootdir/var/lib/apt/lists/deb.debian.org_debian_dists_sid_main_binary-amd64_Packages + touch rootdir/var/lib/apt/lists/deb.debian.org_debian_dists_sid_main_binary-amd64_Packages.diff_Index mkdir -p rootdir/var/cache/apt/archives/lost+found touch rootdir/var/cache/apt/archives/foo_1_all.deb touch rootdir/var/cache/apt/archives/foo_1%3a1_all.deb @@ -53,6 +56,12 @@ testfailure test -e rootdir/var/cache/apt/archives/foo_2_all.deb testfailure test -e rootdir/var/cache/apt/archives/foo_3_all.deb testfailure test -e rootdir/var/cache/apt/archives/foo_4_all.deb +generatedirt +testsuccess aptget distclean +testsuccess test -e rootdir/var/lib/apt/lists/deb.debian.org_debian_dists_sid_InRelease +testfailure test -e rootdir/var/lib/apt/lists/deb.debian.org_debian_dists_sid_main_binary-amd64_Packages +testfailure test -e rootdir/var/lib/apt/lists/deb.debian.org_debian_dists_sid_main_binary-amd64_Packages.diff_Index + if [ "$(id -u)" != '0' ]; then msgmsg 'No clean if lock can not be acquired' touch rootdir/var/cache/apt/archives/foo_4_all.deb -- cgit v1.2.3-70-g09d2