Skip to content

fix: fix is_in_apt function for virtual packages#41

Merged
foosel merged 1 commit intoOctoPrint:mainfrom
meteyou:fix/is_in_apt
Jun 16, 2025
Merged

fix: fix is_in_apt function for virtual packages#41
foosel merged 1 commit intoOctoPrint:mainfrom
meteyou:fix/is_in_apt

Conversation

@meteyou
Copy link
Contributor

@meteyou meteyou commented Jun 8, 2025

This PR fix the is_in_apt function for virtual packages. For example policykit-1 doesn't exist anymore in Debian Trixie and the output of apt-cache policy policykit-1 is:

policykit-1:
  Installed: (none)
  Candidate: (none)
  Version table:

This output creates a false positive with the old is_in_apt like here: https://github.com/meteyou/MainsailOS-dev/actions/runs/15515686418/job/43682280429#step:13:195

Here is a test run with the new is_in_apt: https://github.com/meteyou/MainsailOS-dev/actions/runs/15516654843/job/43684788202#step:13:206

An alternative version would be to parse the Candidate output if it is != (none)

Signed-off-by: Stefan Dej <meteyou@gmail.com>
@foosel foosel merged commit 0b23db1 into OctoPrint:main Jun 16, 2025
1 check passed
@foosel
Copy link
Member

foosel commented Jun 16, 2025

Frankly, that solution of yours also strikes me as the cleaner way to get this info 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants