From 09bfd184a2d2dc26facd712ab8b10ab006e49253 Mon Sep 17 00:00:00 2001 From: Lucas Date: Sat, 31 Jul 2021 21:30:07 +0000 Subject: [PATCH] fetch: use glob expansion instead of find, for speed --- bin/fetch.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/bin/fetch.sh b/bin/fetch.sh index 2a44430..b5f4be6 100644 --- a/bin/fetch.sh +++ b/bin/fetch.sh @@ -1,6 +1,6 @@ #!/bin/sh # fetch -# Written in 2019-2020 by Lucas +# Written in 2019-2021 by Lucas # CC0 1.0 Universal/Public domain - No rights reserved # # To the extent possible under law, the author(s) have dedicated all @@ -25,11 +25,6 @@ fetch_cmd() fi } -find_dir() -{ - find "$ARCHIVE_BASEDIR" -type d -name "$1" -} - torsocks=torsocks while getopts T flag; do case $flag in @@ -58,7 +53,7 @@ for url; do if grep -q "^$url\$" "$everything"; then printf "%s: already fetched %s\n" "${0##*/}" "$url" >&2 - printf "%s/file\n" "$(find_dir "$sha")" + printf "%s\n" "$ARCHIVE_BASEDIR"/*/*/*/"$sha"/file continue fi