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

Version Detection #22

Merged
merged 23 commits into from
Jul 27, 2024
Merged

Version Detection #22

merged 23 commits into from
Jul 27, 2024

Conversation

LivacoNew
Copy link
Owner

@LivacoNew LivacoNew commented Jul 27, 2024

Adds version detection to terminal, shell and editor. Detects through the following steps;

  • First will search the package manager caches for the version, will only do this if the executable is in /usr/bin
  • Otherwise, will compare the checksum of the executable with a list of known checksums. This is a last ditch attempt to not have to do the most potentially performance-damaging step which is;
  • Run {executable} --version and parse it.

To-Do before I merge;

  • Check for if {version} is present in the format before fetching the version information, as the operation is quite intensive.
  • Cleanup a bit of code from my prototyping

Post-merge improvements would be;

  • Moving package manager readouts to a separate method/struct that does it all in pre-detection. This is because currently for each version we need to fetch, it re-parses the entire file from the start which is really expensive for package managers such as DPKG, while also adding on the overhead from the package module.
  • Adding RPM, not added yet as I wasn't able to locate where versions are stored in the raw package database

Completes #13

@LivacoNew LivacoNew merged commit e4ea07f into master Jul 27, 2024
@LivacoNew LivacoNew deleted the version-detection branch July 27, 2024 19:41
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