summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Németh <homar@riseup.net>2023-12-15 12:57:54 +0100
committerGábor Németh <homar@riseup.net>2023-12-15 12:57:54 +0100
commitb3a430029360800e1b2cb6dfc385c5182f74fcb8 (patch)
treecfe4b67cd4fadcc1cdfe4c4f7b0ab67db926309d
parent6c5384e10aea6585c602cb8fca8c9eea8ff16ba5 (diff)
Test and document 'dist-clean'
-rw-r--r--doc/apt-get.8.xml8
-rwxr-xr-xtest/integration/test-apt-get-clean9
2 files changed, 16 insertions, 1 deletions
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;
<!-- The last update date -->
- <date>2023-07-20T00:00:00Z</date>
+ <date>2023-12-15T00:00:00Z</date>
</refentryinfo>
<refmeta>
@@ -250,6 +250,12 @@
erased if it is set to off.</para></listitem>
</varlistentry>
+ <varlistentry><term><option>distclean</option> (and the <option>dist-clean</option> alias)</term>
+ <listitem><para>Like <literal>clean</literal>, <literal>distclean</literal> clears out the local
+ repository of retrieved package files, plus all list files except Release,
+ Release.gpg, and InRelease.</para></listitem>
+ </varlistentry>
+
<varlistentry><term><option>autoremove</option> (and the <option>auto-remove</option> alias since 1.1)</term>
<listitem><para><literal>autoremove</literal> is used to remove packages that were automatically
installed to satisfy dependencies for other packages and are now no longer needed.</para></listitem>
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