apkbuild-cpan.in: reset the pkgrel if the pkgver changes on recreate

This commit is contained in:
Timothy Legge 2020-03-24 23:38:09 +00:00
parent 6670e9479d
commit aaf56ec102

View File

@ -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;