[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] LibreOffice packaging repository branch, master, updated. ae161aa34866c5490b1c49b9ea78dd2fea0d1e4f



The following commit has been merged in the master branch:
commit cd1db6bff49d61c650675d826491f6eaaee04bae
Author: Rene Engelhard <rene@debian.org>
Date:   Mon Mar 21 22:42:36 2011 +0000

    remove hardcoded rm_conffile. use dpkg-maintscript-helper and move psprint.conf, sofficerc and soffice.sh (closes: #619113)

diff --git a/changelog b/changelog
index 00a2368..c15d701 100644
--- a/changelog
+++ b/changelog
@@ -3,6 +3,11 @@ libreoffice (1:3.3.2~rc2-2) UNRELEASED; urgency=low
   * debian/rules:
     - move dh_link before dh_python2 as dh_python2 gets confused by symlinks
       before dh_link fixed them up
+    - don't add shell-lib-conffiles.sh to maintscripts anymore
+  * debian/libreoffice-common.p*.in:
+    - remove hardcoded rm_conffile. use dpkg-maintscript-helper
+    - move psprint.conf, sofficerc and soffice.sh (closes: #619113)
+  * debian/shell-lib-conffiles.sh: remove
 
  -- Rene Engelhard <rene@debian.org>  Sun, 20 Mar 2011 12:15:19 +0000
 
diff --git a/libreoffice-common.postinst.in b/libreoffice-common.postinst.in
index 9141c2b..74c623a 100644
--- a/libreoffice-common.postinst.in
+++ b/libreoffice-common.postinst.in
@@ -16,6 +16,19 @@ if [ "$1" = "triggered" ]; then
 fi
 
 if [ "$1" = "configure" ]; then
+	if dpkg-maintscript-helper supports rm_conffile; then
+		dpkg-maintscript-helper rm_conffile "/etc/bash_completion.d/ooffice.sh" 1:3.3.0~rc4-2 libreoffice-common -- "$@"
+	fi
+ 
+	if dpkg-maintscript-helper supports mv_conffile; then
+		dpkg-maintscript-helper mv_conffile \
+			"/etc/openoffice/psprint.conf" "/etc/libreoffice/psprint.conf" "" libreoffice-common -- "$@"
+		dpkg-maintscript-helper mv_conffile \
+			"/etc/openoffice/sofficerc" "/etc/libreoffice/sofficerc" "" libreoffice-common -- "$@"
+		dpkg-maintscript-helper mv_conffile \
+			"/etc/openoffice/soffice.sh" "/etc/libreoffice/soffice.sh" "" libreoffice-common -- "$@"
+	fi
+
 	if dpkg --compare-versions "$2" lt "1:3.3.0-3"; then
 		sync_extensions
 	fi
diff --git a/libreoffice-common.postrm.in b/libreoffice-common.postrm.in
new file mode 100644
index 0000000..5eb33d5
--- /dev/null
+++ b/libreoffice-common.postrm.in
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+set -e
+
+#INCLUDE_SHELL_LIB#
+
+case "$1" in
+	remove|abort-install|abort-upgrade)
+		if dpkg-maintscript-helper supports rm_conffile; then
+			dpkg-maintscript-helper rm_conffile "/etc/bash_completion.d/ooffice.sh" 1:3.3.0~rc4-2 libreoffice-common -- "$@"
+		fi
+
+		if dpkg-maintscript-helper supports mv_conffile; then
+			dpkg-maintscript-helper mv_conffile \
+				"/etc/openoffice/psprint.conf" "/etc/libreoffice/psprint.conf" "" libreoffice-common -- "$@"
+			dpkg-maintscript-helper mv_conffile \
+				"/etc/openoffice/sofficerc" "/etc/libreoffice/sofficerc" "" libreoffice-common -- "$@"
+			dpkg-maintscript-helper mv_conffile \
+				"/etc/openoffice/soffice.sh" "/etc/libreoffice/soffice.sh" "" libreoffice-common -- "$@"
+	fi
+	;;
+esac
+
+#DEBHELPER#
diff --git a/libreoffice-common.preinst.in b/libreoffice-common.preinst.in
index 5fc619f..5a46257 100755
--- a/libreoffice-common.preinst.in
+++ b/libreoffice-common.preinst.in
@@ -17,9 +17,9 @@ case "$1" in install|upgrade)
 		fi
 	fi
 
-        if dpkg --compare-versions "$2" lt "1:3.3.0~rc4-2"; then
-                rm_conffile "/etc/bash_completion.d/ooffice.sh" libreoffice-common
-        fi
+	if dpkg-maintscript-helper supports rm_conffile; then
+		dpkg-maintscript-helper rm_conffile "/etc/bash_completion.d/ooffice.sh" 1:3.3.0~rc4-2 libreoffice-common -- "$@"
+	fi
         if [ -n "$2" ] && dpkg --compare-versions "$2" lt "1:3.3.0-3"; then
 		if [ -d /share ]; then
 			rm -f /share/config/javasettingsunopkginstall.xml
@@ -67,6 +67,15 @@ case "$1" in install|upgrade)
 			rmdir /user 2> /dev/null || true
 		fi
 	fi
+
+	if dpkg-maintscript-helper supports mv_conffile; then
+		dpkg-maintscript-helper mv_conffile \
+			"/etc/openoffice/psprint.conf" "/etc/libreoffice/psprint.conf" "" libreoffice-common -- "$@"
+		dpkg-maintscript-helper mv_conffile \
+			"/etc/openoffice/sofficerc" "/etc/libreoffice/sofficerc" "" libreoffice-common -- "$@"
+		dpkg-maintscript-helper mv_conffile \
+			"/etc/openoffice/soffice.sh" "/etc/libreoffice/soffice.sh" "" libreoffice-common -- "$@"
+	fi
 	;;
 esac
 
diff --git a/rules b/rules
index 0ab95bf..674d215 100755
--- a/rules
+++ b/rules
@@ -2048,9 +2048,7 @@ $(STAMP_DIR)/maintscripts: $(wildcard debian/shell-lib*Env*.sh) $(wildcard debia
 	        grep PLATFORMID debian/scripts/vars.$(ARCH) >> $$MAINTSCRIPT; \
 	      fi; \
 	      echo "" >> $$MAINTSCRIPT; \
-	      if grep -q conffile $$MAINTSCRIPT.in; then \
-		 cat debian/shell-lib-conffiles.sh >> $$MAINTSCRIPT; \
-	      elif egrep -q "(add|remove|validate|sync)_extension" $$MAINTSCRIPT.in; then \
+	      if egrep -q "(add|remove|validate|sync)_extension" $$MAINTSCRIPT.in; then \
 		 cat debian/shell-lib-extensions.sh >> $$MAINTSCRIPT; \
 	      elif grep -q services_rdb $$MAINTSCRIPT.in; then \
 		 cat debian/shell-lib-components.sh >> $$MAINTSCRIPT; \
diff --git a/shell-lib-conffiles.sh b/shell-lib-conffiles.sh
deleted file mode 100644
index c1106e5..0000000
--- a/shell-lib-conffiles.sh
+++ /dev/null
@@ -1,38 +0,0 @@
-# Prepare to move a conffile without triggering a dpkg question
-prep_rm_conffile() {
-    CONFFILE="$1"
-
-    if [ -e "$CONFFILE" ]; then
-        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
-        old_md5sum="`dpkg-query -W -f='${Conffiles}' $2 | grep $CONFFILE | awk '{print $2}'`"
-        if [ "$md5sum" = "$old_md5sum" ]; then
-            mv "$CONFFILE" "$CONFFILE.${DPKG_MAINTSCRIPT_PACKAGE}-tmp"
-        fi
-    fi
-}
-
-rm_conffile_commit() {
-  CONFFILE="$1"
-
-  if [ -e $CONFFILE.${DPKG_MAINTSCRIPT_PACKAGE}-tmp ]; then
-    rm $CONFFILE.${DPKG_MAINTSCRIPT_PACKAGE}-tmp
-  fi
-}
-
-# Remove a no-longer used conffile
-rm_conffile() {
-    CONFFILE="$1"
-
-    if [ -e "$CONFFILE" ]; then
-        md5sum="`md5sum \"$CONFFILE\" | sed -e \"s/ .*//\"`"
-        old_md5sum="`dpkg-query -W -f='${Conffiles}' $2 | grep $CONFFILE | awk '{print $2}'`"
-        if [ "$md5sum" != "$old_md5sum" ]; then
-            echo "Obsolete conffile $CONFFILE has been modified by you."
-            echo "Saving as $CONFFILE.dpkg-bak ..."
-            mv -f "$CONFFILE" "$CONFFILE".bak
-        else
-            echo "Removing obsolete conffile $CONFFILE ..."
-            rm -f "$CONFFILE"
-        fi
-    fi
-}

-- 
LibreOffice packaging repository


Reply to: