Mailinglist Archive: zypp-commit (185 mails)

< Previous Next >
[zypp-commit] r10886 - /trunk/libzypp/zypp/Repository.cc
  • From: dmacvicar@xxxxxxxxxxxxxxxx
  • Date: Tue, 19 Aug 2008 11:35:18 -0000
  • Message-id: <20080819113519.069CE30F99@xxxxxxxxxxxxxxxx>
Author: dmacvicar
Date: Tue Aug 19 13:35:18 2008
New Revision: 10886

URL: http://svn.opensuse.org/viewcvs/zypp?rev=10886&view=rev
Log:
handle border cases

Modified:
trunk/libzypp/zypp/Repository.cc

Modified: trunk/libzypp/zypp/Repository.cc
URL:
http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/Repository.cc?rev=10886&r1=10885&r2=10886&view=diff
==============================================================================
--- trunk/libzypp/zypp/Repository.cc (original)
+++ trunk/libzypp/zypp/Repository.cc Tue Aug 19 13:35:18 2008
@@ -92,6 +92,12 @@
{
::Dataiterator di;
::dataiterator_init(&di, get(), -1, 0, 0, SEARCH_EXTRA |
SEARCH_NO_STORAGE_SOLVABLE);
+ Date generated = generatedTimestamp();
+ // do not calculate over a missing generated
+ // timestamp
+ if ( generated == Date() )
+ return Date();
+
if (::dataiterator_step(&di))
{
do
@@ -100,7 +106,7 @@
{
case REPOSITORY_EXPIRE:
{
- return generatedTimestamp() + di.kv.num;
+ return generated + di.kv.num;
break;
}
}
@@ -124,6 +130,12 @@
if ( isSystemRepo() )
return false;

+ Date suggested = suggestedExpirationTimestamp();
+
+ // if no data, don't suggest
+ if ( suggested == Date() )
+ return false;
+
return suggestedExpirationTimestamp() < Date::now();
}


--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages