From 772294cd8ccd745d8d58f0b0e72f2241a51392ef Mon Sep 17 00:00:00 2001 From: twangboy Date: Fri, 15 Nov 2024 13:52:20 -0700 Subject: [PATCH 1/2] Update nsclient with renovate --- nsclient.sls | 65 +++++++++++++++++++++++++++++----------------------- pandoc.sls | 15 ++++++++---- 2 files changed, 47 insertions(+), 33 deletions(-) diff --git a/nsclient.sls b/nsclient.sls index 1d757aa5f..c687f5661 100644 --- a/nsclient.sls +++ b/nsclient.sls @@ -1,36 +1,43 @@ +{%- load_yaml as versions %} +# renovate: datasource=github-releases depName=nscp packageName=mickem/nscp +- '0.5.3.4' +- '0.5.2.39' +- '0.5.2.29' +- '0.5.1.46' +- '0.5.1.45' +- '0.5.0.62' +- '0.4.4.23' +- '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 %} + {%- set arch_file = "Win32" %} + {%- set arch_name = "x86" %} +{%- endif %} + nsclient: - {% for split_version in [ - ['0.5.3', '4'], - ['0.5.2', '39'], - ['0.5.2', '29'], - ['0.5.1', '46'], - ['0.5.1', '44'], - ['0.5.0', '62'], - ['0.4.4', '23'], - ['0.4.4', '19'], - ['0.4.3', '143'], - ['0.4.3', '88'] - ] %} +{%- 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 %} + {%- endif %} - {% if split_version[0][2] > '4' %} # versions prior to 0.5.xxxx had 3 dots - {% set version = "0".join(split_version) %} - {% else %} - {% set version = ".".join(split_version) %} - {% endif %} - {% set file_version = ".".join(split_version) %} - '{{ version }}': - {% if grains['cpuarch'] == 'AMD64' %} - full_name: 'NSClient++ (x64)' - installer: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-x64.msi' - uninstaller: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-x64.msi' - {% else %} - full_name: 'NSClient++ (x86)' - installer: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-Win32.msi' - uninstaller: 'https://github.com/mickem/nscp/releases/download/{{ file_version }}/NSCP-{{ file_version }}-Win32.msi' - {% 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 - {% endfor %} +{%- endfor %} diff --git a/pandoc.sls b/pandoc.sls index a9dff377a..3eb3c5f27 100644 --- a/pandoc.sls +++ b/pandoc.sls @@ -4,14 +4,21 @@ - '1.17.0.2' {%- endload%} pandoc: - {%- for version in versions %} +{%- for version in versions %} + {%- if salt["pkg.version_cmp"](version, "2.2") > 0 %} + # Starting in version 2.2 "-x86_64" is added to the filename + {%- set file_name = "pandoc-" ~ version ~ "-windows-x86_64.msi" %} + {%- else %} + {%- set file_name = "pandoc-" ~ version ~ "-windows.msi" %} + {%- endif %} + '{{ version }}': full_name: 'Pandoc {{ version }}' - installer: 'https://github.com/jgm/pandoc/releases/download/{{ version }}/pandoc-{{ version }}-windows.msi' + installer: 'https://github.com/jgm/pandoc/releases/download/{{ version }}/{{ file_name }}' install_flags: '/qn ALLUSERS=1 /norestart' - uninstaller: 'https://github.com/jgm/pandoc/releases/download/{{ version }}/pandoc-{{ version }}-windows.msi' + uninstaller: 'https://github.com/jgm/pandoc/releases/download/{{ version }}/{{ file_name }}' uninstall_flags: '/qn /norestart' msiexec: True locale: en_US reboot: False - {%- endfor %} +{%- endfor %} From 01aa1ba21923c48d595056a18744ab5a326bf601 Mon Sep 17 00:00:00 2001 From: twangboy Date: Fri, 15 Nov 2024 15:03:57 -0700 Subject: [PATCH 2/2] Fix version comparison in pandoc --- pandoc.sls | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandoc.sls b/pandoc.sls index 3eb3c5f27..376afd135 100644 --- a/pandoc.sls +++ b/pandoc.sls @@ -5,7 +5,8 @@ {%- endload%} pandoc: {%- for version in versions %} - {%- if salt["pkg.version_cmp"](version, "2.2") > 0 %} + {%- set parts = version.split(".") %} + {%- if [parts[0], parts[1]] | map('int') | list >= [2, 2]%} # Starting in version 2.2 "-x86_64" is added to the filename {%- set file_name = "pandoc-" ~ version ~ "-windows-x86_64.msi" %} {%- else %}