public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Stoiko Ivanov <s.ivanov@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [pmg-devel] [PATCH pmg-api v2 2/2] d/postinst: move pmg-scores.cf shadow file to new location
Date: Fri,  4 Oct 2024 15:47:02 +0200	[thread overview]
Message-ID: <20241004134702.14522-3-s.ivanov@proxmox.com> (raw)
In-Reply-To: <20241004134702.14522-1-s.ivanov@proxmox.com>

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@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



_______________________________________________
pmg-devel mailing list
pmg-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pmg-devel


      parent reply	other threads:[~2024-10-04 13:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-04 13:47 [pmg-devel] [PATCH pmg-api v2 0/2] sa-custom: move shadow config next to live config Stoiko Ivanov
2024-10-04 13:47 ` [pmg-devel] [PATCH pmg-api v2 1/2] sa-custom: move shadow config to the same directory Stoiko Ivanov
2024-10-04 13:47 ` Stoiko Ivanov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241004134702.14522-3-s.ivanov@proxmox.com \
    --to=s.ivanov@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal