summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDusty Phillips <buchuki@gmail.com>2009-08-04 16:01:08 +0200
committerDusty Phillips <buchuki@gmail.com>2009-08-04 16:01:08 +0200
commit59b1ecc9e6ff09bce0de24022374654a1eddd9f3 (patch)
tree5298a256962dc50beee97e01f073ea4fd9513f83 /scripts
parent64a6af01e8528147364e88a76904e14a3e9ff073 (diff)
downloadarchweb-59b1ecc9e6ff09bce0de24022374654a1eddd9f3.tar.gz
archweb-59b1ecc9e6ff09bce0de24022374654a1eddd9f3.tar.xz
Fix Dan's package population patch. Now it is tested.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/reporead.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/scripts/reporead.py b/scripts/reporead.py
index 16dffd5..1d0c061 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)