Index: usr.sbin/portsnap/portsnap/portsnap.sh =================================================================== --- usr.sbin/portsnap/portsnap/portsnap.sh +++ usr.sbin/portsnap/portsnap/portsnap.sh @@ -696,6 +696,14 @@ # Move files into their proper locations rm -f tag INDEX tINDEX rm -rf files + cut -f 2 -d '|' tINDEX.new INDEX.new | sort -u > files.expected + find snap -type f -mindepth 1 | sed -E 's^snap/(.*)\.gz^\1^' |\ + sort > files.snap + if ! cmp -s files.expected files.snap; then + echo "Unexpected files in snapshot ${SNAPSHOTHASH}" + return 1 + fi + rm files.expected files.snap mv tag.new tag mv tINDEX.new tINDEX mv INDEX.new INDEX