소스 검색

Fix dpkg maintainer scripts to honour DPKG_ADMINDIR if present

This will allow the maintainer scripts to work properly if --admindir
has been passed to dpkg. Fallback to using the default admindir in case
we are being called from an old dpkg not setting the environment
variable.
Guillem Jover 15 년 전
부모
커밋
bf7b7023d4
3개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  1. 3 3
      debian/dpkg.lintian-overrides
  2. 1 1
      debian/dpkg.postinst
  3. 2 1
      debian/dpkg.preinst

+ 3 - 3
debian/dpkg.lintian-overrides

@@ -2,9 +2,9 @@ dpkg: redundant-origin-field
 dpkg: redundant-bugs-field
 dpkg: arch-dep-package-has-big-usr-share
 # False positives, we read from a file not from a tty
-dpkg: read-in-maintainer-script preinst:39
 dpkg: read-in-maintainer-script preinst:40
-dpkg: read-in-maintainer-script preinst:42
-dpkg: read-in-maintainer-script preinst:50
+dpkg: read-in-maintainer-script preinst:41
+dpkg: read-in-maintainer-script preinst:43
+dpkg: read-in-maintainer-script preinst:51
 # On purpose, install-info is only a wrapper that will be removed soon
 dpkg: binary-without-manpage usr/sbin/install-info

+ 1 - 1
debian/dpkg.postinst

@@ -21,7 +21,7 @@
 
 # Create the database files if they don't already exist
 create_database() {
-    admindir=/var/lib/dpkg
+    admindir=${DPKG_ADMINDIR:-/var/lib/dpkg}
 
     for file in diversions statoverride status; do
 	if [ ! -f "$admindir/$file" ]; then

+ 2 - 1
debian/dpkg.preinst

@@ -28,7 +28,8 @@ upgrade_dpkg_non_conffile()
 
 kill_bad_alternatives () {
     local IFS=""
-    ALTDIR="/var/lib/dpkg/alternatives"
+    admindir=${DPKG_ADMINDIR:-/var/lib/dpkg}
+    ALTDIR="$admindir/alternatives"
     for alt in $ALTDIR/*; do
         if [ ! -f $alt ]; then
             # In case it's been removed by the code below, or in case