summaryrefslogtreecommitdiffstats
path: root/RPM4/src/Makefile.PL
diff options
context:
space:
mode:
authortv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-06-26 18:14:37 +0000
committertv <tv@971eb68f-4bfb-0310-8326-d2484c010a4c>2012-06-26 18:14:37 +0000
commitbe117f5d783d1a4c8970e780e2a0fe321ea86818 (patch)
tree6e33fcd5af4ffc9c474b87c599fc47ed597eaaf9 /RPM4/src/Makefile.PL
parent7440e22e6bf1768d4e825c4576578fd357fa3e7f (diff)
downloadperl-RPM4-be117f5d783d1a4c8970e780e2a0fe321ea86818.tar
perl-RPM4-be117f5d783d1a4c8970e780e2a0fe321ea86818.tar.gz
perl-RPM4-be117f5d783d1a4c8970e780e2a0fe321ea86818.tar.bz2
perl-RPM4-be117f5d783d1a4c8970e780e2a0fe321ea86818.tar.xz
perl-RPM4-be117f5d783d1a4c8970e780e2a0fe321ea86818.zip
perl_checker cleanups, thus fixing --rpmversion (broken for 6+ years...)
(broken since commit introduced in r51 on 2005-12-14 by nanardon, aka it never worked... git-svn-id: svn+ssh://haiku.zarb.org/home/projects/rpm4/svn/trunk@227 971eb68f-4bfb-0310-8326-d2484c010a4c
Diffstat (limited to 'RPM4/src/Makefile.PL')
-rw-r--r--RPM4/src/Makefile.PL19
1 files changed, 10 insertions, 9 deletions
diff --git a/RPM4/src/Makefile.PL b/RPM4/src/Makefile.PL
index bbf7240..5b28941 100644
--- a/RPM4/src/Makefile.PL
+++ b/RPM4/src/Makefile.PL
@@ -4,6 +4,7 @@
use ExtUtils::MakeMaker;
use Getopt::Long;
+my $rpmv;
GetOptions(
'rpmversion=s' => \$rpmv,
'rebuildh' => \my $rebh,
@@ -23,10 +24,10 @@ foreach (qw(
$rpmheaderlocation or die "Can't find rpmheader location";
-my $rpmv ||= (`rpm --version` =~ /([\d\.]+)/)[0];
-open($FH, "> rpmversion.h") or die "Can't open rpmversion.h";
+$rpmv ||= (`rpm --version` =~ /([\d\.]+)/)[0];
+open(my $FH, "> rpmversion.h") or die "Can't open rpmversion.h";
print $FH "/* File generated by Mafile.PL\n";
-print $FH ' * $Id$' ."\n";
+print $FH ' * $Id$' . "\n";
print $FH " */\n\n";
print $FH "#ifndef RPMVERSION_H\n#define RPMVERSION_H\n\n";
foreach (qw(
@@ -37,14 +38,14 @@ foreach (qw(
4.9.1.1
4.9.1.2
)) {
- $v = $_;
+ my $v = $_;
$v =~ s/\./_/g;
print $FH "#define RPM$v\n";
$rpmv =~ /^\Q$_/ and last;
}
print $FH "\n#endif\n";
close($FH);
-if ($rebh) { exit 0 };
+exit 0 if $rebh;
my @rpmconstantfiles = qw(
rpmconstant.c
@@ -58,7 +59,7 @@ my ($obj, $ldd, $fl) =
('', '-lrpmconstant', '-DHAVE_RPMCONSTANT') :
('rpmconstant.o rpmconstant_internal.o rpmconstanttbl.o', '', '');
-sub MY::postamble {
+sub MY::postamble() {
my $first = <<RPMCONSTTBL;
rpmversion.h:
\$(PERL) Makefile.PL --rebuildh
@@ -71,14 +72,14 @@ RPMCONSTTBL
# in fact it is only usefull for the maintainers of this module
# if you get the module from CPAN, those files are already here
# if you're building from svn, you need rpmconstant directory
- my $second = "copyrpmconstant: " . join(" ", @rpmconstantfiles) ."\n\n";
- if(-d '../../rpmconstant') {
+ my $second = "copyrpmconstant: " . join(" ", @rpmconstantfiles) . "\n\n";
+ if (-d '../../rpmconstant') {
foreach (@rpmconstantfiles) {
$second .= "$_: ../../rpmconstant/$_\n\tcp -a \$< \$@\n\n";
}
}
- $first . $second
+ $first . $second;
}
WriteMakefile(