Skip to content

Fix package install detection for packages that are partially installed #178

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

Merged
merged 1 commit into from
Oct 24, 2024

Conversation

cmcgee1024
Copy link
Member

On Debian/Ubuntu Linux that use the dpkg/apt package manager there is a possibility that a package is not in a fully installed state. It can be removed, leaving its configuration files, or the install could have failed. Check rigorously that the package is fully installed without error before producing the command-line.

Also, correct the install command to use apt-get instead of apt since that command-line is guaranteed to be stable.

@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024 cmcgee1024 closed this Oct 23, 2024
@cmcgee1024 cmcgee1024 reopened this Oct 24, 2024
On Debian/Ubuntu Linux that use the dpkg/apt package manager there
is a possibility that a package is not in a fully installed state.
It can be removed, leaving its configuration files, or the install
could have failed. Check rigorously that the package is fully installed
without error before producing the command-line.

Also, correct the install command to use apt-get instead of apt since
that command-line is guaranteed to be stable.
@cmcgee1024
Copy link
Member Author

@swift-ci test macOS

@cmcgee1024
Copy link
Member Author

macOS tests are passing:

Test Suite 'All tests' passed at 2024-10-24 11:44:58.155.
	 Executed 66 tests, with 0 failures (0 unexpected) in 75.092 (75.100) seconds

// |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
// ||/
// ii pkgfoo 1.0.0ubuntu12 My description goes here....
return pkgList.contains("\nii ")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works, but is there something we could look for which is more indicative of an error than \nii? 🤔 If not, LGTM

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the dpkg -l command fails then that is treated as an indication that the package isn't installed, which throws an error caught below. It's just that this output can be that the package is partially installed, which requires this output check here. I don't think that there's much else we can do.

@cmcgee1024 cmcgee1024 merged commit 94ec29c into swiftlang:main Oct 24, 2024
5 of 6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants