Преглед изворни кода

Don't use symlinks in usr/share/doc

Copy the usr/share/doc directory to dpkg-dev and dselect (Instead
of using symlinks). The space requirements are minimal and adding
the needed dependencies to comply with policy would be way more
inconvenient.
Frank Lichtenheld пре 18 година
родитељ
комит
9c0b395623
7 измењених фајлова са 105 додато и 6 уклоњено
  1. 11 0
      ChangeLog
  2. 4 0
      debian/changelog
  3. 1 0
      debian/dpkg-dev.docs
  4. 42 0
      debian/dpkg-dev.preinst
  5. 1 0
      debian/dselect.docs
  6. 42 0
      debian/dselect.preinst
  7. 4 6
      debian/rules

+ 11 - 0
ChangeLog

@@ -1,3 +1,14 @@
+2007-12-04  Frank Lichtenheld  <djpig@debian.org>
+
+	* debian/rules: Call dh_installchangelogs
+	and dh_installdocs for all packages instead
+	of only for dpkg.
+	* debian/dpkg-dev.docs: Symlink to dpkg.docs.
+	* debian/dselect.docs: Likewise.
+	* debian/dpkg-dev.preinst: Remove
+	/usr/share/doc/dpkg-dev symlink on upgrade.
+	* debian/dselect.preinst: Likewise.
+
 2007-11-29  Frank Lichtenheld  <djpig@debian.org>
 
 	* scripts/controllib.pl (parsecdata): Fix

+ 4 - 0
debian/changelog

@@ -6,6 +6,10 @@ dpkg (1.14.13) UNRELEASED; urgency=low
   * Fix control file parsing for field values starting with a colon.
     Apparently nobody ever needed this until Vcs-Cvs came along.
     Closes: #453364
+  * Copy the usr/share/doc directory to dpkg-dev and dselect (Instead
+    of using symlinks). The space requirements are minimal and adding
+    the needed dependencies to comply with policy would be way more
+    inconvenient. Pointed out by Rene Engelhard. Closes: #452730
 
   [ Updated man pages translations ]
   * Swedish (Peter Karlsson)

+ 1 - 0
debian/dpkg-dev.docs

@@ -0,0 +1 @@
+dpkg.docs

+ 42 - 0
debian/dpkg-dev.preinst

@@ -0,0 +1,42 @@
+#!/bin/sh -e
+# This script can be called in the following ways:
+#
+# Before the package is installed:
+#	<new-preinst> install
+#
+# Before removed package is upgraded:
+#	<new-preinst> install <old-version>
+#
+# Before the package is upgraded:
+#	<new-preinst> upgrade <old-version>
+#
+#
+# If postrm fails during upgrade or fails on failed upgrade:
+#	<old-preinst> abort-upgrade <new-version>
+
+remove_doc_symlink() {
+    if [ -L /usr/share/doc/dpkg-dev ]; then
+	rm /usr/share/doc/dpkg-dev
+    fi
+}
+
+case "$1" in
+    install)
+	;;
+
+    upgrade)
+	remove_doc_symlink
+	;;
+
+    abort-upgrade)
+	;;
+
+
+    *)
+	echo "$0 called with unknown argument \`$1'" 1>&2
+	exit 1
+	;;
+esac
+
+#DEBHELPER#
+exit 0

+ 1 - 0
debian/dselect.docs

@@ -0,0 +1 @@
+dpkg.docs

+ 42 - 0
debian/dselect.preinst

@@ -0,0 +1,42 @@
+#!/bin/sh -e
+# This script can be called in the following ways:
+#
+# Before the package is installed:
+#	<new-preinst> install
+#
+# Before removed package is upgraded:
+#	<new-preinst> install <old-version>
+#
+# Before the package is upgraded:
+#	<new-preinst> upgrade <old-version>
+#
+#
+# If postrm fails during upgrade or fails on failed upgrade:
+#	<old-preinst> abort-upgrade <new-version>
+
+remove_doc_symlink() {
+    if [ -L /usr/share/doc/dselect ]; then
+	rm /usr/share/doc/dselect
+    fi
+}
+
+case "$1" in
+    install)
+	;;
+
+    upgrade)
+	remove_doc_symlink
+	;;
+
+    abort-upgrade)
+	;;
+
+
+    *)
+	echo "$0 called with unknown argument \`$1'" 1>&2
+	exit 1
+	;;
+esac
+
+#DEBHELPER#
+exit 0

+ 4 - 6
debian/rules

@@ -81,10 +81,8 @@ binary-arch: install
 	install -d debian/dpkg/sbin
 	mv debian/dpkg/usr/sbin/start-stop-daemon debian/dpkg/sbin
 
-	dh_installchangelogs -pdpkg ChangeLog
-	dh_installdocs -pdpkg
-	install -d debian/dselect/usr/share/doc
-	ln -s dpkg debian/dselect/usr/share/doc/dselect
+	dh_installchangelogs -a ChangeLog
+	dh_installdocs -a
 
 	install -d debian/dpkg/usr/share/lintian/overrides
 	install -m 644 debian/dpkg.lintian-overrides \
@@ -108,8 +106,8 @@ binary-indep: install
 	dh_testroot -i
 	dh_install --sourcedir=debian/tmp -i
 
-	install -d debian/dpkg-dev/usr/share/doc
-	ln -s dpkg debian/dpkg-dev/usr/share/doc/dpkg-dev
+	dh_installchangelogs -i ChangeLog
+	dh_installdocs -i
 
 	install -d debian/dpkg-dev/usr/share/lintian/overrides
 	install -m 644 debian/dpkg-dev.lintian-overrides \