From 253736ab8308e7d33dd37bb2460066f94167be9d Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Sun, 24 Dec 2000 08:41:47 +0000 Subject: [PATCH] Fix to pass on admindir from dselect to dpkg. --- ChangeLog | 9 ++++++++- debian/changelog | 1 + methods/disk.install | 10 +++++----- methods/disk.setup | 2 +- methods/disk.update | 8 ++++---- methods/floppy.install | 6 +++--- methods/floppy.update | 2 +- methods/hd.setup | 4 ++-- methods/hd.unpack | 5 +++-- methods/hd.update | 5 +++-- 10 files changed, 31 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59f672be..4a7aeb00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -Sun Dec 24 01:00:59 CST 2000 2000 Adam Heath +Sun Dec 24 02:38:38 CST 2000 Adam Heath + + * 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 * 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 diff --git a/debian/changelog b/debian/changelog index 7a574f21..7907477a 100644 --- a/debian/changelog +++ b/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 diff --git a/methods/disk.install b/methods/disk.install index f47d1297..868c64a6 100644 --- a/methods/disk.install +++ b/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. ' diff --git a/methods/disk.setup b/methods/disk.setup index 0a9638a1..68820aa3 100644 --- a/methods/disk.setup +++ b/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 ' diff --git a/methods/disk.update b/methods/disk.update index 932ee30b..e27a284a 100644 --- a/methods/disk.update +++ b/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 diff --git a/methods/floppy.install b/methods/floppy.install index a9823a49..51224c34 100644 --- a/methods/floppy.install +++ b/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 diff --git a/methods/floppy.update b/methods/floppy.update index 19030894..3d79731c 100644 --- a/methods/floppy.update +++ b/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 ' diff --git a/methods/hd.setup b/methods/hd.setup index a238c529..906ccbce 100644 --- a/methods/hd.setup +++ b/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 = ; 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"; diff --git a/methods/hd.unpack b/methods/hd.unpack index ad22c6b0..ca5a8fd4 100644 --- a/methods/hd.unpack +++ b/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'}"); diff --git a/methods/hd.update b/methods/hd.update index 98bf56b3..2a277dd8 100644 --- a/methods/hd.update +++ b/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 (); close IN; close OUT; -- 2.39.5