summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2009-08-04 10:01:08 -0400
committerDusty Phillips <buchuki@gmail.com>2009-08-04 10:01:08 -0400
commit59b1ecc9e6ff09bce0de24022374654a1eddd9f3 (patch)
tree5298a256962dc50beee97e01f073ea4fd9513f83
parent64a6af01e8528147364e88a76904e14a3e9ff073 (diff)
Fix Dan's package population patch. Now it is tested.
-rwxr-xr-xscripts/reporead.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/reporead.py b/scripts/reporead.py
index 16dffd58..1d0c0615 100755
--- a/scripts/reporead.py
+++ b/scripts/reporead.py
@@ -151,14 +151,15 @@ def dictize(cursor,row):
return result
-def populate_pkg(dbpkg, repopkg):
+def populate_pkg(dbpkg, repopkg, timestamp=None):
+ if not timestamp: timestamp = datetime.now()
dbpkg.pkgver = repopkg.ver
dbpkg.pkgrel = repopkg.rel
dbpkg.pkgdesc = repopkg.desc
dbpkg.license = repopkg.license
dbpkg.url = repopkg.url
dbpkg.needupdate = False
- dbpkg.last_update = now
+ dbpkg.last_update = timestamp
dbpkg.save()
# files are not in the repo.db.tar.gz
#for x in repopkg.files:
@@ -227,7 +228,7 @@ def db_update(archname, pkgs):
pkg = Package(
pkgname = p.name, arch = architecture, repo = repository,
maintainer_id = 0)
- populate_pkg(pkg, p)
+ populate_pkg(pkg, p, timestamp=now)
# packages in database and not in syncdb (remove from database)
logger.debug("Set theory: Packages in database not in syncdb")
@@ -248,7 +249,7 @@ def db_update(archname, pkgs):
logger.info("Updating package %s in database", p.name)
pkg = Package.objects.get(
pkgname=p.name,arch=architecture, repo=repository)
- populate_pkg(pkg, p)
+ populate_pkg(pkg, p, timestamp=now)
logger.info('Finished updating Arch: %s' % archname)