[elbe-devel] [PATCH 2/4] projectmanager: allow add_deb_package() to add already existing pkg
Torben Hohn
torben.hohn at linutronix.de
Thu Apr 26 17:01:47 CEST 2018
includedsc() and includedeb() will raise an Exception, when a pkg
is already in the repo. But we want to be able to add already existing
pkg to the repository, when they are rebuilt.
Use force=True and also determine pkg_name from the filename and
pass that also, because force=True needs the pkgname.
Signed-off-by: Torben Hohn <torben.hohn at linutronix.de>
---
elbepack/projectmanager.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/elbepack/projectmanager.py b/elbepack/projectmanager.py
index 14da0c1b..c2d33974 100644
--- a/elbepack/projectmanager.py
+++ b/elbepack/projectmanager.py
@@ -524,11 +524,14 @@ class ProjectManager(object):
ep = self._get_current_project(userid)
t = filename[-3:] # filetype of uploaded file
+ pkg_name = filename.split('_')[0]
if t == 'dsc':
- ep.repo.includedsc(os.path.join(ep.builddir, filename))
+ ep.repo.includedsc(os.path.join(ep.builddir, filename),
+ pkgname=pkg_name, force=True)
elif t == 'deb':
- ep.repo.includedeb(os.path.join(ep.builddir, filename))
+ ep.repo.includedeb(os.path.join(ep.builddir, filename),
+ pkgname=pkg_name, force=True)
ep.repo.finalize()
--
2.11.0
More information about the elbe-devel
mailing list