From c39f14401355954a0c5d01b7a2a0a655ee06a993 Mon Sep 17 00:00:00 2001
From: "Marc G. Fournier" <scrappy@FreeBSD.org>
Date: Sat, 15 Apr 2006 16:23:50 +0000
Subject: After a recent discussion on freebsd-ports, I have modified the Horde
 ports, so that they now do not overwrite existing configuration files. Rather
 than backing up the old ones and allowing the user to merge the files by
 hand, config files are left untouched.

Submitted by:   Shaun Amott <shaun@inerd.com>
---
 mail/imp/files/pkg-deinstall.in | 10 +++-------
 mail/imp/files/pkg-install.in   | 23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+), 7 deletions(-)
 create mode 100644 mail/imp/files/pkg-install.in

(limited to 'mail/imp')

diff --git a/mail/imp/files/pkg-deinstall.in b/mail/imp/files/pkg-deinstall.in
index 13bb805c47d5..e4787a72dfe4 100644
--- a/mail/imp/files/pkg-deinstall.in
+++ b/mail/imp/files/pkg-deinstall.in
@@ -2,7 +2,6 @@
 #
 # $FreeBSD$
 #
-# Backup IMP config files, if needed.
 
 if [ x$2 != xDEINSTALL ]; then
     exit
@@ -12,13 +11,10 @@ if [ -z "${PACKAGE_BUILDING}" ]; then
   for cf in `ls %%IMPDIR%%/config/*php %%IMPDIR%%/config/*txt`; do
     diff -bBqw $cf $cf.dist >/dev/null 2>&1
     case $? in
-      0)  # original config file, will be deleted by pkg-plist
+      0)  # original config file, delete it
+          rm -f $cf
           ;;
-      1)  # config file has been updated, must be backuped
-          cp -p $cf $cf.previous
-          echo "===> Backing-up..."
-          echo "--->   $cf has been saved ***"
-          echo "--->      as $cf.previous ***"
+      1)  # config file has been updated, leave it alone
           ;;
       *)  # not found?
           ;;
diff --git a/mail/imp/files/pkg-install.in b/mail/imp/files/pkg-install.in
new file mode 100644
index 000000000000..7a19b9e2b9de
--- /dev/null
+++ b/mail/imp/files/pkg-install.in
@@ -0,0 +1,23 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/usr/sbin:/usr/bin:/bin ; export PATH
+
+case $2 in
+    PRE-INSTALL)
+    ;;
+
+    POST-INSTALL)
+        if [ -z "${PACKAGE_BUILDING}" ]; then
+            # Copy over sample config files unless they already exist
+
+            for cf in `ls %%IMPDIR%%/config/*.dist | sed -e 's/\.dist//g'`; do
+                if [ ! -f $cf ]; then
+                    cp -p $cf.dist $cf
+                fi
+            done
+        fi
+    ;;
+esac
-- 
cgit v1.2.3