summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-05 17:09:55 -0500
committerDan McGee <dan@archlinux.org>2012-07-05 17:09:55 -0500
commit909cb9a209b4a4db00232b3a62656f95c4b88d45 (patch)
treea9ac24fce35d48708993e323a11c98f6b775bb09 /devel
parent9d91cad678133e97345111fab2c103fcda9b9f28 (diff)
reporead: don't append slash to empty (root) directory
Add the slash only if we have a directory name, and not otherwise. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'devel')
-rw-r--r--devel/management/commands/reporead.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/devel/management/commands/reporead.py b/devel/management/commands/reporead.py
index df29a8a7..43578d4a 100644
--- a/devel/management/commands/reporead.py
+++ b/devel/management/commands/reporead.py
@@ -285,13 +285,14 @@ def populate_files(dbpkg, repopkg, force=False):
for f in repopkg.files:
if '/' in f:
dirname, filename = f.rsplit('/', 1)
+ dirname += '/'
else:
dirname, filename = '', f
if filename == '':
filename = None
pkgfile = PackageFile(pkg=dbpkg,
is_directory=(filename is None),
- directory=dirname + '/',
+ directory=dirname,
filename=filename)
pkg_files.append(pkgfile)
PackageFile.objects.bulk_create(pkg_files)