mirror of
https://github.com/saltstack/salt-bootstrap.git
synced 2025-04-16 09:40:21 +00:00
first pass at parsing the repo.json for Mac when using onedir and latest.
This commit is contained in:
parent
67a0df2dd1
commit
779cfbf55d
1 changed files with 19 additions and 0 deletions
|
@ -8453,6 +8453,22 @@ __macosx_get_packagesite() {
|
|||
SALTPKGCONFURL="https://${_REPO_URL}/osx/${PKG}"
|
||||
}
|
||||
|
||||
__parse_repo_json_python() {
|
||||
|
||||
# Using latest, grab the right
|
||||
# version from the repo.json
|
||||
_ONEDIR_REV=$(python - <<-EOF
|
||||
import json, urllib.request
|
||||
url = "https://repo.saltproject.io/salt/py3/macos/repo.json"
|
||||
response = urllib.request.urlopen(url)
|
||||
data = json.loads(response.read())
|
||||
version = data['latest'][list(data['latest'].keys())[0]]['version']
|
||||
print(version)
|
||||
EOF
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
__macosx_get_packagesite_onedir() {
|
||||
DARWIN_ARCH="x86_64"
|
||||
|
||||
|
@ -8470,6 +8486,9 @@ __macosx_get_packagesite_onedir() {
|
|||
else
|
||||
UNSIGNED=""
|
||||
fi
|
||||
if [ "$(echo "$_ONEDIR_REV" | grep -E '^(latest)$')" != "" ]; then
|
||||
__parse_repo_json_python || return 1
|
||||
fi
|
||||
PKG="salt-${_ONEDIR_REV}-${__PY_VERSION_REPO}-${DARWIN_ARCH}${UNSIGNED}.pkg"
|
||||
SALTPKGCONFURL="https://${_REPO_URL}/${ONEDIR_REV}/${PKG}"
|
||||
fi
|
||||
|
|
Loading…
Add table
Reference in a new issue