from bsd.port.mk(7):
     FETCH_SYMLINK_DISTFILES
                   User settings.  Set to `Yes' to link distribution files off
                   CDROM_SITE instead of copying them.

     CDROM_SITE    Path to a local source that holds distribution files
                   (usually a CD-ROM or other similar media), used to retrieve
                   distribution files before going to the network.  Defaults
                   to empty, set to /cdrom/distfiles/${DIST_SUBDIR} to check
                   that path.  Distribution files are still copied or linked
                   (see FETCH_SYMLINK_DISTFILES) into DISTDIR if they are
                   found under CDROM_SITE.


it says that the files are linked "if they are found under CDROM_SITE", but
it seems to link them regardless, and then complains.

$ ls -l /usr/ports/unace* /ext/distfiles/unace*
ls: /ext/distfiles/unace*: No such file or directory
ls: /usr/ports/unace*: No such file or directory
$ CDROM_SITE=/ext/distfiles FETCH_SYMLINK_DISTFILES=Yes make build
===>  Checking files for unace-1.2bp1
>> cksum: cannot open unace-1.2b.tar.gz: No such file or directory
(SHA256) unace-1.2b.tar.gz: MISSING
>> Checksum mismatch for unace-1.2b.tar.gz. (sha256)
Make sure the Makefile and checksum file (/usr/ports/archivers/unace/distinfo)
are up to date.  If you want to fetch a good copy of this
file from the OpenBSD main archive, type
"make REFETCH=true [other args]".
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2376 
'_internal-checksum')
*** Error 1 in . (/usr/ports/infrastructure/mk/bsd.port.mk:2559 
'/usr/ports/pobj/unace-1.2b/.extract_done')
*** Error 1 in /usr/ports/archivers/unace 
(/usr/ports/infrastructure/mk/bsd.port.mk:2476 'build')
$ ls -l /usr/ports/distfiles/unace-1.2b.tar.gz
lrwxr-xr-x  1 null  wheel  32 Apr 21 16:51 
/usr/ports/distfiles/unace-1.2b.tar.gz -> /ext/distfiles/unace-1.2b.tar.gz
$ ls -l /ext/distfiles/unace*
ls: /ext/distfiles/unace*: No such file or directory


so i added a test for the file before linking/copying, which seems to work
fine (though i am not entirely fluent in make.) this also fixes a 'problem'
wherein the error for copy is reported (which always seem a bit ugly to me).

$ CDROM_SITE="/ext/distfiles" make build
===>  Verifying specs:  c
===>  found c.79.0
===>  Checking files for unace-1.2bp1
cp: /ext/distfiles/unace-1.2b.tar.gz: No such file or directory
>> Fetch http://www.ibiblio.org/pub/Linux/utils/compress/unace-1.2b.tar.gz
unace-1.2b.tar.gz 100% |********************************| 43423       00:00
>> (SHA256) unace-1.2b.tar.gz: OK
===>  Extracting for unace-1.2bp1
...


--- infrastructure/mk/bsd.port.mk.orig  Fri Apr 10 19:45:45 2015
+++ infrastructure/mk/bsd.port.mk       Tue Apr 21 17:04:14 2015
@@ -1216,10 +1216,11 @@ MASTER_SITES${_I} := ${MASTER_SITE_OVERRIDE} ${MASTER_
 CDROM_SITE ?=
 
 .if !empty(CDROM_SITE)
+_CDROM_OVERRIDE = test -f ${CDROM_SITE}/$$f &&
 .  if defined(FETCH_SYMLINK_DISTFILES)
-_CDROM_OVERRIDE = if ln -s ${CDROM_SITE}/$$f .; then exit 0; fi
+_CDROM_OVERRIDE += if ln -s ${CDROM_SITE}/$$f .; then exit 0; fi
 .  else
-_CDROM_OVERRIDE = if cp -f ${CDROM_SITE}/$$f .; then exit 0; fi
+_CDROM_OVERRIDE += if cp -f ${CDROM_SITE}/$$f .; then exit 0; fi
 .  endif
 .else
 _CDROM_OVERRIDE =:

Reply via email to