summaryrefslogtreecommitdiff
path: root/devel/management
diff options
context:
space:
mode:
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()