{DO NOT MERGE}CHEF-35767: Fix filetype extraction when using -f flag with license_id#427
Draft
muthuja wants to merge 1 commit into
Draft
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request updates the Bourne-shell install script’s package-fetch logic to ensure the filetype variable is correctly determined when license_id is present and the user supplies -f (exact output filename).
Changes:
- Extract
filetypefrom a user-provided-ffilename when operating in the licensed/content-disposition code path. - Explicitly initialize
filetypeto an empty value in directory-only/default paths so it can be determined later from the actual downloaded filename.
Comment on lines
+46
to
+49
| download_filename="$cmdline_filename" | ||
| download_dir=`dirname $download_filename` | ||
| use_content_disposition="false" # User specified exact filename | ||
| filetype=`echo $cmdline_filename | sed -e 's/^.*\.//'` # Extract filetype from provided filename |
Collaborator
Author
There was a problem hiding this comment.
This suggestion has been applied in the latest changes, and it looks like a valid improvement.
Signed-off-by: muthuja <muthujabavaji.vempalli@progress.com>
muthuja
force-pushed
the
CHEF-35767-fix-cmdline-filename-filetype-extraction/muthuja
branch
from
June 30, 2026 10:11
78acdd1 to
a30b605
Compare
Collaborator
Author
|
There is some active discussion around this change. Until it's resolved, we can hold off on merging it. |
Stromweld
marked this pull request as draft
July 14, 2026 01:04
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 pull request strengthens validation and handling of user-specified filenames in the
fetch_package.shscript. The main improvements focus on extracting and validating the package file type when the-fflag is used, ensuring users provide a full filename with a recognized extension.Validation and extraction improvements:
-f, the script now extracts the file type from the base name (not the path) to avoid issues with directory names containing dots.rpm,deb,msi, etc.). If the file type is unrecognized, the script exits with an error and a helpful message.Code robustness:
dirname "$download_filename") to avoid issues with spaces or special characters in paths.filetypeis reset appropriately when not provided on the command line.Description
Related Issue
Types of changes
Checklist:
Gemfile.lockhas changed, I have used--conservativeto do it and included the full output in the Description above.