Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AptDpkgManager updated? returns true, even if package is not installed #306

Open
annaborn opened this issue May 14, 2020 · 1 comment
Open

Comments

@annaborn
Copy link
Contributor

Hello!
I used AptDpkgManager to check the installed version of deb package.

package_manager = Autoproj::PackageManagers::AptDpkgManager::new(ws)
odb_installed = package_manager.installed?("odb")
deb_version = Autoproj::PackageManagers::DebianVersion::new("2.4.0-10")
check_version = package_manager.updated?("odb", deb_version)

If no odb package is installed, installed?("odb") will return false, as expacted. However, the updated?("odb", deb_version) will return true. Is it not confusing?
As suggestion: it would be great to use updated? on its own. At the moment, it is not possible, since updated? does not parse dpkg status file, how it was done in installed?.

@annaborn annaborn changed the title AptDpkgManager update return true, even if package is not installed AptDpkgManager updated? return true, even if package is not installed May 14, 2020
@annaborn annaborn changed the title AptDpkgManager updated? return true, even if package is not installed AptDpkgManager updated? returns true, even if package is not installed May 14, 2020
@g-arjones
Copy link
Contributor

Is it not confusing?

Although these APIs are considered private (we assume one won't check whether an uninstalled is updated) I agree it is confusing.

At the moment, it is not possible, since updated? does not parse dpkg status file

That's because the greatest available version AFAIK, can't be parsed from the status file. We use apt-cache for that and since that's a costly operation we don't do that in the updated? method.

That said, I think this class could use a great deal of refactoring and both issues could probably be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants