tags 692951 + patch
thanks

Andreas Beckmann dixit:

>After the upgrade /usr/share/doc/$PACKAGE/ is just an empty directory.

Hey, I know that. Patch attached, can NMU if you want, maks.

bye,
//mirabilos
-- 
FWIW, I'm quite impressed with mksh interactively. I thought it was much
*much* more bare bones. But it turns out it beats the living hell out of
ksh93 in that respect. I'd even consider it for my daily use if I hadn't
wasted half my life on my zsh setup. :-) -- Frank Terbeck in #!/bin/mksh
From 9659e5b233c12984ff1144d196ad20be5c046fce Mon Sep 17 00:00:00 2001
From: Thorsten Glaser <t...@mirbsd.org>
Date: Sun, 11 Nov 2012 11:40:09 +0000
Subject: [PATCH] add migration script for /usr/share/doc/libklibc-dev
 (Closes: #692951)


Signed-off-by: Thorsten Glaser <t...@mirbsd.org>
---
 debian/changelog             |    7 +++++
 debian/libklibc-dev.postinst |   66 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 73 insertions(+)
 create mode 100644 debian/libklibc-dev.postinst

diff --git a/debian/changelog b/debian/changelog
index fde3e9b..e112208 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+klibc (2.0.1-3.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Add migration script for /usr/share/doc/libklibc-dev (Closes: #692951)
+
+ -- Thorsten Glaser <t...@mirbsd.de>  Sun, 11 Nov 2012 11:30:14 +0000
+
 klibc (2.0.1-3) unstable; urgency=medium
 
   [ Bill Pringlemeir ]
diff --git a/debian/libklibc-dev.postinst b/debian/libklibc-dev.postinst
new file mode 100644
index 0000000..e037fcb
--- /dev/null
+++ b/debian/libklibc-dev.postinst
@@ -0,0 +1,66 @@
+#!/bin/sh
+# From MirOS: contrib/hosted/tg/deb/mksh/debian/pdksh.postinst,v 1.2 
2012/06/27 07:16:31 tg Exp $
+
+set -e
+
+# This maintainer script can be called the following ways:
+#
+# * new-postinst "configure" [$most_recently_configured_version]
+# The package is unpacked; all dependencies are unpacked and, when there
+# are no circular dependencies, configured.
+#
+# * old-postinst "abort-upgrade" $new_version
+# * conflictors-postinst "abort-remove" "in-favour" $package
+#      $new_version
+# * postinst "abort-remove"
+# * deconfigureds-postinst "abort-deconfigure" "in-favour"
+#      $failed_install_package $fip_version ["removing"
+#      $conflicting_package $cp_version]
+# The package is unpacked; all dependencies are at least Half-Installed,
+# previously been configured, and not removed. In some error situations,
+# dependencies may not be even fully unpacked.
+#
+# * postinst "triggered" "${triggers[*]}"
+# For trigger-only calls, i.e. if "configure" is not called.
+
+docdir=/usr/share/doc/libklibc-dev
+move_docdir() {
+       test -d /usr/share/doc/. || return 0
+       test -d $docdir && rmdir --ignore-fail-on-non-empty $docdir
+       if test -e $docdir; then
+               echo >&2 "The old $docdir was locally modified."
+               echo >&2 "Saved as $docdir.dpkg-old"
+               (mv $docdir $docdir.dpkg-old || :)
+       fi
+       if test -e $docdir; then
+               echo >&2 "FAILED! Remove $docdir manually,"
+               echo >&2 "then retry (dpkg -a --configure)."
+               exit 1
+       fi
+       ln -sf libklibc $docdir
+}
+
+case $1 in
+configure)
+       # convert old docdir into a symlink, dpkg won't do that for us
+       test -h $docdir || move_docdir
+       ;;
+
+abort-upgrade|abort-remove|abort-deconfigure)
+       ;;
+
+triggered)
+       ;;
+
+*)
+       echo >&2 "postinst called with unknown subcommand '$1'"
+       exit 1
+       ;;
+esac
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
-- 
1.7.10.4

Reply via email to