quickfix: replace calls to date with builtin printf or $EPOCHSECONDS

This commit is contained in:
Vincent Riquer 2025-08-07 15:11:17 +02:00
parent 1df976bcae
commit de3dcae1f2
3 changed files with 7 additions and 7 deletions

8
atom
View File

@ -555,16 +555,16 @@ echo "Created ${count:-0} tasks for $filecount files ${togo:+($togo left) }(${co
concurrency=$(( maxload / 2 )) concurrency=$(( maxload / 2 ))
(( concurrency )) || concurrency=1 (( concurrency )) || concurrency=1
active=0 active=0
concurrencychange=$(date +%s) concurrencychange=$EPOCHSECONDS
starttime=$concurrencychange starttime=$concurrencychange
taskcount=$count taskcount=$count
remaining=$taskcount remaining=$taskcount
failed=0 failed=0
echo 'BEGIN TRANSACTION;' >&3 echo 'BEGIN TRANSACTION;' >&3
committime=$(date +%s) committime=$EPOCHSECONDS
while (( (remaining || ${#workers[@]}) && ! quit )) while (( (remaining || ${#workers[@]}) && ! quit ))
do do
timestamp=$(date +%s) timestamp=$EPOCHSECONDS
if (( $timestamp - committime >= 60 )) if (( $timestamp - committime >= 60 ))
then then
echo $'COMMIT;\nBEGIN TRANSACTION;' >&3 echo $'COMMIT;\nBEGIN TRANSACTION;' >&3
@ -673,7 +673,7 @@ done
echo 'COMMIT;' >&3 echo 'COMMIT;' >&3
unset count unset count
endtime=$(date +%s) endtime=$EPOCHSECONDS
(( elapsedseconds = endtime - starttime - pausedtime )) (( elapsedseconds = endtime - starttime - pausedtime ))
(( days = (( days =

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
getFiles() { getFiles() {
scantime=$(date +%s) scantime=$EPOCHSECONDS
for prune_expression in "${skippeddirectories[@]}" for prune_expression in "${skippeddirectories[@]}"
do do
prunes+=( -path "$sourcepath$prune_expression" -prune -o ) prunes+=( -path "$sourcepath$prune_expression" -prune -o )

View File

@ -287,12 +287,12 @@ cat <<-EOBrag
# #
# $0 $args # $0 $args
# #
# Last database update: $(date -d @$lastupdate +'%x %X') # Last database update: $EPOCHSECONDS
EOBrag EOBrag
printDate() { printDate() {
date -d"@$1" +"${timeformat:-%x %X}" printf "%("${timeformat:-%x %X}")T "$1"
} }
for index in ${!show[@]} for index in ${!show[@]}