diff options
-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"; } |