Index: usr.sbin/portsnap/portsnap/portsnap.sh =================================================================== --- usr.sbin/portsnap/portsnap/portsnap.sh +++ usr.sbin/portsnap/portsnap/portsnap.sh @@ -696,10 +696,17 @@ # Move files into their proper locations rm -f tag INDEX tINDEX rm -rf files + mkdir files + cut -f 2 -d '|' tINDEX.new INDEX.new | sort | uniq |\ + sed -E 's?(.*)?snap/\1.gz?' | xargs -J % mv % files/ || return 1 + if [ -n "$(ls -1A snap/)" ]; then + echo "Unexpected files in snapshot ${SNAPSHOTHASH}" + return 1 + fi + rmdir snap/ mv tag.new tag mv tINDEX.new tINDEX mv INDEX.new INDEX - mv snap/ files/ return 0 }