summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-06-18 11:52:52 +0000
committerFrancois Pons <fpons@mandriva.com>2003-06-18 11:52:52 +0000
commit29fd4fdafbcb730edc6cd5fd8b58db0aa83fd654 (patch)
tree65f661706ee956079de28e519e50058eb2133780 /urpm.pm
parentb2b5bb55bc004744a3b1183a4a1c3d9ee3d323a4 (diff)
downloadurpmi-29fd4fdafbcb730edc6cd5fd8b58db0aa83fd654.tar
urpmi-29fd4fdafbcb730edc6cd5fd8b58db0aa83fd654.tar.gz
urpmi-29fd4fdafbcb730edc6cd5fd8b58db0aa83fd654.tar.bz2
urpmi-29fd4fdafbcb730edc6cd5fd8b58db0aa83fd654.tar.xz
urpmi-29fd4fdafbcb730edc6cd5fd8b58db0aa83fd654.zip
4.4-3mdk
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm30
1 files changed, 25 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index 61a90075..9ed9bc69 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -426,7 +426,7 @@ sub read_config {
$no and $urpm->{options}{$k} = ! $urpm->{options}{$k} || 0;
}
next;
- } elsif (($k, $v) = /^(limit-rate|excludepath|key_ids)\s*:\s*(.*)$/) {
+ } elsif (($k, $v) = /^(limit-rate|excludepath|key_ids|split-(?:level|length))\s*:\s*(.*)$/) {
unless (exists($urpm->{options}{$k})) {
$v =~ /^'([^']*)'$/ and $v = $1; $v =~ /^"([^"]*)"$/ and $v = $1;
$urpm->{options}{$k} = $v;
@@ -2137,9 +2137,6 @@ sub resolve_dependencies {
}
#- let each node determine what is requested, according to handler given.
$urpm->{parallel_handler}->parallel_resolve_dependencies($file, @_);
-
- #- build simplest transaction (no split).
- $urpm->build_transaction_set(undef, $state, split_level => 0);
} else {
my $db;
@@ -2159,9 +2156,32 @@ sub resolve_dependencies {
$options{auto_select} and $urpm->request_packages_to_upgrade($db, $state, $requested, requested => undef);
$urpm->resolve_requested($db, $state, $requested, %options);
+ }
+}
+
+sub create_transaction {
+ my ($urpm, $state, %options) = @_;
+
+ if ($urpm->{parallel_handler} || !$options{split_length} || keys %{$state->{selected}} < $options{split_level}) {
+ #- build simplest transaction (no split).
+ $urpm->build_transaction_set(undef, $state, split_length => 0);
+ } else {
+ my $db;
+
+ if ($options{rpmdb}) {
+ $db = new URPM;
+ $db->parse_synthesis($options{rpmdb});
+ } else {
+ $db = URPM::DB::open($urpm->{root});
+ $db or $urpm->{fatal}(9, N("unable to open rpmdb"));
+ }
+
+ my $sig_handler = sub { undef $db; exit 3 };
+ local $SIG{INT} = $sig_handler;
+ local $SIG{QUIT} = $sig_handler;
#- build transaction set...
- $urpm->build_transaction_set($db, $state, %options);
+ $urpm->build_transaction_set($db, $state, split_length => $options{split_length});
}
}