aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2007-08-10 17:50:46 +0000
committerPascal Rigaux <pixel@mandriva.com>2007-08-10 17:50:46 +0000
commitff1b2dafd0e2a3ea2d15efb3e626d994aa655f93 (patch)
treecf42ae0bdbc492254c60e5d75ad2d8bfdc3b4524
parentec87001206a2408b7d926f7c9d9327fe15ba5b80 (diff)
downloadperl-URPM-ff1b2dafd0e2a3ea2d15efb3e626d994aa655f93.tar
perl-URPM-ff1b2dafd0e2a3ea2d15efb3e626d994aa655f93.tar.gz
perl-URPM-ff1b2dafd0e2a3ea2d15efb3e626d994aa655f93.tar.bz2
perl-URPM-ff1b2dafd0e2a3ea2d15efb3e626d994aa655f93.tar.xz
perl-URPM-ff1b2dafd0e2a3ea2d15efb3e626d994aa655f93.zip
- modify parse_hdlist so that partial hdlist reading can be used
(needed when some stuff is already done in the callback)
-rw-r--r--NEWS3
-rw-r--r--URPM.pm7
2 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index b956a00..656ee0c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,6 @@
+- modify parse_hdlist so that partial hdlist reading can be used
+ (needed when some stuff is already done in the callback)
+
Version 1.71 - 9 August 2007, by Pascal "Pixel" Rigaux
- compilation fixes on rpm < 4.4.8
diff --git a/URPM.pm b/URPM.pm
index c1118d4..9d56f1d 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -169,13 +169,18 @@ sub parse_hdlist_or_synthesis {
my $previous_indice = @{$urpm->{depslist}};
if (my ($start, $end) = $parse_func->($urpm, $file, %options)) {
($start, $end);
- } else {
+ } elsif (!$options{callback}) {
#- parse_hdlist__XS may have added some pkgs to {depslist},
#- but we don't want those pkgs since reading hdlist failed later.
#- so we need to drop them
#- FIXME: {provides} would need to be reverted too!
splice(@{$urpm->{depslist}}, $previous_indice);
();
+ } else {
+ #- we need to keep them since the callback has been used
+ #- and we can't pretend we didn't parse anything
+ #- (needed for genhdlist2)
+ ();
}
}
sub parse_synthesis { parse_hdlist_or_synthesis(\&parse_synthesis__XS, @_) }