summaryrefslogtreecommitdiffstats
path: root/urpmq
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-06-05 10:03:07 +0000
committerFrancois Pons <fpons@mandriva.com>2002-06-05 10:03:07 +0000
commita14c5cbcfa2e46f67bcef28ee906da22fa3eee80 (patch)
treea52b040ca86d52f99ba31671aa3060aa675cf964 /urpmq
parent70b336cb4242e8d0e24768f6bc806dbad135ac33 (diff)
downloadurpmi-a14c5cbcfa2e46f67bcef28ee906da22fa3eee80.tar
urpmi-a14c5cbcfa2e46f67bcef28ee906da22fa3eee80.tar.gz
urpmi-a14c5cbcfa2e46f67bcef28ee906da22fa3eee80.tar.bz2
urpmi-a14c5cbcfa2e46f67bcef28ee906da22fa3eee80.tar.xz
urpmi-a14c5cbcfa2e46f67bcef28ee906da22fa3eee80.zip
3.4-3mdk
Diffstat (limited to 'urpmq')
-rwxr-xr-xurpmq33
1 files changed, 20 insertions, 13 deletions
diff --git a/urpmq b/urpmq
index 8cceb79f..e408b8a5 100755
--- a/urpmq
+++ b/urpmq
@@ -137,21 +137,28 @@ if (@src_names) {
or $query->{force} or exit 1;
}
-#- auto select package for upgrading the distribution.
-if ($query->{auto_select}) {
- my (%to_remove, %keep_files);
-
- $urpm->select_packages_to_upgrade($query->{root}, \%packages, \%to_remove, \%keep_files);
-
- if (keys(%to_remove) > 0) {
- $urpm->{error}(_("some packages have to be removed for being upgraded, this is not supported yet\n"));
+#- open/close of database should be moved here, in order to allow testing
+#- some bogus case and check for integrity.
+if ($query->{auto_select} || $query->{deps}) {
+ my $db = URPM::DB::open($root);
+ my $sig_handler = sub { undef $db; exit 3 };
+ local $SIG{INT} = $sig_handler;
+ local $SIG{QUIT} = $sig_handler;
+
+ #- auto select package for upgrading the distribution.
+ if ($query->{auto_select}) {
+ my (%to_remove, %keep_files);
+
+ $urpm->select_packages_to_upgrade($db, \%packages, \%to_remove, \%keep_files);
+
+ if (keys(%to_remove) > 0) {
+ $urpm->{error}(_("some packages have to be removed for being upgraded, this is not supported yet\n"));
+ }
}
-}
-#- filter to add in packages selected required packages.
-$query->{deps} and $urpm->filter_packages_to_upgrade(\%packages, undef,
- keep_alldeps => !$query->{upgrade},
- root => $query->{root});
+ #- filter to add in packages selected required packages.
+ $query->{deps} and $urpm->filter_packages_to_upgrade($db, \%packages, undef, keep_alldeps => !$query->{upgrade});
+}
#- get out of package that should not be upgraded.
$urpm->deselect_unwanted_packages(\%packages);