Parcourir la source

Fix to pass on admindir from dselect to dpkg.

Adam Heath il y a 25 ans
Parent
commit
253736ab83

+ 8 - 1
ChangeLog

@@ -1,4 +1,11 @@
-Sun Dec 24 01:00:59 CST 2000 2000 Adam Heath <doogie@debian.org>
+Sun Dec 24 02:38:38 CST 2000 Adam Heath <doogie@debian.org>
+
+  * methods/disk.install, methods/disk.setup, methods/disk.update,
+    methods/floppy.install, methods/floppy.update, methods/hd.setup,
+    methods/hd.unpack, methods/hd.update: Fix to pass on admindir
+    from dselect to dpkg.
+
+Sun Dec 24 01:00:59 CST 2000 Adam Heath <doogie@debian.org>
 
   * scripts/dpkg-source.pl: Minor tweak so that when patch 2.5.4 is
     manually used to apply a diff, it doesn't get applied multiple

+ 1 - 0
debian/changelog

@@ -1,5 +1,6 @@
 dpkg (1.8.0) unstable; urgency=low
 
+  * Fix dselect methods to pass admindir to dpkg from dselect.
   * Minor tweak so that when patch 2.5.4 is manually used to apply a diff,
     it doesn't get applied multiple times.  Closes: #65021
   * Add --nicelevel to start-stop-daemon, to alter a programs priority

+ 5 - 5
methods/disk.install

@@ -34,7 +34,7 @@ predep="$vardir/predep-package"
 while true
 do
 	set +e
-	dpkg --predep-package >"$predep"
+	dpkg --admindir "$vardir" --predep-package >"$predep"
 	rc=$?
 	set -e
 	if test $rc = 1; then break; fi
@@ -92,7 +92,7 @@ later, as that is listed in the Packages file.
 Perhaps you downloaded it with an unexpected name, or something.
 In any case, you must find the file(s) and then either place it with
 the correct filename(s) (as listed in the Packages file or in
-/var/lib/dpkg/available) and rerun the installation, or upgrade the
+$vardir/available) and rerun the installation, or upgrade the
 package by using `dpkg --install --auto-deconfigure'\'' by hand.
 
 ";
@@ -102,7 +102,7 @@ package by using `dpkg --install --auto-deconfigure'\'' by hand.
 			push(@invoke,$invoke);
 		}
 		print "Running dpkg -iB for $package ...\n";
-		exec("dpkg","-iB","--",@invoke);
+		exec("dpkg","--admindir",$vardir,"-iB","--",@invoke);
 		die "failed to exec dpkg: $!\n";
 	' -- "$p_mountpoint$p_main_binary" "$predep"
 done
@@ -111,8 +111,8 @@ for f in main ctb nf nus lcl
 do
 	eval 'this_binary=$p_'$f'_binary'
 	if [ -z "$this_binary" ]; then continue; fi
-	echo Running dpkg -iGROEB "$p_mountpoint$this_binary"
-	dpkg -iGROEB "$p_mountpoint$this_binary"
+	echo Running dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
+	dpkg --admindir $vardir -iGROEB "$p_mountpoint$this_binary"
 done
 
 echo -n 'Installation OK.  Hit RETURN.  '

+ 1 - 1
methods/disk.setup

@@ -8,7 +8,7 @@ option=$3
 cd "$vardir/methods/disk"
 tp=/var/run/ddm$$
 
-iarch=`dpkg --print-installation-architecture`
+iarch=`dpkg --admindir $vardir --print-installation-architecture`
 
 xit=1
 trap '

+ 4 - 4
methods/disk.update

@@ -56,11 +56,11 @@ do
 		if [ -z "$this_binary" ]; then continue; fi
 		if [ "$updatetype" = update ]
 		then
-			dpkg --clear-avail
+			dpkg --admindir $vardir --clear-avail
 			updatetype=merge
 		fi
 		echo Running dpkg --record-avail -R "$p_mountpoint$this_binary"
-		dpkg --record-avail -R "$p_mountpoint$this_binary"
+		dpkg --admindir $vardir --record-avail -R "$p_mountpoint$this_binary"
 		;;
 	*)
 		packagesfile="$p_mountpoint$this_packages"
@@ -69,13 +69,13 @@ do
 			echo -n "Uncompressing $packagesfile ... "
 			zcat <"$packagesfile" >packages-$f
 			echo done.
-			dpkg --$updatetype-avail packages-$f
+			dpkg --admindir $vardir --$updatetype-avail packages-$f
 			updatetype=merge
 			;;
 		'')
 			;;
 		*)
-			dpkg --$updatetype-avail "$packagesfile"
+			dpkg --admindir $vardir --$updatetype-avail "$packagesfile"
 			updatetype=merge
 			;;
 		esac

+ 3 - 3
methods/floppy.install

@@ -31,7 +31,7 @@ trap '
 
 while [ -z "$goconfigure" ]
 do
-	yet="`dpkg --yet-to-unpack`"
+	yet="`dpkg --admindir $vardir --yet-to-unpack`"
 	if [ -z "$yet" ]
 	then
 		echo '
@@ -57,7 +57,7 @@ Insert a disk containing *.deb files, or type q to quit.  '
 		if mount -rt "$defaultfstype" "$defaultfloppy" "$mountpoint"
 		then
 			echo
-			dpkg --unpack -GROEB "$mountpoint" || true
+			dpkg --admindir $vardir --unpack -GROEB "$mountpoint" || true
 			umount "$defaultfloppy"
 		fi
 		umount=""
@@ -95,6 +95,6 @@ option on the dselect menu.
 	done
 fi
 
-dpkg --configure --pending
+dpkg --admindir $vardir --configure --pending
 
 xit=0

+ 1 - 1
methods/floppy.update

@@ -38,7 +38,7 @@ tryupdate () {
 		echo "$mountpoint/Packages does not exist.";
 		return
 	fi
-	if dpkg --merge-avail "$mountpoint/Packages"
+	if dpkg --admindir $vardir --merge-avail "$mountpoint/Packages"
 	then
 		success=1
 		echo '

+ 2 - 2
methods/hd.setup

@@ -15,7 +15,7 @@
 #   You should have received a copy of the GNU General Public
 #   License along with this script; if not, write to the Free Software
 #   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
-
+$vardir = $ARGV[0];
 print "Is the partition to install from mounted? [Y] ";
 $ans = <STDIN>;
 if ($ans =~ /^[Nn]/) {
@@ -68,7 +68,7 @@ if ($ans =~ /^[Nn]/) {
 
 # Assumedly, the drive is now mounted
 
-open (STATUS, ">/var/lib/dpkg/methods/hd/hd.status") || die "Can't open hd.status";
+open (STATUS, ">$vardir/methods/hd/hd.status") || die "Can't open hd.status";
 do {
 	print "What is the full path to the 'available' file?\n";
 	print "This file is found as Packages on the ftp site and CDROM";

+ 3 - 2
methods/hd.unpack

@@ -1,4 +1,5 @@
 # Return associative array of fields from control file $file.
+$vardir = $ARGV[0];
 sub slurp
 {
   local ($file) = @_;
@@ -27,9 +28,9 @@ sub slurp
   return %ci;
 }
 
-$file = "/var/lib/dpkg/methods/hd/hd.status";
+$file = "$vardir/methods/hd/hd.status";
 %info = slurp($file);
-$dpkg = "dpkg --auto --unpack --no-auto-select ";
+$dpkg = "dpkg --admindir $vardir --auto --unpack --no-auto-select ";
 $dpkg .= "--refuse downgrade --skip-same-version";
 
 system("$dpkg $info{'debdir'}");

+ 3 - 2
methods/hd.update

@@ -1,4 +1,5 @@
 # Return associative array of fields from control file $file.
+$vardir = $ARGV[0];
 sub slurp
 {
   local ($file) = @_;
@@ -27,10 +28,10 @@ sub slurp
   return %ci;
 }
 
-$file = "/var/lib/dpkg/methods/hd/hd.status";
+$file = "$vardir/methods/hd/hd.status";
 %info = slurp($file);
 open (IN, "<$info{'avail'}") || die "can't open $info{'avail'}";
-open (OUT, ">/var/lib/dpkg/available") || die "can't open /var/lib/dpkg/available";
+open (OUT, ">$vardir/available") || die "can't open $vardir/available";
 print OUT while (<IN>);
 close IN;
 close OUT;