Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nsclient): v0.5.3.4 was missing a padded zero in its display version #2270

Merged
merged 3 commits into from
Jan 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 %}
Loading