summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-01-30 17:48:05 +0000
committerThierry Vignaud <tv@mageia.org>2012-01-30 17:48:05 +0000
commitee8784f4fee8e330f86fd75c327ba72cfe2c91da (patch)
tree87c679cbf1757b830efd572082ad20e3c515824b
parent8aa0f8aa93cebc0d74f46cb575622649f83ed502 (diff)
downloadperl_checker-ee8784f4fee8e330f86fd75c327ba72cfe2c91da.tar
perl_checker-ee8784f4fee8e330f86fd75c327ba72cfe2c91da.tar.gz
perl_checker-ee8784f4fee8e330f86fd75c327ba72cfe2c91da.tar.bz2
perl_checker-ee8784f4fee8e330f86fd75c327ba72cfe2c91da.tar.xz
perl_checker-ee8784f4fee8e330f86fd75c327ba72cfe2c91da.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) = @_ }
-rwxr-xr-xfake_packages/gen.pl8
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";
}