summaryrefslogtreecommitdiff
path: root/devel/management
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2010-12-21 21:34:40 -0600
committerDan McGee <dan@archlinux.org>2011-02-22 16:00:51 -0600
commit4b12255d1cf52fcc1a98c230d940d0c1d3809ad2 (patch)
treeb2a0f99a378f0b700538546cc69b431a0861cdc2 /devel/management
parenteeff0749d86ec403e55dc626034991638edad619 (diff)
Use new split package file fields everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel/management')
-rw-r--r--devel/management/commands/reporead.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index f3ec50e8..72595c63 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -237,8 +237,14 @@ def populate_files(dbpkg, repopkg, force=False):
dbpkg.packagefile_set.all().delete()
logger.info("adding %d files for package %s",
len(repopkg.files), dbpkg.pkgname)
- for x in repopkg.files:
- dbpkg.packagefile_set.create(path=x)
+ for f in repopkg.files:
+ dirname, filename = f.rsplit('/', 1)
+ if filename == '':
+ filename = None
+ dbpkg.packagefile_set.create(
+ is_directory=(filename is None),
+ directory=dirname + '/',
+ filename=filename)
dbpkg.files_last_update = datetime.now()
dbpkg.save()