aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-11-05 13:42:48 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-11-05 13:42:48 +0000
commit74f50445dcc90bca88bd6e403fe1cc0395863833 (patch)
tree84b742bc2b292c9ed49160e483e174c046cd4197
parentf91f32f83d5defda2fb1daa134394ae54b1e1ff7 (diff)
downloadrpmdrake-74f50445dcc90bca88bd6e403fe1cc0395863833.tar
rpmdrake-74f50445dcc90bca88bd6e403fe1cc0395863833.tar.gz
rpmdrake-74f50445dcc90bca88bd6e403fe1cc0395863833.tar.bz2
rpmdrake-74f50445dcc90bca88bd6e403fe1cc0395863833.tar.xz
rpmdrake-74f50445dcc90bca88bd6e403fe1cc0395863833.zip
Make the changelog-first option configurable in ~/.rpmdrake (cf bug 11888)
-rwxr-xr-xrpmdrake21
-rw-r--r--rpmdrake.pm28
2 files changed, 24 insertions, 25 deletions
diff --git a/rpmdrake b/rpmdrake
index 613f0318..bd7541dc 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -87,11 +87,12 @@ foreach (@ARGV) {
$::isStandalone = 1;
my $w;
+my $changelog_first;
+
sub interactive_msg_ { interactive_msg(@_, if_(exists $w->{rwindow}, transient => $w->{rwindow})) };
sub interactive_list_ { interactive_list(@_, if_(exists $w->{rwindow}, transient => $w->{rwindow})) };
sub wait_msg_ { wait_msg(@_, if_(exists $w->{rwindow}, transient => $w->{rwindow})) };
-
$> and (interactive_msg_(N("Running in user mode"),
N("You are launching this program as a normal user.
You will not be able to perform modifications on the system,
@@ -693,7 +694,7 @@ or you already installed all of them."));
[ pkg2medium($pkgs->{$key}{pkg}, $urpm)->{name} ], [ "\n" ],
[ N("Currently installed version: "), $tag_tag ],
[ find_installed_version($pkgs->{$key}{pkg}) ], [ "\n" ]));
- my @max_info = if_(@$max_info_in_descr, $options{'changelog-first'}
+ my @max_info = if_(@$max_info_in_descr, $changelog_first
? (@chglo, [ "\n" ], @files)
: (@files, [ "\n\n" ], @chglo));
[ [ N("Name: "), $tag_tag ], [ "$name\n" ],
@@ -997,14 +998,11 @@ Is it ok to continue?",
1, 2, 0, 1, 'fill', 'fill', 0, 0);
my $hpaned = Gtk2::HPaned->new;
-
- my $tree_window = create_scrolled_window($tree);
- $hpaned->pack1(gtkadd(gtkset_shadow_type(Gtk2::Frame->new, 'in'),
- gtkset_size_request($tree_window, $typical_width*1.25, -1)), 0, 0);
-
- my $info_window = create_scrolled_window($info);
- $hpaned->pack2($info_window, 1, 0);
-
+ $hpaned->pack1(gtkadd(
+ gtkset_shadow_type(Gtk2::Frame->new, 'in'),
+ gtkset_size_request(create_scrolled_window($tree), $typical_width*1.25, -1)
+ ), 0, 0);
+ $hpaned->pack2(create_scrolled_window($info), 1, 0);
$table->attach($hpaned, 0, 2, 1, 2, ['expand', 'fill'], ['expand', 'fill'], 0, 0);
my %mode2title = (
@@ -1570,8 +1568,9 @@ if ($options{'merge-all-rpmnew'}) {
myexit(0);
}
-
readconf();
+$changelog_first = $changelog_first_config->[0];
+$changelog_first = 1 if $options{'changelog-first'};
if (!$> && !member($MODE, @$already_splashed)) {
interactive_msg(N("Rpmdrake"),
diff --git a/rpmdrake.pm b/rpmdrake.pm
index 23905c92..d8b70ebc 100644
--- a/rpmdrake.pm
+++ b/rpmdrake.pm
@@ -31,16 +31,14 @@ use URPM;
use URPM::Resolve;
use packdrake;
use strict;
-use vars qw(@ISA @EXPORT $configfile %config $mandrakeupdate_wanted_categories $already_splashed $max_info_in_descr $tree_mode $tree_flat $typical_width);
use log;
use c;
use curl_download;
-@ISA = qw(Exporter);
-@EXPORT = qw(
- $configfile
- %config
+our @ISA = qw(Exporter);
+our @EXPORT = qw(
+ $changelog_first_config
$mandrakeupdate_wanted_categories
$already_splashed
$max_info_in_descr
@@ -72,7 +70,7 @@ use curl_download;
add_medium_and_check
check_update_media_version
);
-
+our $typical_width;
eval { require ugtk2; ugtk2->import(qw(:all)) };
if ($@) {
@@ -124,16 +122,18 @@ sub myexit { ugtk2::exit(undef, @_) }
$ENV{HOME} ||= '/root';
+our $configfile = "$ENV{HOME}/.rpmdrake";
+our %config = (
+ mandrakeupdate_wanted_categories => { var => \our $mandrakeupdate_wanted_categories, default => [ qw(security) ] },
+ already_splashed => { var => \our $already_splashed, default => [] },
+ max_info_in_descr => { var => \our $max_info_in_descr, default => [] },
+ tree_mode => { var => \our $tree_mode, default => [ qw(mandrake_choices) ] },
+ tree_flat => { var => \our $tree_flat, default => [ 0 ] },
+ changelog_first_config => { var => \our $changelog_first_config, default => [ 0 ] },
+);
+
sub readconf {
- $configfile = "$ENV{HOME}/.rpmdrake";
- %config = (mandrakeupdate_wanted_categories => { var => \$mandrakeupdate_wanted_categories, default => [ qw(security) ] },
- already_splashed => { var => \$already_splashed, default => [] },
- max_info_in_descr => { var => \$max_info_in_descr, default => [] },
- tree_mode => { var => \$tree_mode, default => [ qw(mandrake_choices) ] },
- tree_flat => { var => \$tree_flat, default => [ 0 ] },
- );
${$config{$_}{var}} = $config{$_}{default} foreach keys %config;
-
foreach my $l (cat_($configfile)) {
$l =~ /^\Q$_\E (.*)/ and ${$config{$_}{var}} = [ split ' ', $1 ] foreach keys %config;
}