[elbe-devel] [PATCH 2/6] elbe: updated: added possibility to prevent downgrades

Kurt Kanzenbach kurt at linutronix.de
Fri Mar 24 09:33:18 CET 2017


On Fri, Mar 24, 2017 at 09:00:39AM +0100, Torben Hohn wrote:
> On Thu, Mar 23, 2017 at 01:45:43PM +0100, Kurt Kanzenbach wrote:
> > Downgrades might be problematic. Thus, allowing it only if a flag is set. The flag
> > is simply a file called '.downgrade_allowed' in /var/cache/elbe.
> >
> > Signed-off-by: Kurt Kanzenbach <kurt at linutronix.de>
> > ---
> >  elbepack/updated.py | 38 ++++++++++++++++++++++++++++++++++++++
> >  1 file changed, 38 insertions(+)
> >
> > diff --git a/elbepack/updated.py b/elbepack/updated.py
> > index ffc4636..fed1eb0 100644
> > --- a/elbepack/updated.py
> > +++ b/elbepack/updated.py
> > @@ -35,6 +35,7 @@ from soaplib.serializers.primitive import String
> >  from suds.client import Client
> >  from syslog import syslog
> >  from zipfile import (ZipFile, BadZipfile)
> > +from packaging import version
>
> Dont we already depend on python-apt ?
> i think it would be better to use
>
> apt_pkg.version_compare
>
> >>> import apt_pkg
> >>> apt_pkg.version_compare ("2.3a", "2.3b")
> -1
> >>> apt_pkg.version_compare ("2.3a", "2.3")
> 1
> >>> apt_pkg.version_compare ("2.3a", "2.4")
> -1
> >>> apt_pkg.version_compare ("2.3a", "2.3a")
> 0
>

Didn't know that. I'll use this version compare mechanism and drop
packaging as dependency. Thanks!

Best Regards,
Kurt




More information about the elbe-devel mailing list