view modules/zypprepo/manifests/versionlock.pp @ 465:f6304a8e2adc

Try to fix last day of month HTTP LogWatch LogWatch runs for yesterday's data. And we rotate and zip web logs on the 1st of the month. So on the 1st, when generating the summary for the last day of the month, we need to look at a gzipped file, not the current or old-unzipped file.
author IBBoard <dev@ibboard.co.uk>
date Sun, 25 Feb 2024 09:56:16 +0000
parents 3fce34f642f1
children
line wrap: on
line source

# @summary Locks package from updates.
#
# @example Sample usage
#   zypprepo::versionlock { 'bash-4.1.2-9.sles12.*': }
#
# @param ensure
#   Specifies if versionlock should be `present` or `absent`.
#
# @note The resource title must use the format
#   "%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}".  This can be retrieved via
#   the command `rpm -q --qf '%{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}'.
#   Wildcards may be used within token slots, but must not cover seperators,
#   e.g., 'b*sh-4.1.2-9.*' covers Bash version 4.1.2, revision 9 on all
#   architectures.
#
define zypprepo::versionlock {
  require zypprepo::plugin::versionlock

  assert_type(Zypprepo::VersionlockString, $name) |$_expected, $actual | {
    fail("Package name must be formatted as %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}, not \'${actual}\'. See Zypprepo::Versionlock documentation for details.")
  }

  concat::fragment { "zypprepo-versionlock-${name}":
    content => "\ntype: package\n\
match_type: glob\n\
case_sensitive: on\n\
solvable_name: ${name}\n",
    target  => $zypprepo::plugin::versionlock::path,
  }
}