From 4b12255d1cf52fcc1a98c230d940d0c1d3809ad2 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Tue, 21 Dec 2010 21:34:40 -0600 Subject: Use new split package file fields everywhere Signed-off-by: Dan McGee --- devel/management/commands/reporead.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'devel') 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() -- cgit v1.2.3-54-g00ecf