From 7d9a4be39ec0ff9260a5edfd1c95c06f5f52ade1 Mon Sep 17 00:00:00 2001 From: cperciva Date: Thu, 11 Jul 2013 22:19:18 +0000 Subject: Fix bug in deleting files: If two ports had the same tarball and one of them changed (or was removed from the tree) then portsnap would delete that file. This happened earlier today when one of two empty port directories was removed. Uniquifying the lists of needed files fixes this. 9.2-RELEASE candidate. MFC after: 3 days --- usr.sbin/portsnap/portsnap/portsnap.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh index 5826fa1..14e5441 100644 --- a/usr.sbin/portsnap/portsnap/portsnap.sh +++ b/usr.sbin/portsnap/portsnap/portsnap.sh @@ -864,8 +864,8 @@ fetch_update() { echo "done." # Remove files which are no longer needed - cut -f 2 -d '|' tINDEX INDEX | sort > oldfiles - cut -f 2 -d '|' tINDEX.new INDEX.new | sort | comm -13 - oldfiles | + cut -f 2 -d '|' tINDEX INDEX | sort -u > oldfiles + cut -f 2 -d '|' tINDEX.new INDEX.new | sort -u | comm -13 - oldfiles | lam -s "files/" - -s ".gz" | xargs rm -f rm patchlist filelist oldfiles -- cgit v1.1