On Sat, Aug 18, 2018 at 11:39:50PM -0600, Anthony J. Bentley wrote:

> > just noticed that I'm no more able to fetch tarballs for ports relying 
> > on github's on-the-fly archive creation...
> 
> GitHub's autogenerated tarballs have had URLs like the following for as
> long as I can remember:
> 
> https://github.com/tklauser/libtar/archive/v1.2.20.tar.gz
> 
> Notice how the filename is ${GH_TAGNAME}, and doesn't include the name
> of the project.
> 
> The trouble is the ports infrastructure fetches ${GH_TAGNAME}/${DISTNAME}.
> This happened to work but was undocumented.
> 
> https://github.com/tklauser/libtar/archive/v1.2.20/libtar-1.2.20.tar.gz
> 
> It looks like we'll have to rename it afterward, or use some other trick
> (like "${GH_TAGNAME}.tar.gz?/${DISTNAME}.tar.gz").

This solves the issue for me. I'm not an expert on the inner workings of
the ports infrastructure, so there might be a better way.

Comments?

Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1438
diff -u -p -r1.1438 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       9 Aug 2018 19:53:41 -0000       1.1438
+++ infrastructure/mk/bsd.port.mk       19 Aug 2018 08:22:22 -0000
@@ -607,7 +607,8 @@ GH_ACCOUNT ?=
 GH_PROJECT ?=
 
 .if !empty(GH_PROJECT) && !empty(GH_TAGNAME)
-DISTNAME ?=    ${GH_PROJECT}-${GH_TAGNAME:C/^v//}
+DISTNAME ?=    ${GH_TAGNAME:C/^v//}
+DISTFILES ?=   ${GH_PROJECT:L}-${DISTNAME}{${DISTNAME}}.tar.gz
 .endif
 
 PKGNAME ?= ${DISTNAME}
@@ -1159,7 +1160,7 @@ ERRORS += "Fatal: specifying both GH_TAG
 ERRORS += "Fatal: using master as GH_TAGNAME is invalid"
 .  endif
 MASTER_SITES_GITHUB += \
-       
https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/archive/${GH_TAGNAME:S/$/\//}
+       https://github.com/${GH_ACCOUNT}/${GH_PROJECT}/archive/
 
 MASTER_SITES ?= ${MASTER_SITES_GITHUB}
 HOMEPAGE ?= https://github.com/${GH_ACCOUNT}/${GH_PROJECT}

Reply via email to