Skip to content

Commit

Permalink
Merge pull request #2270 from dafyddj/fix/nsclient
Browse files Browse the repository at this point in the history
fix(nsclient): v0.5.3.4 was missing a padded zero in its display version
  • Loading branch information
dafyddj authored Jan 8, 2025
2 parents 06844f9 + 159615b commit 27c85d4
Showing 1 changed file with 15 additions and 23 deletions.
38 changes: 15 additions & 23 deletions nsclient.sls
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{%- load_yaml as versions %}
{% load_yaml as versions -%}
# renovate: datasource=github-releases depName=nscp packageName=mickem/nscp
- '0.5.3.4'
- '0.5.2.39'
Expand All @@ -10,34 +10,26 @@
- '0.4.4.19'
- '0.4.3.143'
- '0.4.3.88'
{%- endload%}
# This is to handle the architecture
{%- if grains['cpuarch'] == 'AMD64' %}
{%- set arch_file = "x64" %}
{%- set arch_name = "x64" %}
{%- else %}
{% endload -%}

{%- if grains["cpuarch"] == "x86" %}
{%- set arch_file = "Win32" %}
{%- set arch_name = "x86" %}
{%- endif %}

nsclient:
{%- for version in versions %}
# This is to handle the version reported in Windows
{%- set major, minor, maint, build = version.split(".") %}
{%- if minor|int >= 5 %} # version 5 and newer has 2 dots (0.5.2039)
{%- set install_version = ".".join([major, minor, maint]) %}
{%- set install_version = "0".join([install_version, build]) %}
{%- else %} # version 4 and lower has 3 dots (0.4.4.23)
{%- set install_version = version %}
{#- v0.5.x.x Windows display versions have only three parts (e.g. 0.5.2039) #}
{%- if (salt["pkg.compare_versions"](version, "<", "0.6") and
salt["pkg.compare_versions"](version, ">=", "0.5")) %}
{%- set major, minor, patch, build = version.split(".") %}
{%- set display_version = ".".join([major, minor, patch]) + build.zfill(3) %}
{%- endif %}

'{{ install_version }}':
full_name: 'NSClient++ ({{ arch_name }})'
installer: 'https://github.com/mickem/nscp/releases/download/{{ version }}/NSCP-{{ version }}-{{ arch_file }}.msi'
uninstaller: 'https://github.com/mickem/nscp/releases/download/{{ version }}/NSCP-{{ version }}-{{ arch_file }}.msi'
install_flags: '/quiet'
uninstall_flags: '/quiet'
msiexec: True
locale: en_US
reboot: False
'{{ display_version|d(version) }}':
full_name: NSClient++ ({{ arch_name|d("x64") }})
installer: https://github.com/mickem/nscp/releases/download/{{ version }}/NSCP-{{ version }}-{{ arch_file|d("x64") }}.msi
install_flags: /quiet
uninstall_flags: /quiet
msiexec: true
{%- endfor %}

0 comments on commit 27c85d4

Please sign in to comment.