[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#862951: python-apt: apt.Package.mark_reinstall() missing; apt.Package.marked_reinstall doesn't work



On Fri, May 19, 2017 at 11:47:11AM +0200, Michael Schaller wrote:
> >> apt.Package.mark_install() is missing but apt.Package.marked_install is present.
> >
> > No, that's not true. Both exist. I guess you mean reinstall here? Adding reinstall
> > support there is out of scope for now, though, due to freeze.
> >
> Sorry. I've meant indeed *_reinstall. *sigh*
> I don't need reinstall support in testing at the moment. I would just
> like to see this fixed in unstable or experimental. ;-)

There are no plans for new python-apt releases not targetting testing
at the moment. They will come after we start APT 1.5 experimental uploads
(need to get some sane versioning at least...).

> 
> 
> >> When I mark a package for reinstallation via 'cache._depcache.set_reinstall(pkg._pkg, True)' then neither 'cache._depcache.marked_reinstall(pkg._pkg)' nor 'pkg.marked_reinstall' return True.
> >> Furthermore on commit the package(s) marked for reinstall will be reinstalled but beforehand 'cache.get_changes()' doesn't include the package(s) marked for reinstallation.
> >
> > Please try this patch, it changes the code to use APT's function:
> >
> > diff --git a/python/depcache.cc b/python/depcache.cc
> > index d73e4d93..cf6e959e 100644
> > --- a/python/depcache.cc
> > +++ b/python/depcache.cc
> > @@ -562,9 +562,7 @@ static PyObject *PkgDepCacheMarkedReinstall(PyObject *Self,PyObject *Args)
> >     pkgCache::PkgIterator &Pkg = GetCpp<pkgCache::PkgIterator>(PackageObj);
> >     pkgDepCache::StateCache &state = (*depcache)[Pkg];
> >
> > -   bool res = state.Install() && (state.iFlags & pkgDepCache::ReInstall);
> > -
> > -   return HandleErrors(PyBool_FromLong(res));
> > +   return HandleErrors(PyBool_FromLong(state.ReInstall()));
> >  }
> >
> Thanks for the patch. It fixes
> 'cache._depcache.marked_reinstall(pkg._pkg)' and
> 'pkg.marked_reinstall' but doesn't fix 'cache.get_changes()'.

It's not considered a change, because get_changes() returns all
packages that have not been marked 'keep', and the reinstalled
package is marked as keep. I'm not sure if that's
the right choice, but that's the way it is right now, and that's
not going to change.

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev
                  |  Ubuntu Core Developer |
When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to ('inline').  Thank you.


Reply to: