After clamav is updated, the signature files need to be
re-downloaded. This is often unnecessary and delays restarting
clamd, squidclamav and other dependent services.
This takes a long time on slow internet connection and transfers
about 110MB of data.
This change will backup these files and freshclam will update
or re-download them only if necessary.
Reported-by: Daniel Weismüller <daniel.weismueller(a)ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer(a)ipfire.org>
Cc: Arne Fitzenreiter <arne.fitzenreiter(a)ipfire.org>
---
config/backup/includes/clamav | 2 ++
lfs/clamav | 2 +-
src/paks/clamav/install.sh | 1 +
src/paks/clamav/uninstall.sh | 2 ++
4 files changed, 6 insertions(+), 1 deletion(-)
create mode 100644 config/backup/includes/clamav
diff --git a/config/backup/includes/clamav b/config/backup/includes/clamav
new file mode 100644
index 000000000000..435d5912463c
--- /dev/null
+++ b/config/backup/includes/clamav
@@ -0,0 +1,2 @@
+/usr/share/clamav/*.cvd
+/usr/share/clamav/mirrors.dat
diff --git a/lfs/clamav b/lfs/clamav
index 3c778c3c326e..3794b33cdd7f 100644
--- a/lfs/clamav
+++ b/lfs/clamav
@@ -32,7 +32,7 @@ DL_FROM = $(URL_IPFIRE)
DIR_APP = $(DIR_SRC)/$(THISAPP)
TARGET = $(DIR_INFO)/$(THISAPP)
PROG = clamav
-PAK_VER = 31
+PAK_VER = 32
DEPS = ""
diff --git a/src/paks/clamav/install.sh b/src/paks/clamav/install.sh
index 3b7610cd42c1..02dbd5cc9858 100644
--- a/src/paks/clamav/install.sh
+++ b/src/paks/clamav/install.sh
@@ -23,4 +23,5 @@
#
. /opt/pakfire/lib/functions.sh
extract_files
+restore_backup ${NAME}
/usr/local/bin/clamavctrl enable &
diff --git a/src/paks/clamav/uninstall.sh b/src/paks/clamav/uninstall.sh
index db0999f30acf..b0d2722f55d1 100644
--- a/src/paks/clamav/uninstall.sh
+++ b/src/paks/clamav/uninstall.sh
@@ -23,4 +23,6 @@
#
. /opt/pakfire/lib/functions.sh
/usr/local/bin/clamavctrl disable
+extract_backup_includes
+make_backup ${NAME}
remove_files
--
2.5.5