Bug#485122: apt-daily: autoclean before download
Control: tag -1 patch
Hi,
Attached patch should do it.
Cheers,
--
Raphael Geissert - Debian Developer
www.debian.org - get.debian.net
From 7651701920fbd4994249f7d3f25553b45e70bd69 Mon Sep 17 00:00:00 2001
From: Raphael Geissert <geissert@debian.org>
Date: Fri, 16 Sep 2016 14:34:13 +0200
Subject: [PATCH 1/2] apt.systemd.daily: do an autoclean before downloading new packages
Potentially freeing disk space by deleting files that are no longer
useful makes more sense before downloading new ones.
Closes #485122
---
debian/apt.systemd.daily | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/debian/apt.systemd.daily b/debian/apt.systemd.daily
index d034d8c..a952954 100755
--- a/debian/apt.systemd.daily
+++ b/debian/apt.systemd.daily
@@ -417,6 +417,19 @@ if check_stamp $UPDATE_STAMP $UpdateInterval; then
else
debug_echo "download updated metadata (not run)."
fi
+
+# autoclean package archive
+AUTOCLEAN_STAMP=/var/lib/apt/periodic/autoclean-stamp
+if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then
+ if eval apt-get $XAPTOPT -y autoclean $XSTDERR; then
+ debug_echo "autoclean (success)."
+ update_stamp $AUTOCLEAN_STAMP
+ else
+ debug_echo "autoclean (error)"
+ fi
+else
+ debug_echo "autoclean (not run)"
+fi
# download all upgradeable packages (if it is requested)
DOWNLOAD_UPGRADEABLE_STAMP=/var/lib/apt/periodic/download-upgradeable-stamp
@@ -460,19 +473,6 @@ else
debug_echo "clean (not run)"
fi
-# autoclean package archive
-AUTOCLEAN_STAMP=/var/lib/apt/periodic/autoclean-stamp
-if check_stamp $AUTOCLEAN_STAMP $AutocleanInterval; then
- if eval apt-get $XAPTOPT -y autoclean $XSTDERR; then
- debug_echo "autoclean (success)."
- update_stamp $AUTOCLEAN_STAMP
- else
- debug_echo "autoclean (error)"
- fi
-else
- debug_echo "autoclean (not run)"
-fi
-
# check cache size
check_size_constraints
--
1.7.2.5
Reply to: