summaryrefslogtreecommitdiffstats
path: root/perl-install/pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-03-12 16:55:59 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-03-12 16:55:59 +0000
commit98237635634f25793621d41c499e6215afcb10bb (patch)
treebc57c7a25ca7f70ab56faadfab8ff8a64dd4f5f7 /perl-install/pkgs.pm
parent465f723c934020c44e5aae01f986473eb6c93914 (diff)
downloaddrakx-backup-do-not-use-98237635634f25793621d41c499e6215afcb10bb.tar
drakx-backup-do-not-use-98237635634f25793621d41c499e6215afcb10bb.tar.gz
drakx-backup-do-not-use-98237635634f25793621d41c499e6215afcb10bb.tar.bz2
drakx-backup-do-not-use-98237635634f25793621d41c499e6215afcb10bb.tar.xz
drakx-backup-do-not-use-98237635634f25793621d41c499e6215afcb10bb.zip
(readCompssUsers): clean-up
(saveCompssUsers): created
Diffstat (limited to 'perl-install/pkgs.pm')
-rw-r--r--perl-install/pkgs.pm23
1 files changed, 18 insertions, 5 deletions
diff --git a/perl-install/pkgs.pm b/perl-install/pkgs.pm
index a9300b2a7..dce506db5 100644
--- a/perl-install/pkgs.pm
+++ b/perl-install/pkgs.pm
@@ -657,9 +657,8 @@ sub read_rpmsrate {
}
sub readCompssUsers {
- my ($packages, $meta_class) = @_;
+ my ($meta_class) = @_;
my (%compssUsers, @sorted, $l);
- my (%compss);
my $file = 'Mandrake/base/compssUsers';
my $f = $meta_class && install_any::getFile("$file.$meta_class") || install_any::getFile($file) or die "can't find $file";
@@ -669,19 +668,33 @@ sub readCompssUsers {
s/#.*//;
if (/^(\S.*)/) {
+ my $verbatim = $_;
my ($icon, $descr);
/^(.*?)\s*\[icon=(.*?)\](.*)/ and $_ = "$1$3", $icon = $2;
/^(.*?)\s*\[descr=(.*?)\](.*)/ and $_ = "$1$3", $descr = $2;
- $compssUsers{$_}{icons} = $icon;
- $compssUsers{$_}{descr} = $descr;
+ $compssUsers{$_} = { verbatim => $verbatim, icons => $icon, descr => $descr, flags => $l=[] };
push @sorted, $_;
- $compssUsers{$_}{flags} = $l = [];
} elsif (/^\s+(.*?)\s*$/) {
push @$l, $1;
}
}
\%compssUsers, \@sorted;
}
+sub saveCompssUsers {
+ my ($prefix, $packages, $compssUsers, $sorted) = @_;
+ my $flat;
+ foreach (@$sorted) {
+ my %fl;
+ $fl{$_} = 1 foreach @{$compssUsers->{$_}{flags}};
+ $flat .= $compssUsers->{$_}{verbatim};
+ foreach my $p (values %{$packages->{names}}) {
+ my ($rate, @flags) = packageRateRFlags($p);
+ $flat .= "\t$rate " . packageName($p)
+ if grep { !grep { /^!(.*)/ ? !$fl{$1} : $fl{$_} } split('\|\|') } @flags;
+ }
+ }
+ output "$prefix/var/lib/urpmi/compssUsers.flat", $flat;
+}
sub setSelectedFromCompssList {
my ($packages, $compssUsersChoice, $min_level, $max_size) = @_;