tech-pkg archive

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

Re: distfile renaming - éclaire-moi, svp



In OpenBSD, and mostly because of github (ahaha) we did implement a
renaming mechanism a while back.

The core of the implementation is not really pretty, it relies heavily on the
.for a b c in ${LIST}
feature to convert  DISTFILES into a list of properties that get injected
into do-fetch.   But it makes for sensible distfiles info.

Anyhow, our documentation says;

    Each entry may optionally be of the form ‘filename{url}sufx’ to
    deal with sites that only offer archives as weird urls, doing the
    transfer of urlsufx into result file filenamesufx.  For instance,
    if

    DISTFILES = minetest-{minetest/archive/}${V}${EXTRACT_SUFX}

    then fetch will retrieve from url
    ‘minetest/archive/${V}${EXTRACT_SUFX}’ into
    ‘minetest-${V}${EXTRACT_SUFX}’.

and the implementation does this:

(it also deals with :0  -> MASTER_SITES0 and similar for us)

.for v in DISTFILES PATCHFILES SUPDISTFILES
.  if !empty($v)
.    for e in ${$v}
.      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)
_FULL_FETCH_LIST += $f $f $m $u
_PATH_$v += $f
.          else
_FULL_FETCH_LIST += ${DIST_SUBDIR}/$f $f $m $u
_PATH_$v += ${DIST_SUBDIR}/$f
.          endif
_LIST_$v += $f
.        endif
.      endfor
.    endfor
.  else
_PATH_$v =
_LIST_$v =
.  endif

for instance, with
DISTFILES = stumpwm-18.05{18.05}.tar.gz  cl-ppcre-2.0.11{v2.0.11}.tar.gz:0

then
_FULL_FETCH_LIST is:
stumpwm-18.05.tar.gz stumpwm-18.05.tar.gz MASTER_SITES 18.05.tar.gz 
cl-ppcre-2.0.11.tar.gz cl-ppcre-2.0.11.tar.gz MASTER_SITES0 v2.0.11.tar.gz 

which is then put to use by fetch/checksum/makesum...


Home | Main Index | Thread Index | Old Index