aboutsummaryrefslogtreecommitdiffstats
path: root/Rpmdrake/rpmnew.pm
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2007-02-22 11:32:00 +0000
committerThierry Vignaud <tv@mandriva.org>2007-02-22 11:32:00 +0000
commit5f636c6e652a7b13455681e92a5a3b8ad88425e9 (patch)
treed73049fb2c57f1d40d8f30b1e0b6353527612123 /Rpmdrake/rpmnew.pm
parentf18e3eac4782e156ab18f95b47b9000c03f8a80a (diff)
downloadrpmdrake-5f636c6e652a7b13455681e92a5a3b8ad88425e9.tar
rpmdrake-5f636c6e652a7b13455681e92a5a3b8ad88425e9.tar.gz
rpmdrake-5f636c6e652a7b13455681e92a5a3b8ad88425e9.tar.bz2
rpmdrake-5f636c6e652a7b13455681e92a5a3b8ad88425e9.tar.xz
rpmdrake-5f636c6e652a7b13455681e92a5a3b8ad88425e9.zip
(Rpmdrake::rpmnew::do_merge_if_needed) move code that lookup *.rpm{new,save} here
Diffstat (limited to 'Rpmdrake/rpmnew.pm')
-rwxr-xr-xRpmdrake/rpmnew.pm23
1 files changed, 22 insertions, 1 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;