[pmg-devel] [PATCH pmg-api v2 2/2] d/postinst: move pmg-scores.cf shadow file to new location

Stoiko Ivanov s.ivanov at proxmox.com
Fri Oct 4 15:47:02 CEST 2024


not guarding for install-mode, as the file will not exist on a fresh
install (and we need to do the stat(2) for it anyways).

did not add `|| true` to the `mv` invocation, as moving a file failing
probably warrants apt to error out.

Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
---
 debian/postinst | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/debian/postinst b/debian/postinst
index 770c944..6097f1a 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -125,6 +125,17 @@ case "$1" in
                 migrate_apt_auth_conf
             fi
         fi
+
+        old_score_location=/var/cache/pmg-scores.cf
+        new_score_location=/etc/mail/spamassassin/pmg-scores.cf.new
+        if test -e "$old_score_location"; then
+            if ! test -e "$new_score_location"; then
+                echo "moving $old_score_location to $new_score_location"
+                mv "$old_score_location" "$new_score_location"
+            else
+                echo "both $old_score_location and $new_score_location exist - please review manually"
+            fi
+        fi
     ;;
 
     abort-upgrade)
-- 
2.39.5





More information about the pmg-devel mailing list