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

Bug#862367: jessie-pu: package dsh/0.25.10-1.1+deb8u1



Package: release.debian.org
Severity: normal
Tags: jessie
User: release.debian.org@packages.debian.org
Usertags: pu


 debian/postinst              |   27 +++++++++++++++++++++++++++
 debian/preinst               |   20 ++++++++++++++++++++
 dsh-0.25.10/debian/changelog |    8 ++++++++
 dsh-0.25.10/debian/postrm    |    3 +++
 dsh-0.25.10/debian/rules     |    1 -
 5 files changed, 58 insertions(+), 1 deletion(-)

diff -u dsh-0.25.10/debian/changelog dsh-0.25.10/debian/changelog
--- dsh-0.25.10/debian/changelog
+++ dsh-0.25.10/debian/changelog
@@ -1,3 +1,11 @@
+dsh (0.25.10-1.1+deb8u1) jessie; urgency=medium
+
+  * Non-maintainer upload.
+  * Apply fix from Ivo De Decker to not ship a symlink for
+    /etc/dsh/group/all (Closes: #788585)
+
+ -- Adrian Bunk <bunk@debian.org>  Thu, 11 May 2017 22:34:33 +0300
+
 dsh (0.25.10-1.1) unstable; urgency=medium
 
   [ Aurelien Jarno ]
diff -u dsh-0.25.10/debian/postrm dsh-0.25.10/debian/postrm
--- dsh-0.25.10/debian/postrm
+++ dsh-0.25.10/debian/postrm
@@ -1,6 +1,9 @@
 #! /bin/sh
 
 if [ "$1" = "purge" ]; then
+  rm -f /etc/dsh/group/all
+  # might be created in preinst on upgrade
+  rm -f /etc/dsh/group/all.dpkg-backup
   rmdir --ignore-fail-on-non-empty /etc/dsh/group
   rmdir --ignore-fail-on-non-empty /etc/dsh
 fi
diff -u dsh-0.25.10/debian/rules dsh-0.25.10/debian/rules
--- dsh-0.25.10/debian/rules
+++ dsh-0.25.10/debian/rules
@@ -56,7 +56,6 @@
 	$(MAKE) install DESTDIR=$(CURDIR)/debian/dsh
 	cp $(CURDIR)/debian/machines.list $(CURDIR)/debian/dsh/etc/dsh/machines.list
 	cp $(CURDIR)/dsh.conf $(CURDIR)/debian/dsh/etc/dsh/dsh.conf
-	ln -s ../machines.list $(CURDIR)/debian/dsh/etc/dsh/group/all
 	install -d $(CURDIR)/debian/dsh/usr/lib/update-cluster
 	install -m 755 $(CURDIR)/debian/dsh.updatelist $(CURDIR)/debian/dsh/usr/lib/update-cluster/
 
only in patch2:
unchanged:
--- dsh-0.25.10.orig/debian/postinst
+++ dsh-0.25.10/debian/postinst
@@ -0,0 +1,27 @@
+#! /bin/sh
+
+if [ "$1" = "configure" ] && [ -z "$2" ]; then
+	if [ ! -e /etc/dsh/group/all ]
+	then
+		# manually create the symlink instead of shipping it
+		# see https://bugs.debian.org/788585
+		ln -s ../machines.list /etc/dsh/group/all
+	fi
+fi
+
+# see preinst
+SYMLINK="/etc/dsh/group/all"
+LASTVERSION="0.25.10-1.3~"
+
+if [ "$1" = "configure" ] &&
+   [ -n "$2" ] &&
+   dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+	if [ -e ${SYMLINK}.dpkg-backup -o -h ${SYMLINK}.dpkg-backup ] &&
+	   [ ! -e "$SYMLINK" ]
+	then
+		mv -f "${SYMLINK}.dpkg-backup" "$SYMLINK"
+	fi
+fi
+
+#DEBHELPER#
+
only in patch2:
unchanged:
--- dsh-0.25.10.orig/debian/preinst
+++ dsh-0.25.10/debian/preinst
@@ -0,0 +1,20 @@
+#! /bin/sh
+
+# Handle the upgrade from the symlink shipped in the package to the symlink
+# created by the postinst
+# see https://bugs.debian.org/788585
+
+# this code is based on symlink_to_dir in dpkg-maintscript-helper
+
+# note that this also works if /etc/dsh/group/all is not a symlink
+SYMLINK="/etc/dsh/group/all"
+LASTVERSION="0.25.10-1.3~"
+
+if [ "$1" = "install" -o "$1" = "upgrade" ] &&
+   [ -n "$2" ] && [ -h "$SYMLINK" -o -e "$SYMLINK" ] &&
+   dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
+	mv -f "$SYMLINK" "${SYMLINK}.dpkg-backup"
+fi
+
+#DEBHELPER#
+


Reply to: