diff options
author | davidovski <david@davidovski.xyz> | 2022-06-06 18:39:20 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-06-06 18:39:20 +0100 |
commit | dd8004ccbf58b546f48205d2878d9101bbfcaadc (patch) | |
tree | 7864c5224a4728a37f858f3703e05286bb6a2687 /src/sync.sh | |
parent | a8c14970881292501f40c3cf1f5c36b71525fee0 (diff) |
fixed sort to be faster
Diffstat (limited to 'src/sync.sh')
-rwxr-xr-x | src/sync.sh | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/sync.sh b/src/sync.sh index 263d555..2df7b64 100755 --- a/src/sync.sh +++ b/src/sync.sh @@ -90,29 +90,31 @@ popularity_contest () { } index_deps () { + local l=$1 set -- ${SOURCES} local total=$# local completed=0 for src in ${SOURCES}; do - ${QUIET} || hbar -T "${LARGE_CIRCLE} indexing dependencies..." $completed $total + ${QUIET} || hbar -l $l -T "${LARGE_CIRCLE} indexing dependencies..." $completed $total dep_graph $src completed=$((completed+1)) done - ${QUIET} || hbar ${HBAR_COMPLETE} -T "${CHECKMARK} indexed dependencies" $completed $total + ${QUIET} || hbar -l $l ${HBAR_COMPLETE} -T "${CHECKMARK} indexed dependencies" $completed $total } index_repo () { + local l=$1 set -- ${SOURCES} local total=$# local completed=0 for src in ${SOURCES}; do - ${QUIET} || hbar -T "${LARGE_CIRCLE} syncing sources..." $completed $total + ${QUIET} || hbar -l $l -T "${LARGE_CIRCLE} syncing sources..." $completed $total list_source $src completed=$((completed+1)) done - ${QUIET} || hbar ${HBAR_COMPLETE} -T "${CHECKMARK} synced sources" $completed $total + ${QUIET} || hbar -l $1 ${HBAR_COMPLETE} -T "${CHECKMARK} synced sources" $completed $total } sync () { @@ -129,9 +131,10 @@ sync () { mkdir -p ${PACKAGES_DIR} # index packages and dependencies - index_repo ${QUIET} || hbar - index_deps + ${QUIET} || hbar + index_repo 1 & + index_deps 0 & # wait for all jobs to complete wait |