pentoo-update: normalize date format

This commit is contained in:
blshkv 2019-05-15 20:54:08 +08:00
parent b6783bd2ea
commit f15e41be1d
No known key found for this signature in database
GPG key ID: 273E3E90D1A6294F

View file

@ -188,8 +188,8 @@ safe_exit() {
do_sync() {
read -r portage_timestamp < /usr/portage/metadata/timestamp.chk
portage_date=`date --date="$portage_timestamp" '+%Y%m%d%H%M'`
minutesDiff=$(( `date '+%Y%m%d%H%M'` - $portage_date ))
portage_date=`date --date="$portage_timestamp" '+%Y%m%d%H%M' -u`
minutesDiff=$(( `date '+%Y%m%d%H%M' -u` - $portage_date ))
if [ $minutesDiff -lt 60 ]
then
echo "The last sync was lesser then 1 hour ago, skipping"