summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorJustin Davis <jrcd83@gmail.com>2011-08-30 19:36:14 +0200
committerJustin Davis <jrcd83@gmail.com>2011-08-30 19:36:14 +0200
commit71e4b4382cae262daa445dd2f5b38a6d7cf4bbe5 (patch)
tree18ad49109ccda443243c9a6fc494fa594fb15eff /bin
parentf024964f207baaa22fb2fccf9e702c9704f6405c (diff)
downloadgenpkg-71e4b4382cae262daa445dd2f5b38a6d7cf4bbe5.tar.gz
genpkg-71e4b4382cae262daa445dd2f5b38a6d7cf4bbe5.tar.xz
Replace version string in source and _distdir with $pkgver.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/templ/perl-pkg10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/templ/perl-pkg b/bin/templ/perl-pkg
index a2bd171..3886a71 100755
--- a/bin/templ/perl-pkg
+++ b/bin/templ/perl-pkg
@@ -79,6 +79,10 @@ sub printpb
printf $PBBEG, $pkger, $pbvars->{'pbjver'}[0];
print "\n";
+ # Replace version string in first 'source' entry with $pkgver parameter.
+ my $ver = $pbvars->{'pkgver'}[0];
+ s/\Q$ver\E/\${pkgver}/g for $pbvars->{'source'}[0];
+
# 'pbfields' will recognize and PKGBUILD fields in the data
# and print them out in order, wordwrapping arrays.
open my $pbfields, '|pbfields' or die "failed to pipe to pbfields: $!";
@@ -88,7 +92,11 @@ sub printpb
print $pbfields "\n";
}
close $pbfields;
- print qq{_distdir="\$srcdir/$pbvars->{'distdir'}[0]"\n};
+
+ # Replace version string in _distdir with $pkgver parameter.
+ my $distdir = $pbvars->{'distdir'}[0];
+ $distdir =~ s/\Q$ver\E/\${pkgver}/;
+ print qq{_distdir="\${srcdir}/$distdir"\n};
print "\n";
for my $func (qw/build check package/) {