From dd8004ccbf58b546f48205d2878d9101bbfcaadc Mon Sep 17 00:00:00 2001 From: davidovski Date: Mon, 6 Jun 2022 18:39:20 +0100 Subject: fixed sort to be faster --- src/sync.sh | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/sync.sh') 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 -- cgit v1.2.1