summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-04-16 21:37:05 +0000
committerThierry Vignaud <tv@mageia.org>2012-04-16 21:37:05 +0000
commitcc14cd5a5cc5fe4e51a61d137821705edd9587a7 (patch)
tree4734f3000fde7fa60e6ce0f57f8cb387f682b2d2 /perl-install/install
parent0b201e62a6ad8d5c87f72a2e5416d50ee51f5722 (diff)
downloaddrakx-backup-do-not-use-cc14cd5a5cc5fe4e51a61d137821705edd9587a7.tar
drakx-backup-do-not-use-cc14cd5a5cc5fe4e51a61d137821705edd9587a7.tar.gz
drakx-backup-do-not-use-cc14cd5a5cc5fe4e51a61d137821705edd9587a7.tar.bz2
drakx-backup-do-not-use-cc14cd5a5cc5fe4e51a61d137821705edd9587a7.tar.xz
drakx-backup-do-not-use-cc14cd5a5cc5fe4e51a61d137821705edd9587a7.zip
(cleanHeaders,extractHeaders) resurect them, thus enabling to retrieve package descriptions from headers (mga#549)
(got ripped after swtiching to urpmi, needed for next commits)
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/pkgs.pm26
-rw-r--r--perl-install/install/steps_gtk.pm1
3 files changed, 28 insertions, 0 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 2edba2ca7..a60c06af3 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,4 +1,5 @@
- fix lock icon
+- show again package descriptions in individual package list (mga#549)
Version 14.5 - 12 April 2012
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 9ce16831f..539ee2754 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -27,6 +27,32 @@ use fs::any;
use fs::loopback;
use c;
+sub cleanHeaders() {
+ rm_rf("$::prefix/tmp/headers") if -e "$::prefix/tmp/headers";
+}
+
+#- get all headers from an hdlist file.
+sub extractHeaders {
+ my ($pkgs, $media) = @_;
+ cleanHeaders();
+
+ foreach my $medium (@$media) {
+ $medium->{selected} or next;
+
+ my @l = grep { $_->id >= $medium->{start} && $_->id <= $medium->{end} } @$pkgs or next;
+ eval {
+ require packdrake;
+ my $packer = new packdrake(install::media::hdlist_on_disk($medium), quiet => 1);
+ $packer->extract_archive("$::prefix/tmp/headers", map { $_->header_filename } @l);
+ };
+ $@ and log::l("packdrake failed: $@");
+ }
+
+ foreach (@$pkgs) {
+ my $f = "$::prefix/tmp/headers/" . $_->header_filename;
+ $_->update_header($f) or log::l("unable to open header file $f"), next;
+ }
+}
#- lower bound on the left ( aka 90 means [90-100[ )
our %compssListDesc = (
diff --git a/perl-install/install/steps_gtk.pm b/perl-install/install/steps_gtk.pm
index 9893d1c75..e484416dc 100644
--- a/perl-install/install/steps_gtk.pm
+++ b/perl-install/install/steps_gtk.pm
@@ -402,6 +402,7 @@ sub choosePackagesTree {
},
get_info => sub {
my $p = install::pkgs::packageByName($packages, $_[0]) or return '';
+ install::pkgs::extractHeaders([$p], $packages);
my $imp = translate($install::pkgs::compssListDesc{$p->flag_base ? 5 : $p->rate});