pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_notify pkg_notify: update to 0.4.8.



details:   https://anonhg.NetBSD.org/pkgsrc/rev/91f56a501c67
branches:  trunk
changeset: 439533:91f56a501c67
user:      wiz <wiz%pkgsrc.org@localhost>
date:      Sun Sep 20 11:25:41 2020 +0000

description:
pkg_notify: update to 0.4.8.

Fix improved github handling.

diffstat:

 pkgtools/pkg_notify/Makefile         |   7 +--
 pkgtools/pkg_notify/files/pkg_notify |  64 +++++++++++++++++++++++------------
 2 files changed, 44 insertions(+), 27 deletions(-)

diffs (126 lines):

diff -r ff7532189e37 -r 91f56a501c67 pkgtools/pkg_notify/Makefile
--- a/pkgtools/pkg_notify/Makefile      Sun Sep 20 11:14:08 2020 +0000
+++ b/pkgtools/pkg_notify/Makefile      Sun Sep 20 11:25:41 2020 +0000
@@ -1,7 +1,6 @@
-# $NetBSD: Makefile,v 1.32 2020/08/31 18:10:58 wiz Exp $
+# $NetBSD: Makefile,v 1.33 2020/09/20 11:25:41 wiz Exp $
 
-PKGNAME=       pkg_notify-0.4.7
-PKGREVISION=   1
+PKGNAME=       pkg_notify-0.4.8
 CATEGORIES=    pkgtools
 
 MAINTAINER=    imil%gcu.info@localhost
@@ -23,7 +22,7 @@
 .include "../../mk/bsd.prefs.mk"
 
 SUBST_CLASSES+=                        pkg_notify
-SUBST_STAGE.pkg_notify=                pre-install
+SUBST_STAGE.pkg_notify=                build
 SUBST_FILES.pkg_notify=                pkg_notify
 SUBST_FILES.pkg_notify+=       pkg_notify.1
 SUBST_VARS.pkg_notify=         PKGSRCDIR
diff -r ff7532189e37 -r 91f56a501c67 pkgtools/pkg_notify/files/pkg_notify
--- a/pkgtools/pkg_notify/files/pkg_notify      Sun Sep 20 11:14:08 2020 +0000
+++ b/pkgtools/pkg_notify/files/pkg_notify      Sun Sep 20 11:25:41 2020 +0000
@@ -16,7 +16,7 @@
 #
 # $ pkg_notify category/package
 #
-# $Id: pkg_notify,v 1.6 2020/08/24 13:43:41 wiz Exp $
+# $Id: pkg_notify,v 1.7 2020/09/20 11:25:41 wiz Exp $
 
 use Net::FTP;
 use LWP::UserAgent;
@@ -125,7 +125,6 @@
        my $wasbad = 0;
 
        if ($line =~ /([^0-9a-z]$dist|^$dist)([^\/\"<>\@]+)$extract_sufx/) {
-
            $realdist = $dist.$2.$extract_sufx;
            my $lsvers = $2;
 
@@ -494,6 +493,33 @@
 # used to record last connection
 my $last_master_host = "";
 
+sub compute_dist_and_version {
+    my ($major, $minor, $distname) = @_;
+
+    my $nostrip = 0;
+    # nice archive, has a comprehensive versioning
+    if (defined($minor) && ($distname =~ /(.+?)($major[\._]?$minor.*$)/)) {
+       $dist = $1;
+       $version = $2;
+       $nicearc = 1;
+       # archive appears to only have a major
+    } elsif (defined($major) && ($distname =~ /(.+)($major.*)/)) {
+       $dist = $1;
+       $version = $2;
+       # ok, archive versioning is a pure mess
+       # assume version is everything not being PKGNAME
+    } else {
+       $dist = $pkgname;
+       $version = $distname;
+       $version =~ s/$pkgname//;
+
+       # don't strip extensions
+       $nostrip = 1;
+    }
+
+    return $nostrip;
+}
+    
 foreach (@packages) {
     chomp;
 
@@ -522,26 +548,7 @@
     # will we strip version numbers from extensions ?
     my $nostrip = 0;
 
-    $nicearc = 0;
-    # nice archive, has a comprehensive versioning
-    if (defined($minor) && ($distname =~ /(.+?)($major[\._]?$minor.*$)/)) {
-       $dist = $1;
-       $version = $2;
-       $nicearc = 1;
-       # archive appears to only have a major
-    } elsif (defined($major) && ($distname =~ /(.+)($major.*)/)) {
-       $dist = $1;
-       $version = $2;
-       # ok, archive versioning is a pure mess
-       # assume version is everything not being PKGNAME
-    } else {
-       $dist = $pkgname;
-       $version = $distname;
-       $version =~ s/$pkgname//;
-
-       # don't strip extensions
-       $nostrip = 1;
-    }
+    $nostrip = compute_dist_and_version($major, $minor, $distname);
 
     # MASTER_SITES is MASTER_SITE_LOCAL, skip
     if (file_rx_check("$pkgpath/Makefile",
@@ -587,9 +594,20 @@
            # homepage only - look at releases page
            $master_site = $homepage . "/releases/";
        }
+       my $olddistname = $distname;
+       # override distname, which is usually a nicer package name version
        $distname = `cd $pkgpath && $make show-var VARNAME=GITHUB_RELEASE`;
        chomp($distname);
-       $dist = "";
+       if ($distname eq "") {
+           $distname = `cd $pkgpath && $make show-var VARNAME=GITHUB_TAG`;
+           chomp($distname);
+       }
+       if ($distname eq "") {
+           # revert to previous value
+           $distname = $olddistname;
+       }
+       # update
+       $nostrip = compute_dist_and_version($major, $minor, $distname);
     }
 
 



Home | Main Index | Thread Index | Old Index