summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;