On 2013/12/01 15:50, Marc Espie wrote:
> On Sun, Dec 01, 2013 at 03:11:36PM +0100, Gregor Best wrote:
> > On Sun, Dec 01, 2013 at 09:20:58AM +0000, Stuart Henderson wrote:
> > > [...]
> > > We could do with something in infrastructure for tihs really, I wonder
> > > if a USE_GITHUB might be the easiest way there...
> > > [...]
> > 
> > That seems awfully specific. Would adding something like
> > 
> >     PREFIX_DISTFILE=foobar-
> > 
> > to store a distfile with a name like '1.10.tar.gz' as
> > 'foobar-1.10.tar.gz' make sense?

There's already handling in DISTFILES for renaming things, it doesn't make
sense to have two different ways to do that. The github thing is just because
it's so common and is annoying to use (usually needing to set MASTER_SITES,
WRKDIST, PKGNAME and DISTFILES... not to mention the autoconf regen that
a high proportion of github "releases" need because they don't care enough
to run a makefile target to make a polished release, sigh...)

...and there's only going to be more of this when google code downloads
shut down for existing projects too and people move things to github instead...

I don't mind whether there's something specific for github, or some other common
method, as long as we pick something, stick to it, and put whatever parts are
needed in Makefile.template. I note that we do already have some specific bits
in infrastructure for a bunch of other common sites, sourceforge, savannah
(gnu/nongnu), gnome, sunsite, etc..

> The following patch to bsd.port.mk ought to simplify url handling (comes
> with an example), it allows the more general form
> DISTFILES = filename{url}suffx
> 
> for osm-gps-map, the distfiles would probably look like
> 
> DISTFILES = osm-gps-map-{archive/}1.0.1${EXTRACT_SUFX}
> 
> 
> which is about as simple as it gets, with exactly zero duplication of
> information.

Makes sense and seems fine with the existing examples in tree, OK.

> 
> Index: games/minetest/Makefile
> ===================================================================
> RCS file: /build/data/openbsd/cvs/ports/games/minetest/Makefile,v
> retrieving revision 1.4
> diff -u -p -r1.4 Makefile
> --- games/minetest/Makefile   7 Aug 2013 08:02:48 -0000       1.4
> +++ games/minetest/Makefile   1 Dec 2013 10:47:39 -0000
> @@ -12,8 +12,8 @@ PERMIT_PACKAGE_CDROM =              Yes
>  
>  MASTER_SITES=        https://github.com/minetest/
>  
> -DISTFILES =  
> minetest-${V}${EXTRACT_SUFX}{minetest/archive/${V}${EXTRACT_SUFX}} \
> -             
> minetest-game-${V}${EXTRACT_SUFX}{minetest_game/archive/${V}${EXTRACT_SUFX}}
> +DISTFILES =  minetest-{minetest/archive/}${V}${EXTRACT_SUFX} \
> +             minetest-game-{minetest_game/archive/}${V}${EXTRACT_SUFX}
>  
>  MODULES =    devel/cmake \
>               devel/gettext
> Index: infrastructure/mk/bsd.port.mk
> ===================================================================
> RCS file: /build/data/openbsd/cvs/ports/infrastructure/mk/bsd.port.mk,v
> retrieving revision 1.1249
> diff -u -p -r1.1249 bsd.port.mk
> --- infrastructure/mk/bsd.port.mk     30 Nov 2013 16:06:56 -0000      1.1249
> +++ infrastructure/mk/bsd.port.mk     1 Dec 2013 10:45:46 -0000
> @@ -1157,7 +1157,7 @@ _FILES=
>  .for v in DISTFILES PATCHFILES SUPDISTFILES
>  .  if defined($v)
>  .    for e in ${$v}
> -.      for f m u in ${e:C/:[0-9]$//:C/\{.*\}$//} 
> MASTER_SITES${e:M*\:[0-9]:C/.*:([0-9])/\1/} ${e:C/:[0-9]$//:C/.*\{(.*)\}$/\1/}
> +.      for f m u in ${e:C/:[0-9]$//:C/(.*)\{.*\}(.*)/\1\2/} 
> MASTER_SITES${e:M*\:[0-9]:C/.*:([0-9])/\1/} 
> ${e:C/:[0-9]$//:C/.*\{(.*)\}(.*)/\1\2/}
>  .        if empty(_FILES:M$f)
>  _FILES += $f
>  .          if empty(DIST_SUBDIR)
> @@ -1167,7 +1167,7 @@ _PATH_$v += $f
>  _FULL_$v += ${DIST_SUBDIR}/$f $f $m $u
>  _PATH_$v += ${DIST_SUBDIR}/$f
>  .          endif
> -_LIST_$v += $f
> +_LIST_$v += $f$r
>  .        endif
>  .      endfor
>  .    endfor
> 

Reply via email to