apt works as well as aptitude; shellcheck’d - #3
Open
egberts wants to merge 13 commits into
Open
Conversation
… but" - Some of the Debian system do not have 'aptitude' installed, but have 'apt' installed. Make this script work with either. - Not all cases of invalid CLI options are being handled. Add '*' to the case block. (shellcheck SC2220) - Append additional handler to 'cd ...' with exit 1 (shellcheck SC2164) - Clarify the logic to ensure that it is not ambiguous. (shellcheck SC2186) - 'read' mangles '/' so add an '-r' options to compensate for this. (shellcheck SC2162) - If the script name has a space, compensate for this by adding quotes around the '$0'. - If the filename in a package has a space, compensate for this quirk by adding quotes around variables containing its blank-inserted filename. - Clarify logic to ensure that it is not ambiguous (shellcheck) - Add a shellcheck exemption requested for 'ls -A' which is immensely preferable over 'find $tempDir -type f' - Removed trailing spaces
(Lots of Debian host do not have 'aptitude'; but 'apt', they do)
- Update Changlog - Bump version to 0.1.2
pkienzle
reviewed
Oct 18, 2022
| with: | ||
| # Check https://github.com/codacy/codacy-analysis-cli#project-token to get your project token from your Codacy repository | ||
| # You can also omit the token and run the tools that support default configurations | ||
| project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} |
There was a problem hiding this comment.
Probably want to drop codacy connection. Secrets will not be available to abradley? Also, the badge below references github user egberts.
| cd "$tempDir" | ||
| aptitude download $1 >&2 || die "Aptitude download failed." | ||
| cd "$tempDir" || echo "$tempDir directory is not accessible." || exit 1 | ||
| whereis_aptitude="$(whereis -b aptitude | awk '{print $2}')" |
There was a problem hiding this comment.
Why bother with aptitude if apt works?
| fi | ||
| if [ ! -e $foundFile ]; then | ||
| if [ ! -e "$foundFile" ]; then | ||
| echo "No package matching \"$1\" found in cache." >&2 |
There was a problem hiding this comment.
It would be helpful to include the following for those who don't read docs: Use -d to download.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this is basically a strengthened dpkg-diffs that now works with filenames having a blank character in it.
also works with apt as well as aptitude as some platform do not have aptitude installed (most servers).