2019-04-24 18:18:44 +02:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# vim: ft=sls
|
|
|
|
|
|
|
|
{#- Get the `tplroot` from `tpldir` #}
|
|
|
|
{%- set tplroot = tpldir.split('/')[0] %}
|
2019-06-16 02:22:14 +02:00
|
|
|
{%- from tplroot ~ "/map.jinja" import golang with context %}
|
|
|
|
{%- set sls_archive_clean = tplroot ~ '.archive.clean' %}
|
|
|
|
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %}
|
|
|
|
|
|
|
|
{%- if grains.kernel|lower == 'linux' and golang.linux.altpriority|int > 0 %}
|
2019-04-24 18:18:44 +02:00
|
|
|
|
|
|
|
include:
|
2019-06-16 02:22:14 +02:00
|
|
|
- {{ sls_archive_clean }}
|
|
|
|
|
2019-04-24 18:18:44 +02:00
|
|
|
|
2019-06-16 02:22:14 +02:00
|
|
|
golang-package-archive-remove-home-alternative-remove:
|
|
|
|
alternatives.remove:
|
|
|
|
- name: golang-home
|
|
|
|
- path: {{ golang.base_dir }}/go
|
|
|
|
- onlyif: update-alternatives --get-selections |grep ^golang-home
|
2019-04-24 18:18:44 +02:00
|
|
|
- require:
|
2019-06-16 02:22:14 +02:00
|
|
|
- sls: {{ sls_archive_clean }}
|
2019-04-26 14:02:30 +02:00
|
|
|
|
2019-06-16 02:22:14 +02:00
|
|
|
{% for i in ['go', 'godoc', 'gofmt'] %}
|
|
|
|
|
|
|
|
golang-package-archive-remove-{{ i }}-alternative-remove:
|
|
|
|
alternatives.remove:
|
|
|
|
- name: link-{{ i }}
|
|
|
|
- path: {{ golang.base_dir }}/go/bin/{{ i }}
|
|
|
|
- onlyif: update-alternatives --get-selections |grep ^link-{{ i }}
|
2019-04-26 14:02:30 +02:00
|
|
|
- require:
|
2019-06-16 02:22:14 +02:00
|
|
|
- sls: {{ sls_archive_clean }}
|
|
|
|
|
|
|
|
{% endfor %}
|
|
|
|
{%- endif %}
|