fetch: use glob expansion instead of find, for speed
This commit is contained in:
parent
f9f951867c
commit
09bfd184a2
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user