From 59b1ecc9e6ff09bce0de24022374654a1eddd9f3 Mon Sep 17 00:00:00 2001 From: Dusty Phillips Date: Tue, 4 Aug 2009 10:01:08 -0400 Subject: Fix Dan's package population patch. Now it is tested. --- scripts/reporead.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.3-54-g00ecf