wok rev 5881

tazbb: fix date overflow
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Jul 21 09:48:32 2010 +0200 (2010-07-21)
parents d3bc17858374
children 4423738b3530
files tazbb/stuff/tazbb
line diff
     1.1 --- a/tazbb/stuff/tazbb	Wed Jul 21 09:13:33 2010 +0200
     1.2 +++ b/tazbb/stuff/tazbb	Wed Jul 21 09:48:32 2010 +0200
     1.3 @@ -308,12 +308,14 @@
     1.4  			fi
     1.5  		else
     1.6  			# Check if package is up-to-date.
     1.7 -			PKG_DATE=`date -u -r $PACKAGES_REPOSITORY/$PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg '+%Y%m%d%H%M'`
     1.8 +			PKG_YEAR=`date -u -r $PACKAGES_REPOSITORY/$PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg '+%Y'`
     1.9 +			PKG_DATE=`date -u -r $PACKAGES_REPOSITORY/$PACKAGE-${VERSION}${EXTRAVERSION}.tazpkg '+%m%d%H%M'`
    1.10  			for file in `find $pkg -type f`
    1.11  			do
    1.12 -				FILE_DATE=`date -u -r $file '+%Y%m%d%H%M'`
    1.13 +				FILE_YEAR=`date -u -r $file '+%Y'`
    1.14 +				FILE_DATE=`date -u -r $file '+%m%d%H%M'`
    1.15  				[ "$2" = "--verbose" ] && echo " -> Checking: $file"
    1.16 -				if [ "$FILE_DATE" -gt "$PKG_DATE" ] && ! grep -q $PACKAGE $DB_DIR/cooklist; then
    1.17 +				if [ "$FILE_YEAR" -ge "$PKG_YEAR" -a "$FILE_DATE" -gt "$PKG_DATE" ] && ! grep -q $PACKAGE $DB_DIR/cooklist; then
    1.18  					[ "$1" = "report" ] && echo "Refresh : $PACKAGE ($VERSION)"
    1.19  					echo "Refresh : $PACKAGE ($VERSION)" >> $DB_DIR/report
    1.20  					echo "$PACKAGE" >> $DB_DIR/cooklist