[elbe-devel] [PATCH 2/4] projectmanager: allow add_deb_package() to add already existing pkg
Manuel Traut
manuel.traut at linutronix.de
Thu Apr 26 17:31:30 CEST 2018
On Thu, Apr 26, 2018 at 05:01:47PM +0200, Torben Hohn wrote:
> 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>
Reviewed-by: Manuel Traut <manut at linutronix.de>
will apply it to devel/elbe-3.0
> ---
> 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
>
>
> _______________________________________________
> elbe-devel mailing list
> elbe-devel at linutronix.de
> https://lists.linutronix.de/mailman/listinfo/elbe-devel
More information about the elbe-devel
mailing list