aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/httracker/functions7
1 files changed, 6 insertions, 1 deletions
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