summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Legge <timlegge@gmail.com>2020-03-24 23:38:09 +0000
committerTimothy Legge <timlegge@gmail.com>2020-03-27 02:02:24 +0000
commitaaf56ec1021d05b6f2dc63666087eb55f8547b18 (patch)
tree40cf5d9b943eee949e9ce18ea337ef54f1e84336
parent6670e9479da26898a2ed6996064ae647f82fe1c3 (diff)
apkbuild-cpan.in: reset the pkgrel if the pkgver changes on recreate
-rwxr-xr-xapkbuild-cpan.in6
1 files changed, 6 insertions, 0 deletions
diff --git a/apkbuild-cpan.in b/apkbuild-cpan.in
index a251c9d..fab4e51 100755
--- a/apkbuild-cpan.in
+++ b/apkbuild-cpan.in
@@ -439,6 +439,12 @@ given ( $ARGV[0] ) {
when ("recreate") {
#TODO: likely should keep pkgrel the same on recreate
my ($apkbuild, $distdata, $moddata) = get_data;
+ my $pkgver = $moddata->{version} =~ s/^[^0-9]+//r;
+ if ($pkgver ne $apkbuild->{pkgver}) {
+ #Reset pkgrel on upgrade on recreate
+ say "Upgrading CPAN module from $apkbuild->{pkgver} to $pkgver";
+ $apkbuild->{pkgrel}=0;
+ }
write_apkbuild($distdata, $apkbuild->{authors}, $moddata);
prepare_tree;
update_functions;