poldek: poldek/pkgdir/pkgdir.c - orig pkgdir's ts must not be equa...
mis
mis at pld-linux.org
Sat Jun 23 21:11:27 CEST 2007
Author: mis Date: Sat Jun 23 19:11:27 2007 GMT
Module: poldek Tag: HEAD
---- Log message:
- orig pkgdir's ts must not be equal to new one
---- Files affected:
poldek/poldek/pkgdir:
pkgdir.c (1.47 -> 1.48)
---- Diffs:
================================================================
Index: poldek/poldek/pkgdir/pkgdir.c
diff -u poldek/poldek/pkgdir/pkgdir.c:1.47 poldek/poldek/pkgdir/pkgdir.c:1.48
--- poldek/poldek/pkgdir/pkgdir.c:1.47 Wed Jun 20 19:11:43 2007
+++ poldek/poldek/pkgdir/pkgdir.c Sat Jun 23 21:11:22 2007
@@ -648,9 +648,7 @@
"%d packages loaded", n_array_size(pkgdir->pkgs)),
n_array_size(pkgdir->pkgs));
- n_assert(pkgdir->ts); /* ts must be set by backend */
- if (pkgdir->ts == 0)
- pkgdir->ts = time(0);
+ n_assert(pkgdir->ts > 0); /* ts must be set by backend */
pkgdir->_ldflags = ldflags;
@@ -954,10 +952,14 @@
} else {
int create = 1;
- if (orig->ts > pkgdir->ts) {
- logn(LOGWARN, _("clock skew detected; create index with fake "
- "timestamp %lu %lu"), (unsigned long)orig->ts,
- (unsigned long)pkgdir->ts);
+ if (orig->ts >= pkgdir->ts) {
+ if (orig->ts == pkgdir->ts)
+ logn(LOGNOTICE, "slow down, unable to handle so "
+ "frequent index changes");
+ else
+ logn(LOGWARN, _("clock skew detected; create index with fake "
+ "timestamp %lu >= %lu"), (unsigned long)orig->ts,
+ (unsigned long)pkgdir->ts);
pkgdir->ts = orig->ts + 1;
}
@@ -965,7 +967,7 @@
if ((diff = pkgdir_diff(orig, pkgdir)))
diff->ts = pkgdir->ts;
else if ((flags & PKGDIR_CREAT_IFORIGCHANGED))
- create = 0; /* not a difference -> do not create */
+ create = 0; /* no difference -> do not create */
if (create) { /* save index */
================================================================
---- CVS-web:
http://cvs.pld-linux.org/poldek/poldek/pkgdir/pkgdir.c?r1=1.47&r2=1.48&f=u
More information about the pld-cvs-commit
mailing list