diff options
author | Michael Schroeder <mls@suse.de> | 2012-10-29 14:26:10 +0100 |
---|---|---|
committer | Michael Schroeder <mls@suse.de> | 2012-10-29 14:26:10 +0100 |
commit | d16e24a7df388dc2e8c2d373446d93f09ef3d517 (patch) | |
tree | aaffb1319f0a1d707bf39e9a88f4d59dfd43a358 /examples/pysolv | |
parent | 11477521f7d488de196df0fc0f855db9a906063f (diff) | |
download | libsolv-d16e24a7df388dc2e8c2d373446d93f09ef3d517.tar.gz libsolv-d16e24a7df388dc2e8c2d373446d93f09ef3d517.tar.bz2 libsolv-d16e24a7df388dc2e8c2d373446d93f09ef3d517.zip |
fix autorefresh flag in pysolv, support metadata_expire == -1 like in solv.c
Diffstat (limited to 'examples/pysolv')
-rwxr-xr-x | examples/pysolv | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/examples/pysolv b/examples/pysolv index 486ed98..f529d5d 100755 --- a/examples/pysolv +++ b/examples/pysolv @@ -75,12 +75,11 @@ class repo_generic(dict): self.handle = pool.add_repo(self.name) self.handle.appdata = self self.handle.priority = 99 - self['priority'] - if self['autorefresh']: - dorefresh = True + dorefresh = bool(int(self['autorefresh'])) if dorefresh: try: st = os.stat(self.cachepath()) - if time.time() - st[ST_MTIME] < self['metadata_expire']: + if self['metadata_expire'] == -1 or time.time() - st[ST_MTIME] < self['metadata_expire']: dorefresh = False except OSError, e: pass |