summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--RPM4/Makefile.PL2
-rw-r--r--RPM4/NEWS1
-rw-r--r--RPM4/src/Makefile.PL19
3 files changed, 12 insertions, 10 deletions
diff --git a/RPM4/Makefile.PL b/RPM4/Makefile.PL
index ae25c32..0aad8cb 100644
--- a/RPM4/Makefile.PL
+++ b/RPM4/Makefile.PL
@@ -11,7 +11,7 @@ $rpm_version ge 4.8.0
Unable to build RPM4 with too old (or undetected) rpm version $rpm_version
BARF
-sub MY::postamble {
+sub MY::postamble() {
<<MAKECHANGELOG;
.PHONY: ChangeLog copyrpmconstant
diff --git a/RPM4/NEWS b/RPM4/NEWS
index a17503f..2c2fdbd 100644
--- a/RPM4/NEWS
+++ b/RPM4/NEWS
@@ -1,4 +1,5 @@
- fix srcrpm()
+- fix --rpmversion (broken for 6+ years...)
Version 0.31 - 25 June 2012
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(