summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-09-09 16:12:16 +0000
committerFrancois Pons <fpons@mandriva.com>2002-09-09 16:12:16 +0000
commit5cc37c481ef87a8654cb241c3d326519517bb0f2 (patch)
tree9bba8ec4de7df680fdb6f8834bd86cb789c29f6d /perl-install
parent896678933548221342e5f06c7603f83cabbca254 (diff)
downloaddrakx-5cc37c481ef87a8654cb241c3d326519517bb0f2.tar
drakx-5cc37c481ef87a8654cb241c3d326519517bb0f2.tar.gz
drakx-5cc37c481ef87a8654cb241c3d326519517bb0f2.tar.bz2
drakx-5cc37c481ef87a8654cb241c3d326519517bb0f2.tar.xz
drakx-5cc37c481ef87a8654cb241c3d326519517bb0f2.zip
fixed still present hdlist and synthesis file for media not configured (because
of not selected).
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/install_any.pm73
1 files changed, 39 insertions, 34 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index e39f4ff38..e63c956bb 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -582,41 +582,42 @@ sub install_urpmi {
#- rare case where urpmi cannot be installed (no hd install path).
$method eq 'disk' && !hdInstallPath() and return;
- my @cfg = map {
+ my @cfg;
+ foreach (sort { $a->{medium} <=> $b->{medium} } values %$mediums) {
my $name = $_->{fakemedium};
+ if ($_->{ignored} || $_->{selected}) {
+ local *LIST;
+ my $mask = umask 077;
+ open LIST, ">$prefix/var/lib/urpmi/list.$name" or log::l("failed to write list.$name");
+ umask $mask;
+
+ my $dir = ($_->{prefix} || ${{ nfs => "file://mnt/nfs",
+ disk => "file:/" . hdInstallPath(),
+ ftp => $ENV{URLPREFIX},
+ http => $ENV{URLPREFIX},
+ cdrom => "removable://mnt/cdrom" }}{$method}) . "/$_->{rpmsdir}";
+
+ #- build list file using internal data, synthesis file should exists.
+ #- WARNING this method of build only works because synthesis (or hdlist)
+ #- has been read.
+ foreach (@{$packages->{depslist}}[$_->{start} .. $_->{end}]) {
+ print LIST "$dir/".$_->filename."\n";
+ }
+ close LIST;
+
+ #- build synthesis file if there are still not existing (ie not copied from mirror).
+ if (-s "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz" <= 32) {
+ unlink "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz";
+ run_program::rooted($prefix, "parsehdlist", ">", "/var/lib/urpmi/synthesis.hdlist.$name",
+ "--synthesis", "/var/lib/urpmi/hdlist.$name.cz");
+ run_program::rooted($prefix, "gzip", "-S", ".cz", "/var/lib/urpmi/synthesis.hdlist.$name");
+ }
- local *LIST;
- my $mask = umask 077;
- open LIST, ">$prefix/var/lib/urpmi/list.$name" or log::l("failed to write list.$name");
- umask $mask;
-
- my $dir = ($_->{prefix} || ${{ nfs => "file://mnt/nfs",
- disk => "file:/" . hdInstallPath(),
- ftp => $ENV{URLPREFIX},
- http => $ENV{URLPREFIX},
- cdrom => "removable://mnt/cdrom" }}{$method}) . "/$_->{rpmsdir}";
-
- #- build list file using internal data, synthesis file should exists.
- #- WARNING this method of build only works because synthesis (or hdlist)
- #- has been read.
- foreach (@{$packages->{depslist}}[$_->{start} .. $_->{end}]) {
- print LIST "$dir/".$_->filename."\n";
- }
- close LIST;
-
- #- build synthesis file if there are still not existing (ie not copied from mirror).
- if (-s "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz" <= 32) {
- unlink "$prefix/var/lib/urpmi/synthesis.hdlist.$name.cz";
- run_program::rooted($prefix, "parsehdlist", ">", "/var/lib/urpmi/synthesis.hdlist.$name",
- "--synthesis", "/var/lib/urpmi/hdlist.$name.cz");
- run_program::rooted($prefix, "gzip", "-S", ".cz", "/var/lib/urpmi/synthesis.hdlist.$name");
- }
-
- my ($qname, $qdir) = ($name, $dir);
- $qname =~ s/(\s)/\\$1/g; $qdir =~ s/(\s)/\\$1/g;
+ my ($qname, $qdir) = ($name, $dir);
+ $qname =~ s/(\s)/\\$1/g; $qdir =~ s/(\s)/\\$1/g;
- #- output new urpmi.cfg format here.
- "$qname " . ($dir !~ /^(ftp|http)/ && $qdir) . " {
+ #- output new urpmi.cfg format here.
+ push @cfg, "$qname " . ($dir !~ /^(ftp|http)/ && $qdir) . " {
hdlist: hdlist.$name.cz
with_hdlist: ../base/" . ($_->{update} ? "hdlist.cz" : $_->{hdlist}) . "
list: list.$name" . ($dir =~ /removable:/ && "
@@ -625,8 +626,12 @@ sub install_urpmi {
}
";
- #- select only ignored (ie noauto flag) media and selected one.
- } sort { $a->{medium} <=> $b->{medium} } grep { $_->{ignored} || $_->{selected} } values %$mediums;
+ } else {
+ #- remove not selected media by removing hdlist and synthesis files copied.
+ unlink "/var/lib/urpmi/hdlist.$name.cz";
+ unlink "/var/lib/urpmi/synthesis.hdlist.$name.cz";
+ }
+ }
eval { output "$prefix/etc/urpmi/urpmi.cfg", @cfg };
}