diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-01-30 17:48:05 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-01-30 17:48:05 +0000 |
commit | 171d0bcbb0e42b0cacd197ca4705c381f712fe7b (patch) | |
tree | 87c679cbf1757b830efd572082ad20e3c515824b /fake_packages | |
parent | c84e02b58babf893d1c63eae4a090a75902293ea (diff) | |
download | perl_checker-171d0bcbb0e42b0cacd197ca4705c381f712fe7b.tar perl_checker-171d0bcbb0e42b0cacd197ca4705c381f712fe7b.tar.gz perl_checker-171d0bcbb0e42b0cacd197ca4705c381f712fe7b.tar.bz2 perl_checker-171d0bcbb0e42b0cacd197ca4705c381f712fe7b.tar.xz perl_checker-171d0bcbb0e42b0cacd197ca4705c381f712fe7b.zip |
(get_paras) do not rename *__XS functions anymore
copy their signatures to their perl wrappers so that they got signatures
too (now that we parse the .pm files too) instead of shadowing the perl
function with no signatures
eg:
-sub parse_hdlist() {}
+sub parse_hdlist { my ($_urpm, $_filename, @_more_paras) = @_ }
Diffstat (limited to 'fake_packages')
-rwxr-xr-x | fake_packages/gen.pl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fake_packages/gen.pl b/fake_packages/gen.pl index f65c3e6..acedc93 100755 --- a/fake_packages/gen.pl +++ b/fake_packages/gen.pl @@ -123,7 +123,7 @@ my ($pkg_name, $dir) = @ARGV; my @xs_files = chomp_(`find $dir -name "*.xs"`); # ignore test suites, inc/ and ext/ : my @pm_files = chomp_(`find $dir -name "*.pm" | egrep -v '/(ext|inc|t)/'`); -@ARGV == 2 && @xs_files or die "usage: gen.pl <Gtk2 or Glib> <dir where Gtk2's or Glib's *.xs are>\n"; +@ARGV == 2 && (@xs_files || @pm_files) or die "usage: gen.pl <Gtk2 or Glib> <dir where Gtk2's or Glib's *.xs are>\n"; parse_xs($_) foreach @xs_files; parse_pm($_) foreach @pm_files; @@ -134,11 +134,13 @@ foreach my $pkg (sort keys %l) { print "\npackage $pkg;\n"; print "our \@ISA = qw();\n"; foreach my $name (sort keys %{$l{$pkg}}) { - my $para = $l{$pkg}{$name}; + my $xs_name = $name . "__XS"; + my $para = $l{$pkg}{$xs_name} || $l{$pkg}{$name}; $name = $pkg . '::' . $name if $name =~ /^(ne|eq|foreach|format|ge|length|sub|x|xor|y)$/; - $name =~ s/__XS$//; # fix for URPM if (@$para) { print "sub $name { my (", join(", ", @$para), ") = \@_ }\n"; + } elsif ($name =~ /\(/) { + print "sub $name {}\n"; } else { print "sub $name() {}\n"; } |