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?

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.


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