aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xRpmdrake/rpmnew.pm23
-rwxr-xr-xrpmdrake15
2 files changed, 23 insertions, 15 deletions
diff --git a/Rpmdrake/rpmnew.pm b/Rpmdrake/rpmnew.pm
index 9d0781c1..75a61464 100755
--- a/Rpmdrake/rpmnew.pm
+++ b/Rpmdrake/rpmnew.pm
@@ -27,11 +27,14 @@ use strict;
use lib qw(/usr/lib/libDrakX);
use common;
use rpmdrake;
+use Rpmdrake::init;
+use Rpmdrake::pkg;
+use Rpmdrake::formatting;
use mygtk2 qw(gtknew); #- do not import anything else, especially gtkadd() which conflicts with ugtk2 one
use ugtk2 qw(:all);
use Exporter;
our @ISA = qw(Exporter);
-our @EXPORT = qw(dialog_rpmnew);
+our @EXPORT = qw(do_merge_if_needed);
# /var/lib/nfs/etab /var/lib/nfs/rmtab /var/lib/nfs/xtab /var/cache/man/whatis
my %ignores_rpmnew = map { $_ => 1 } qw(
@@ -159,4 +162,22 @@ sub dialog_rpmnew {
return 0;
}
+
+sub do_merge_if_needed() {
+ if ($options{'merge-all-rpmnew'}) {
+ my %pkg2rpmnew;
+ my $wait = wait_msg(N("Please wait, searching..."));
+ print "Searching .rpmnew and .rpmsave files...\n";
+ $Rpmdrake::pkg::db->traverse(sub {
+ my $n = my_fullname($_[0]);
+ $pkg2rpmnew{$n} = [ grep { m|^/etc| && (-r "$_.rpmnew" || -r "$_.rpmsave") } map { chomp_($_) } $_[0]->files ];
+ });
+ print "done.\n";
+ undef $wait;
+ $typical_width = 330;
+ dialog_rpmnew('', %pkg2rpmnew) and print "Nothing to do.\n";
+ myexit(0);
+ }
+}
+
1;
diff --git a/rpmdrake b/rpmdrake
index 5d667393..fa8e5e58 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -540,20 +540,7 @@ sub run_treeview_dialog {
# -=-=-=---=-=-=---=-=-=-- main -=-=-=---=-=-=---=-=-=-
-if ($options{'merge-all-rpmnew'}) {
- my %pkg2rpmnew;
- my $wait = wait_msg(N("Please wait, searching..."));
- print "Searching .rpmnew and .rpmsave files...\n";
- $db->traverse(sub {
- my $n = my_fullname($_[0]);
- $pkg2rpmnew{$n} = [ grep { m|^/etc| && (-r "$_.rpmnew" || -r "$_.rpmsave") } map { chomp_($_) } $_[0]->files ];
- });
- print "done.\n";
- undef $wait;
- $typical_width = 330;
- dialog_rpmnew('', %pkg2rpmnew) and print "Nothing to do.\n";
- myexit(0);
-}
+do_merge_if_needed();
readconf();