better progress info

This commit is contained in:
Vincent Riquer 2013-03-10 03:43:14 +01:00
parent d454ccfa2c
commit 456a116d79

13
atom
View File

@ -565,6 +565,7 @@ getFiles() {
do do
prunes+="-path $sourcepath$prune_expression -prune -o " prunes+="-path $sourcepath$prune_expression -prune -o "
done done
echo -n "Scanning $sourcepath... "
# We probably have thousands of files, don't waste time on disk writes # We probably have thousands of files, don't waste time on disk writes
echo 'BEGIN TRANSACTION;' >&3 echo 'BEGIN TRANSACTION;' >&3
while read time size filename while read time size filename
@ -595,7 +596,7 @@ getFiles() {
then then
echo 'COMMIT;BEGIN TRANSACTION;' >&3 echo 'COMMIT;BEGIN TRANSACTION;' >&3
(( debug )) \ (( debug )) \
&& echo -e "\rIdentified $new files, committing..." && echo -ne "\bCommitted $count files... "
fi fi
else else
Update source_files last_seen $scantime <<-EOWhere Update source_files last_seen $scantime <<-EOWhere
@ -603,10 +604,10 @@ getFiles() {
EOWhere EOWhere
fi fi
case $(( ++count % 40 )) in case $(( ++count % 40 )) in
0) echo -ne '\r|' ;; 0) echo -ne '\b|' ;;
10) echo -ne '\r/' ;; 10) echo -ne '\b/' ;;
20) echo -en '\r-' ;; 20) echo -en '\b-' ;;
30) echo -ne '\r\\' ;; 30) echo -ne '\b\\' ;;
*) ;; *) ;;
esac esac
done < <( done < <(
@ -1069,7 +1070,7 @@ do
then then
echo 'COMMIT;BEGIN TRANSACTION;' >&3 echo 'COMMIT;BEGIN TRANSACTION;' >&3
(( debug )) \ (( debug )) \
&& echo " $count files read, committing..." && echo -n " $count files read, committing..."
fi fi
if getTags if getTags
then then