Skip to content

fix resolve local path dynamically from base_url#63

Merged
twangboy merged 1 commit into
saltstack:mainfrom
saifeldinhesham:fix/generic-base-url-support
Apr 30, 2026
Merged

fix resolve local path dynamically from base_url#63
twangboy merged 1 commit into
saltstack:mainfrom
saifeldinhesham:fix/generic-base-url-support

Conversation

@saifeldinhesham
Copy link
Copy Markdown

Fixes #62

Summary

This PR removes the hardcoded repository path and dynamically resolves the local directory path based on base_url.

Problem

The script previously assumed a fixed path:

${generic_versions_tmpdir}/artifactory/saltproject-generic/onedir

This caused failures when using custom or non-standard repository paths.

Solution

Extract the URL path from base_url and map it to the directory created by wget:

url_path=$(printf '%s\n' "$base_url" | sed -E 's|^[a-zA-Z]+://[^/]+/?||')
url_path=${url_path%/}

local_path="${generic_versions_tmpdir}"
[ -n "$url_path" ] && local_path="${generic_versions_tmpdir}/${url_path}"

Changes

  • Removed hardcoded path dependency
  • Added dynamic path resolution logic
  • Updated function call to use derived path

Behavior

  • Works with any http/https base_url
  • Supports arbitrary repository structures
  • Maintains compatibility with existing wget flags (-nH -x)

Testing

Tested with:

  • Standard Artifactory paths
  • Custom internal URLs
  • Root-level URLs

Notes

This logic depends on wget directory structure. If wget flags change, path resolution may need adjustment.

@twangboy twangboy merged commit 2047991 into saltstack:main Apr 30, 2026
12 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.

Hardcoded repository path breaks support for custom base_url values

2 participants