Bug 212768

Summary: portsnap fetch update: cannot open (hash).gz: No such file or directory
Product: Base System Reporter: Aleksander Alekseev <afiskon>
Component: miscAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Many People CC: afiskon, cperciva
Priority: ---    
Version: 11.0-STABLE   
Hardware: Any   
OS: Any   

Description Aleksander Alekseev 2016-09-17 14:09:25 UTC
See discussion https://lists.freebsd.org/pipermail/freebsd-questions/2016-September/273601.html
Comment 1 Aleksander Alekseev 2016-09-17 14:37:57 UTC
If I understand correctly the problem is somewhere near line 757 of /usr/src/usr.sbin/portsnap/portsnap.sh script:

```
# Update metadata without patches
    join -t '|' -v 2 tINDEX tINDEX.new |
        cut -f 2 -d '|' /dev/stdin patchlist |
        while read Y; do
            if [ ! -f "files/${Y}.gz" ]; then 
                echo ${Y};
            fi
        done > filelist
    echo -n "Fetching `wc -l < filelist | tr -d ' '` "
    echo ${NDEBUG} "metadata files... "
    lam -s "f/" - -s ".gz" < filelist |
        xargs ${XARGST} ${PHTTPGET} ${SERVERNAME}   \
        2>${QUIETREDIR}
```

Frankly I don't see anything suspicious. Just in case I added `sleep 1` before `lam ...` line. I let you know whether it helps shortly.
Comment 2 Aleksander Alekseev 2016-09-18 09:09:20 UTC
Well, so far there is no such issue with patched portsnap: http://afiskon.ru/s/45/221bf5393f_log.txt I will keep you informed.
Comment 3 Aleksander Alekseev 2016-09-23 08:56:49 UTC
So far so good. Patched version works as expected.
Comment 4 Colin Percival freebsd_committer freebsd_triage 2016-12-26 22:44:09 UTC
Should be fixed by ports r423733, which eliminates the potential for two index files to be identical.