Skip to content

Commit

Permalink
fix: move non-state entries under a new archive_helper key
Browse files Browse the repository at this point in the history
  • Loading branch information
myii committed Apr 1, 2021
1 parent 3f76b25 commit 1b7b265
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
5 changes: 3 additions & 2 deletions golang/defaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ golang:
name: golang
use_upstream_repo: false
use_upstream_archive: true
uri: https://storage.googleapis.com/golang
archive_helper:
archive_suffix: tar.gz
uri: https://storage.googleapis.com/golang
archive:
name: /usr/local
source: null
source_hash: null
trim_output: true
archive_format: tar
enforce_toplevel: true
archive_suffix: tar.gz
repo: {}

# Provided in `map.jinja` via. `grains.kernel`
Expand Down
7 changes: 4 additions & 3 deletions golang/map.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@

{%- if golang.pkg.use_upstream_archive %}
{%- set name = 'go%s.%s-%s'|format(golang.version, golang.kernel, golang.arch) %}
{%- set uri = golang.pkg.uri + '/' + name %}
{%- set archive_suffix = golang.pkg.archive_helper.archive_suffix %}
{%- set uri = golang.pkg.archive_helper.uri + '/' + name %}
{%- if golang.pkg.archive.source_hash %}
{%- set source_hash = golang.pkg.archive.source_hash %}
{%- else %}
{%- set source_hash = uri + '.' + golang.pkg.archive_suffix + '.sha256' %}
{%- set source_hash = uri + '.' + archive_suffix + '.sha256' %}
{%- endif %}
{%- do golang.pkg.archive.update({
'name': golang.pkg.archive.name + '/' + name,
'source': uri + '.' + golang.pkg.archive_suffix,
'source': uri + '.' + archive_suffix,
'source_hash': source_hash,
'archive_format': golang.pkg.archive.archive_format
}) %}
Expand Down
5 changes: 3 additions & 2 deletions golang/osfamilymap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ Solaris: {}
Windows:
go_path: C:\\golang\\packages
pkg:
uri: https://golang.org/dl
archive_helper:
archive_suffix: zip
uri: https://golang.org/dl
archive:
name: C:\\golang\\
source: https://golang.org/dl/go1.14.2.windows-amd64.zip
source_hash: 1b5a60b3bbaa81106d5ee03499b5734ec093c6a255abf9a6a067f0f497a57916
archive_format: zip
archive_suffix: zip

MacOS:
pkg:
Expand Down
4 changes: 0 additions & 4 deletions pillar.example
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ golang:
winner: lookup
added_in_lookup: lookup_value

pkg:
archive:
uri: https://storage.googleapis.com/golang

linux:
# 'Alternatives system' priority: zero disables (default)
base_dir: ''
Expand Down

0 comments on commit 1b7b265

Please sign in to comment.