diff options
author | Francois Pons <fpons@mandriva.com> | 2000-07-07 14:58:27 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2000-07-07 14:58:27 +0000 |
commit | 7eba5b3a2b6c8dc1f6b2cb9d16abf648d5cbddc5 (patch) | |
tree | 5fa035fa39c82ecf43220b4e96bb00fbe16fc9c6 /perl-install/pkgs.pm | |
parent | 7b975041ea5dfe72e19f00bbf1237f8e3cb3e7f3 (diff) | |
download | drakx-backup-do-not-use-7eba5b3a2b6c8dc1f6b2cb9d16abf648d5cbddc5.tar drakx-backup-do-not-use-7eba5b3a2b6c8dc1f6b2cb9d16abf648d5cbddc5.tar.gz drakx-backup-do-not-use-7eba5b3a2b6c8dc1f6b2cb9d16abf648d5cbddc5.tar.bz2 drakx-backup-do-not-use-7eba5b3a2b6c8dc1f6b2cb9d16abf648d5cbddc5.tar.xz drakx-backup-do-not-use-7eba5b3a2b6c8dc1f6b2cb9d16abf648d5cbddc5.zip |
*** empty log message ***
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r-- | perl-install/pkgs.pm | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm index a9096a51f..4a90ee3e8 100644 --- a/perl-install/pkgs.pm +++ b/perl-install/pkgs.pm @@ -361,6 +361,44 @@ sub skipSetWithProvides { packageSetFlagSkip($_, 1) foreach grep { $_ } map { $_, packageProvides($_) } @l; } +sub psUpdateHdlistsDeps { + my ($prefix, $method) = @_; + my $listf = install_any::getFile('hdlists') or die "no hdlists found"; + + #- WARNING: this function should be kept in sync with functions + #- psUsingHdlists and psUsingHdlist. + #- it purpose it to update hdlist files on system to install. + + #- parse hdlist.list file. + my $medium = 1; + foreach (<$listf>) { + chomp; + s/\s*#.*$//; + /^\s*$/ and next; + m/^\s*(hdlist\S*\.cz2?)\s+(\S+)\s*(.*)$/ or die "invalid hdlist description \"$_\" in hdlists file"; + + my ($hdlist, $rpmsdir, $descr) = ($1, $2, $3); + my $f = install_any::getFile($hdlist) or die "no $hdlist found"; + + #- copy hdlist file directly to $prefix/var/lib/urpmi, this will be used + #- for getting header of package during installation or after by urpmi. + my $fakemedium = $method . $medium; + my $newf = "$prefix/var/lib/urpmi/hdlist.$fakemedium.cz2"; + -e $newf and do { unlink $newf or die "cannot remove $newf: $!"; }; + local *F; + open F, ">$newf" or die "cannot create $newf: $!"; + my ($buf, $sz); while (($sz = sysread($f, $buf, 16384))) { syswrite(F, $buf) } + close F; + symlinkf $newf, "/tmp/$hdlist"; + + ++$medium; + } + + #- this is necessary for urpmi, but also as hdlist are copied here, + #- we can make consistent the directory. + install_any::getAndSaveFile("depslist", "$prefix/var/lib/urpmi/depslist"); +} + sub psUsingHdlists { my ($prefix, $method) = @_; my $listf = install_any::getFile('hdlists') or die "no hdlists found"; @@ -417,7 +455,6 @@ sub psUsingHdlist { open F, ">$newf" or die "cannot create $newf: $!"; my ($buf, $sz); while (($sz = sysread($f, $buf, 16384))) { syswrite(F, $buf) } close F; - symlinkf $newf, "/tmp/$hdlist"; #- extract filename from archive, this take advantage of verifying @@ -475,7 +512,8 @@ sub getOtherDeps($$) { $pkg or log::l("ignoring package $name-$version-$release in depslist is not in hdlist"), next; $version eq packageVersion($pkg) and $release eq packageRelease($pkg) - or log::l("warning package $name-$version-$release in depslist mismatch version or release in hdlist ($version ne ", packageVersion($pkg), " or $release ne ", packageRelease($pkg), ")"), next; + or log::l("warning package $name-$version-$release in depslist mismatch version or release in hdlist ($version ne ", + packageVersion($pkg), " or $release ne ", packageRelease($pkg), ")"), next; my $index = scalar @{$packages->[1]}; $index >= $pkg->{medium}{min} && $index <= $pkg->{medium}{max} |