diff options
author | wiz <wiz@pkgsrc.org> | 2020-09-20 11:25:41 +0000 |
---|---|---|
committer | wiz <wiz@pkgsrc.org> | 2020-09-20 11:25:41 +0000 |
commit | 50091dfd4302fa2a0187835edca29a2a796b4b5f (patch) | |
tree | 41e6f7387fe8c66cb2989a0a9f959dcdd0fc0d5e /pkgtools | |
parent | 07d86e31e8061179dcb16d4b591bb7fcdd21e605 (diff) | |
download | pkgsrc-50091dfd4302fa2a0187835edca29a2a796b4b5f.tar.gz |
pkg_notify: update to 0.4.8.
Fix improved github handling.
Diffstat (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkg_notify/Makefile | 7 | ||||
-rwxr-xr-x | pkgtools/pkg_notify/files/pkg_notify | 64 |
2 files changed, 44 insertions, 27 deletions
diff --git a/pkgtools/pkg_notify/Makefile b/pkgtools/pkg_notify/Makefile index 112250d1030..5143cb2d5a3 100644 --- a/pkgtools/pkg_notify/Makefile +++ b/pkgtools/pkg_notify/Makefile @@ -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 @@ -23,7 +22,7 @@ CONF_FILES= ${EGDIR}/${PKGBASE}.list \ .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 --git a/pkgtools/pkg_notify/files/pkg_notify b/pkgtools/pkg_notify/files/pkg_notify index bc4df667ee1..d10a9cf78db 100755 --- a/pkgtools/pkg_notify/files/pkg_notify +++ b/pkgtools/pkg_notify/files/pkg_notify @@ -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 @@ sub find_version { my $wasbad = 0; if ($line =~ /([^0-9a-z]$dist|^$dist)([^\/\"<>\@]+)$extract_sufx/) { - $realdist = $dist.$2.$extract_sufx; my $lsvers = $2; @@ -494,6 +493,33 @@ sub sort_master_sites { # 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 @@ foreach (@packages) { # 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 @@ foreach (@packages) { # 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); } |