Skip to content

Commit ca36fc6

Browse files
committed
Fix failing to install packages with -noarch in name
We're missing a `\.` at the beginning, since `.join()` only puts `|\.` in between items: ``` >> ARCH_REGEX = Regexp.new(ARCH_LIST.join('|\.')) => /noarch|\.i386|\.i686|\.ppc|\.ppc64|\.armv3l|\.armv4b|\.armv4l|\.armv4tl|\.armv5tel|\.armv5tejl|\.armv6l|\.armv7l|\.m68kmint|\.s390|\.s390x|\.ia64|\.x86_64|\.sh3|\.sh4/ ``` Currently puppet is failing to install package with `-noarch` string in its name because of the invalid ARCH_REGEX: ``` package { 'package-name-noarch': ensure => '1.0.0.el8' } ``` ``` Debug: Executing: '/bin/dnf -d 0 -e 1 -y install package-name--1.0.0.el8noarch' Error: Could not update: Execution of '/bin/dnf -d 0 -e 1 -y install package-name--1.0.0.el8noarch' returned 1: Error: Unable to find a match: package-name--1.0.0.el7noarch ```
1 parent 37d460c commit ca36fc6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/puppet/util/rpm_compare.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ module Puppet::Util::RpmCompare
66
armv5tejl armv6l armv7l m68kmint s390 s390x ia64 x86_64 sh3 sh4
77
).freeze
88

9-
ARCH_REGEX = Regexp.new(ARCH_LIST.join('|\.'))
9+
ARCH_REGEX = Regexp.new('\.' + ARCH_LIST.join('|\.'))
1010

1111
# This is an attempt at implementing RPM's
1212
# lib/rpmvercmp.c rpmvercmp(a, b) in Ruby.

0 commit comments

Comments
 (0)