summaryrefslogtreecommitdiffstats
path: root/devel/management
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2012-07-06 00:09:55 +0200
committerDan McGee <dan@archlinux.org>2012-07-06 00:09:55 +0200
commit909cb9a209b4a4db00232b3a62656f95c4b88d45 (patch)
treea9ac24fce35d48708993e323a11c98f6b775bb09 /devel/management
parent9d91cad678133e97345111fab2c103fcda9b9f28 (diff)
downloadarchweb-909cb9a209b4a4db00232b3a62656f95c4b88d45.tar.gz
archweb-909cb9a209b4a4db00232b3a62656f95c4b88d45.tar.xz
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/management')
-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 df29a8a..43578d4 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)