[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



>> 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. ;-)


>> 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()'.


Reply to: