From c95e5d40534012ce20efcf360d650775177378e9 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 25 Sep 2009 22:47:04 -0500 Subject: Update reporead and model to store pkgbase Signed-off-by: Dan McGee --- main/models.py | 1 + scripts/reporead.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/main/models.py b/main/models.py index eb16e61..7fa0f4b 100644 --- a/main/models.py +++ b/main/models.py @@ -165,6 +165,7 @@ class Package(models.Model): maintainer = models.ForeignKey(User, related_name="maintained_packages") needupdate = models.BooleanField(default=False) pkgname = models.CharField(max_length=255) + pkgbase = models.CharField(max_length=255, null=True, blank=True) pkgver = models.CharField(max_length=255) pkgrel = models.CharField(max_length=255) pkgdesc = models.CharField(max_length=255) diff --git a/scripts/reporead.py b/scripts/reporead.py index f884262..df0062f 100755 --- a/scripts/reporead.py +++ b/scripts/reporead.py @@ -20,7 +20,7 @@ Example: ### # multi value blocks -REPOVARS = ['arch', 'backup', 'builddate', 'conflicts', 'csize', +REPOVARS = ['arch', 'backup', 'base', 'builddate', 'conflicts', 'csize', 'deltas', 'depends', 'desc', 'filename', 'files', 'force', 'groups', 'installdate', 'isize', 'license', 'md5sum', 'name', 'optdepends', 'packager', 'provides', 'reason', @@ -79,6 +79,7 @@ class Pkg(object): 'packager', 'size', 'url'] selfdict['name'] = val['name'][0] + selfdict['base'] = None del val['name'] if 'desc' not in val: logger.warning("Package %s has no description" % selfdict['name']) @@ -96,6 +97,8 @@ class Pkg(object): # fields if len(selfdict[x]) > 255: selfdict[x] = selfdict[x][:254] + elif x == 'base': + selfdict[x] = val[x][0] elif x == 'force': selfdict[x] = True elif x == 'version': @@ -153,6 +156,7 @@ def dictize(cursor,row): def populate_pkg(dbpkg, repopkg, timestamp=None): if not timestamp: timestamp = datetime.now() + dbpkg.pkgbase = repopkg.base dbpkg.pkgver = repopkg.ver dbpkg.pkgrel = repopkg.rel dbpkg.pkgdesc = repopkg.desc @@ -222,7 +226,7 @@ def db_update(archname, pkgs): logger.warning(".db.tar.gz has 75% the number of packages in the web database.") for p in [x for x in pkgs if x.name in in_sync_not_db]: - logger.debug("Adding package %s", p.name) + logger.info("Adding package %s", p.name) ## note: maintainer is being set to orphan for now ## maybe later we can add logic to match pkgbuild maintainers ## to db maintainer ids -- cgit v1.2.3-24-g4f1b