* Clean up the retainsources behaviour (Closes: #627179) * Implement some code for omitpreinst support.

git-svn-id: http://emdebian.org/svn/current@8024 563faec7-e20c-0410-992a-a66f704d0ccd
This commit is contained in:
codehelp 2011-06-15 20:44:54 +00:00
parent 03483ad805
commit 0b88989248
2 changed files with 31 additions and 15 deletions

4
debian/changelog vendored
View file

@ -5,8 +5,10 @@ multistrap (2.1.14) unstable; urgency=low
allowed. dpkg does not currently support changes in /var/lib/dpkg/info allowed. dpkg does not currently support changes in /var/lib/dpkg/info
* Read the dpkg status file to look for source packages even when no * Read the dpkg status file to look for source packages even when no
packages needed to be downloaded or unpacked. (Closes: #623563) packages needed to be downloaded or unpacked. (Closes: #623563)
* Clean up the retainsources behaviour (Closes: #627179)
* Implement some code for omitpreinst support.
-- Neil Williams <codehelp@debian.org> Wed, 11 May 2011 20:30:03 +0100 -- Neil Williams <codehelp@debian.org> Wed, 15 Jun 2011 21:44:44 +0100
multistrap (2.1.13) unstable; urgency=low multistrap (2.1.13) unstable; urgency=low

View file

@ -764,10 +764,11 @@ sub handle_source_packages {
next if (-d $file); next if (-d $file);
next unless ($file =~ /\.deb$/); next unless ($file =~ /\.deb$/);
if (defined $sourcedir) { if (defined $sourcedir) {
my $srcname = `LC_ALL dpkg -f ${dir}${cachedir}archives/$file Source`; my $srcname = `LC_ALL=C dpkg -f ${dir}${cachedir}archives/$file Source`;
chomp ($srcname); chomp ($srcname);
$srcname =~ s/ \(.*\)//;
if ($srcname eq "") { if ($srcname eq "") {
my $srcname = `LC_ALL dpkg -f ${dir}${cachedir}archives/$file Package`; my $srcname = `LC_ALL=C dpkg -f ${dir}${cachedir}archives/$file Package`;
chomp ($srcname); chomp ($srcname);
} }
push @dsclist, $srcname; push @dsclist, $srcname;
@ -779,12 +780,23 @@ sub handle_source_packages {
open (STATUS, "${dir}${dpkgdir}status"); open (STATUS, "${dir}${dpkgdir}status");
my @lines=<STATUS>; my @lines=<STATUS>;
close (STATUS); close (STATUS);
my $pkg;
my $src;
foreach my $line (@lines) { foreach my $line (@lines) {
if ($line =~ /^Package: (.*)$/) {
$pkg = $1;
}
if ($line =~ /^Source: (.*)$/) { if ($line =~ /^Source: (.*)$/) {
my $c = $1; my $c = $1;
$c =~ s/\(.*\)$//; $c =~ s/\(.*\)$//;
$c =~ s/ //g; $c =~ s/ //g;
push @dsclist, $c; push @dsclist, $c;
$src = $c;
}
if ($line =~ /^$/) {
push @dsclist, $pkg if (not defined $src and defined $pkg);
undef $pkg;
undef $src;
} }
} }
} }
@ -801,7 +813,6 @@ sub handle_source_packages {
} }
} }
chdir ($olddir); chdir ($olddir);
$sourcedir=undef;
} }
sub tidy_apt { sub tidy_apt {
@ -820,6 +831,7 @@ sub tidy_apt {
unlink ("${dir}${cachedir}archives/$file"); unlink ("${dir}${cachedir}archives/$file");
} }
} }
$sourcedir=undef;
} }
unlink ("${dir}etc/apt/sources.list") unlink ("${dir}etc/apt/sources.list")
if (-f "${dir}etc/apt/sources.list"); if (-f "${dir}etc/apt/sources.list");
@ -871,17 +883,19 @@ sub native {
} }
} }
&run_native_hooks_start(sort @{$hooks{'N'}}) if (defined ($hooks{'N'})); &run_native_hooks_start(sort @{$hooks{'N'}}) if (defined ($hooks{'N'}));
opendir (PRI, "${dir}/var/lib/dpkg/info") or return; if (not defined $omitpreinst) {
my @preinsts=grep(/\.preinst$/, readdir PRI); opendir (PRI, "${dir}/var/lib/dpkg/info") or return;
closedir (PRI); my @preinsts=grep(/\.preinst$/, readdir PRI);
printf (_g("I: Running preinst scripts with 'install' argument.\n")); closedir (PRI);
my $f = join (" ", @reinstall); printf (_g("I: Running preinst scripts with 'install' argument.\n"));
foreach my $script (sort @preinsts) { my $f = join (" ", @reinstall);
my $t = $script; foreach my $script (sort @preinsts) {
$t =~ s/\.preinst//; my $t = $script;
next if ($t =~ /$f/); $t =~ s/\.preinst//;
next if ($script =~ /bash/); next if ($t =~ /$f/);
system ("$str $env chroot $dir /var/lib/dpkg/info/$script install"); next if ($script =~ /bash/);
system ("$str $env chroot $dir /var/lib/dpkg/info/$script install");
}
} }
my $retval = 0; my $retval = 0;
$retval = system ("$str $env chroot $dir dpkg --configure -a"); $retval = system ("$str $env chroot $dir dpkg --configure -a");