summaryrefslogtreecommitdiffstats
path: root/bin/templ/perl-pkg
diff options
context:
space:
mode:
Diffstat (limited to 'bin/templ/perl-pkg')
-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/) {