summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2002-07-23 14:23:07 +0000
committerFrancois Pons <fpons@mandriva.com>2002-07-23 14:23:07 +0000
commit4bb66517e0d376670d9499e8afb72c9cbb7765e4 (patch)
tree9a6fbb6b4926780b638d5bb62744055bdd2975fe /urpm.pm
parentbaf646d6ee859baef78b1bd11939a953b64be7c9 (diff)
downloadurpmi-4bb66517e0d376670d9499e8afb72c9cbb7765e4.tar
urpmi-4bb66517e0d376670d9499e8afb72c9cbb7765e4.tar.gz
urpmi-4bb66517e0d376670d9499e8afb72c9cbb7765e4.tar.bz2
urpmi-4bb66517e0d376670d9499e8afb72c9cbb7765e4.tar.xz
urpmi-4bb66517e0d376670d9499e8afb72c9cbb7765e4.zip
added callback for configure method used by new rpmdrake.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm31
1 files changed, 24 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index ffe4bbfe..4bd6f187 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -542,13 +542,30 @@ sub configure {
}
foreach (grep { !$_->{ignore} && (!$options{update} || $_->{update}) } @{$urpm->{media} || []}) {
delete @{$_}{qw(start end)};
- if (-s "$urpm->{statedir}/synthesis.$_->{hdlist}" > 32) {
- $urpm->{log}(_("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$_->{hdlist}"));
- eval { ($_->{start}, $_->{end}) = $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$_->{hdlist}") };
- }
- unless (defined $_->{start} && defined $_->{end}) {
- $urpm->{error}(_("problem reading synthesis file of medium \"%s\"", $_->{name}));
- $_->{ignore} = 1;
+ if ($options{callback_pkg}) {
+ if (-s "$urpm->{statedir}/$_->{hdlist}" > 32) {
+ $urpm->{log}(_("examining hdlist file [%s]", "$urpm->{statedir}/$_->{hdlist}"));
+ eval { ($_->{start}, $_->{end}) = $urpm->parse_hdlist("$urpm->{statedir}/$_->{hdlist}", 0) };
+ }
+ unless (defined $_->{start} && defined $_->{end}) {
+ $urpm->{error}(_("problem reading hdlist file of medium \"%s\"", $_->{name}));
+ $_->{ignore} = 1;
+ } else {
+ #- medium has been read correclty, now call the callback for each packages.
+ #- it is the responsability of callback to pack the header.
+ foreach ($_->{start} .. $_->{end}) {
+ $options{callback}->($urpm, $_, %options);
+ }
+ }
+ } else {
+ if (-s "$urpm->{statedir}/synthesis.$_->{hdlist}" > 32) {
+ $urpm->{log}(_("examining synthesis file [%s]", "$urpm->{statedir}/synthesis.$_->{hdlist}"));
+ eval { ($_->{start}, $_->{end}) = $urpm->parse_synthesis("$urpm->{statedir}/synthesis.$_->{hdlist}") };
+ }
+ unless (defined $_->{start} && defined $_->{end}) {
+ $urpm->{error}(_("problem reading synthesis file of medium \"%s\"", $_->{name}));
+ $_->{ignore} = 1;
+ }
}
}
}