summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>1999-07-22 09:39:38 +0000
committerPascal Rigaux <pixel@mandriva.com>1999-07-22 09:39:38 +0000
commitbc25ea4a6ee8505a77972e2a723607735a4e19f9 (patch)
treec8f6096b4902a63e16033879bd13d7ae4de10d98 /perl-install/pkgs.pm
parentebf39bc7297fa08a3798ccafffb4db5cfc15160a (diff)
downloaddrakx-bc25ea4a6ee8505a77972e2a723607735a4e19f9.tar
drakx-bc25ea4a6ee8505a77972e2a723607735a4e19f9.tar.gz
drakx-bc25ea4a6ee8505a77972e2a723607735a4e19f9.tar.bz2
drakx-bc25ea4a6ee8505a77972e2a723607735a4e19f9.tar.xz
drakx-bc25ea4a6ee8505a77972e2a723607735a4e19f9.zip
no_comment
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm19
1 files changed, 10 insertions, 9 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index 45848cd9a..bb485e767 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -102,12 +102,12 @@ sub psUsingDirectory(;$) {
$dirname ||= install_any::imageGetFile('');
log::l("scanning $dirname for packages");
- foreach (glob_("$dirname/*.rpm")) {
- local *F;
- open F, $_ or log::l("failed to open package $_: $!");
- my $header = c::rpmReadPackageHeader(fileno F) or log::l("failed to rpmReadPackageHeader $_: $!");
- my $name = c::headerGetEntry($header, 'name');
- addInfosFromHeader(\%packages, $header, $_);
+ foreach (all("$dirname")) {
+ my ($name, $version, $release) = /(.*)-([^-]+)-([^-.]+)\.[^.]+\.rpm/ or log::l("skipping $_"), next;
+ $packages{$name} = {
+ name => $name, version => $version, release => $release,
+ file => "$dirname/$_", selected => 0, deps => [],
+ };
}
\%packages;
}
@@ -118,9 +118,10 @@ sub getDeps($) {
local *F;
open F, install_any::imageGetFile("depslist"); # or die "can't find dependencies list";
foreach (<F>) {
- my ($name, @deps) = split;
- Package($packages, $name)->{deps} = \@deps;
- map { push @{Package($packages, $_)->{provides}}, $name } @deps;
+ my ($name, $size, @deps) = split;
+ $packages->{$name}->{size} = $size;
+ $packages->{$name}->{deps} = \@deps;
+ map { push @{$packages->{$_}->{provides}}, $name } @deps;
}
}