git: f9b2b613c45c - main - math/octave-forge-base: Allow more complex portversions for packages.

From: Stephen Montgomery-Smith <stephen_at_FreeBSD.org>
Date: Sat, 05 Nov 2022 21:37:30 UTC
The branch main has been updated by stephen:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f9b2b613c45cf8b0971dc8ddc4aea81da8ff3146

commit f9b2b613c45cf8b0971dc8ddc4aea81da8ff3146
Author:     Stephen Montgomery-Smith <stephen@FreeBSD.org>
AuthorDate: 2022-11-05 21:32:56 +0000
Commit:     Stephen Montgomery-Smith <stephen@FreeBSD.org>
CommitDate: 2022-11-05 21:32:56 +0000

    math/octave-forge-base: Allow more complex portversions for packages.
    
    Update to 1.8.
---
 math/octave-forge-base/Makefile                 |  2 +-
 math/octave-forge-base/files/load-octave-pkg.in | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/math/octave-forge-base/Makefile b/math/octave-forge-base/Makefile
index ae95ac1c321a..e08bbfcc26f4 100644
--- a/math/octave-forge-base/Makefile
+++ b/math/octave-forge-base/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	octave-forge-base
-PORTVERSION=	1.7
+PORTVERSION=	1.8
 CATEGORIES=	math
 MASTER_SITES=	#none
 DISTFILES=	#none
diff --git a/math/octave-forge-base/files/load-octave-pkg.in b/math/octave-forge-base/files/load-octave-pkg.in
index 343d0b418caa..fc0a9876b2f9 100644
--- a/math/octave-forge-base/files/load-octave-pkg.in
+++ b/math/octave-forge-base/files/load-octave-pkg.in
@@ -123,8 +123,8 @@ $nr_to_remove = 0;
 foreach my $p (keys %is_installed) {
   if (defined($is_installed{$p})) {
     my $altp = $p; # so that 3.5.0 and 3.5 are the same package numbers
-    $altp =~ s/(\-\d+\.\d+)\.0(\.tar\.gz)$/$1$2/ || 
-    $altp =~ s/(\-\d+\.\d+)(\.tar\.gz)$/$1\.0$2/;
+    $altp =~ s/(\-\d+\.\d+[^\.]*)\.0(\.tar\.gz)$/$1$2/ || 
+    $altp =~ s/(\-\d+\.\d+[^\.]*)(\.tar\.gz)$/$1\.0$2/;
     if (!defined($in_tarballs{$p}) && !defined($in_tarballs{$altp})) {
       $to_remove{$p} = $is_installed{$p};
       $nr_to_remove++;
@@ -158,7 +158,7 @@ if ($nr_to_remove>0) {
 
   foreach my $p (@ordered_list_to_remove) {
     print "load-octave-pkg: octave is uninstalling $p.\n";
-    $p =~ s/\-[\d\.]+\.tar\.gz//;
+    $p =~ s/\-[^\-]+\.tar\.gz//;
     system "octave-cli -W -H -q --no-site-file --eval \"pkg('uninstall','$p')\" > /dev/null";
   }
 }
@@ -185,8 +185,8 @@ while (my $p = <$install_prefix/*>) {
 %to_install = ();
 foreach my $n (keys %in_tarballs) {
   my $altn = $n; # so that 3.5 and 3.5.0 are the same package numbers
-  $altn =~ s/(\-\d+\.\d+)(\.tar\.gz)$/$1\.0$2/ ||
-  $altn =~ s/(\-\d+\.\d+)\.0(\.tar\.gz)$/$1$2/;
+  $altn =~ s/(\-\d+\.\d+[^\.]*)(\.tar\.gz)$/$1\.0$2/ ||
+  $altn =~ s/(\-\d+\.\d+[^\.]*)\.0(\.tar\.gz)$/$1$2/;
   if (defined($in_tarballs{$n})) {
     if (!defined($is_installed{$n}) && !defined($is_installed{$altn})) {
       my $tar = Archive::Tar->new("$tardir/$n",COMPRESS_GZIP);