i am assuming that the distfiles on the cdrom preserve the same structure
as on the ftp sites and also created during builds.

to illustrate:

$ env CDROM_SITE=/home/olddistfiles DISTDIR=/home/distfiles make fetch
===>  Checking files for bash-4.3.42
cp: /home/olddistfiles/bash-4.3.30.tar.gz: No such file or directory
>> Fetch http://ftpmirror.gnu.org/bash/bash-4.3.30.tar.gz
bash-4.3.30.tar.gz 100% |*******************************|  7790 KB    00:10
cp: /home/olddistfiles/bash43-031: No such file or directory
>> Fetch http://ftpmirror.gnu.org/bash/bash-4.3-patches/bash43-031
bash43-031   100% |*************************************|  3689       00:00
...


i modified the makefile to echo what it is doing:

$ env CDROM_SITE=/home/olddistfiles DISTDIR=/home/distfiles make fetch
===>  Checking files for bash-4.3.42
cd /home/distfiles/bash
test -f bash-4.3.30.tar.gz && exit 0
if cp -f /home/olddistfiles/bash-4.3.30.tar.gz .; then exit 0; fi
cp: /home/olddistfiles/bash-4.3.30.tar.gz: No such file or directory
>> Fetch http://ftpmirror.gnu.org/bash/bash-4.3.30.tar.gz
bash-4.3.30.tar.gz 100% |*******************************|  7790 KB    00:14
cd /home/distfiles/bash
test -f bash43-031 && exit 0
if cp -f /home/olddistfiles/bash43-031 .; then exit 0; fi
cp: /home/olddistfiles/bash43-031: No such file or directory
>> Fetch http://ftpmirror.gnu.org/bash/bash-4.3-patches/bash43-031
bash43-031   100% |*************************************|  3689       00:00


when checking for existing files, it changes to the directory the files
should be in ie FULLDISTDIR, $DISTDIR/bash in the above case.


if CDROM_SITE used, then the code below is run

.  if defined(FETCH_SYMLINK_DISTFILES)
_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
.  endif


via
        f=$f; \
        ${_CDROM_OVERRIDE}; \


the problem is that the file it tries to copy or link to is the filename
in DISTDIR, not FULLDISTDIR.

so in the case of bash, it tries

'cp -f ${CDROM_SITE}/bash-4.3.30.tar.gz'

instead of

'cp -f ${CDROM_SITE}/bash/bash-4.3.30.tar.gz'


the fix is trivial:

--- infrastructure/mk/bsd.port.mk.orig  Thu Jan  7 04:25:02 2016
+++ infrastructure/mk/bsd.port.mk       Mon Feb  8 12:37:24 2016
@@ -2960,7 +2960,7 @@ ${DISTDIR}/$p:
        @lock=${@:T}.dist; ${_SIMPLE_LOCK}; install -d ${DISTDIR_MODE} ${@:H}; \
        cd ${@:H}; \
        test -f ${@:T} && exit 0; \
-       f=$f; \
+       f=$p; \
        ${_CDROM_OVERRIDE}; \
        for site in ${$m}; do \
                file=$@.part; \


run again with the above change, and echo statements:

$ env DISTDIR=/home/distfiles CDROM_SITE=/home/olddistfiles make fetch
===>  Checking files for bash-4.3.42
cd /home/distfiles/bash
test -f bash-4.3.30.tar.gz && exit 0
if cp -f /home/olddistfiles/bash/bash-4.3.30.tar.gz .; then exit 0; fi
cd /home/distfiles/bash
test -f bash43-031 && exit 0
if cp -f /home/olddistfiles/bash/bash43-031 .; then exit 0; fi

Reply via email to