aboutsummaryrefslogtreecommitdiffstats
path: root/URPM.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-15 11:49:00 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-15 11:49:00 +0000
commit2a353c054d97436a52ac5d558558da7a7d5d45f3 (patch)
treebe8e99a5b4a1697439bc22e1c12a6b3a09087711 /URPM.pm
parentb3955aba69dc59ee4e0295a0bfaa37662c379799 (diff)
downloadperl-URPM-2a353c054d97436a52ac5d558558da7a7d5d45f3.tar
perl-URPM-2a353c054d97436a52ac5d558558da7a7d5d45f3.tar.gz
perl-URPM-2a353c054d97436a52ac5d558558da7a7d5d45f3.tar.bz2
perl-URPM-2a353c054d97436a52ac5d558558da7a7d5d45f3.tar.xz
perl-URPM-2a353c054d97436a52ac5d558558da7a7d5d45f3.zip
add a wrapper in perl around parse_hdlist and parse_synthesis
Diffstat (limited to 'URPM.pm')
-rw-r--r--URPM.pm17
1 files changed, 17 insertions, 0 deletions
diff --git a/URPM.pm b/URPM.pm
index 9169e18..012f69c 100644
--- a/URPM.pm
+++ b/URPM.pm
@@ -158,6 +158,23 @@ sub traverse_tag {
$count;
}
+sub parse_hdlist_or_synthesis {
+ my ($parse_func, $urpm, $file, %options) = @_;
+
+ my $previous_indice = @{$urpm->{depslist}};
+ if (my ($start, $end) = $parse_func->($urpm, $file, %options)) {
+ ($start, $end);
+ } else {
+ #- 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
+ splice(@{$urpm->{depslist}}, $previous_indice);
+ ();
+ }
+}
+sub parse_synthesis { parse_hdlist_or_synthesis(\&parse_synthesis__XS, @_) }
+sub parse_hdlist { parse_hdlist_or_synthesis(\&parse_hdlist__XS, @_) }
+
sub add_macro {
my ($s) = @_;
#- quote for rpmlib, *sigh*