From cdd9d09f978d69ad207697f94289bfa14064c5ca Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sun, 2 Aug 2015 16:08:52 -0300 Subject: Use two levels of directories --- lib/httracker/functions | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/httracker/functions b/lib/httracker/functions index 2a63ffa..2d3e35a 100644 --- a/lib/httracker/functions +++ b/lib/httracker/functions @@ -21,11 +21,16 @@ function httracker_get { # Options local url="$1" local hash="`echo $1 | sha1sum | cut -d ' ' -f 1`" + local first="`echo $hash | cut -c 1-2`" + local second="`echo $hash | cut -c 3-4`" echo -n "Processing $url..." # Set target and make sure it exists - TARGET="$MIRRORS/$hash" + # We use two levels of directories used for hashing, + # to prevent too many things ending up in any one directory. + # See https://git-annex.branchable.com/internals/ + TARGET="$MIRRORS/$first/$second/$hash" mkdir -p $TARGET # We already got this one -- cgit v1.2.3