jordansissel/fpm · warning

Package iteration '#{@iteration}' includes dashes, convertin

Error message

Package iteration '#{@iteration}' includes dashes, converting to underscores. rpmbuild does not allow the dashes in the package iteration (called 'Release' in rpm)

What it means

RPM's Release field — fpm calls it the package 'iteration' — must not contain dashes; rpmbuild rejects them. When the rpm output target sees a String iteration containing '-', it rewrites every dash to an underscore in place, logs this warning, and continues. Later reads see the already-rewritten value, so the conversion happens once.

Source

Thrown at lib/fpm/package/rpm.rb:277

        return %x{uname -m}.chomp   # default to current arch
      when "amd64" # debian and redhat disagree on architecture names
        return "x86_64"
      when "arm64" # debian and redhat disagree on architecture names
        return "aarch64"
      when "native"
        return %x{uname -m}.chomp   # 'native' is current arch
      when "all"
        # Translate fpm "all" arch to what it means in RPM.
        return "noarch"
      else
        return @architecture
    end
  end # def architecture

  # This method ensures a default value for iteration if none is provided.
  def iteration
    if @iteration.kind_of?(String) and @iteration.include?("-")
      logger.warn("Package iteration '#{@iteration}' includes dashes, converting" \
                   " to underscores. rpmbuild does not allow the dashes in the package iteration (called 'Release' in rpm)")
      @iteration = @iteration.gsub(/-/, "_")
    end

    return @iteration ? @iteration : 1
  end # def iteration

  # Generate a generic changelog or return an existing definition
  def changelog
    if attributes[:rpm_changelog]
      return attributes[:rpm_changelog]
    end

    reldate = if attributes[:source_date_epoch].nil?
                Time.now()
              else
                Time.at(attributes[:source_date_epoch].to_i)
              end

View on GitHub (pinned to b6d77ba72a)

Solutions

  1. Pass an iteration without dashes, e.g. `--iteration 2.1_beta` or `--iteration 0.1.beta1`
  2. Sanitize the value yourself before fpm sees it: `ITER=${ITER//-/_}` so the silent rewrite cannot surprise you
  3. Keep prerelease identifiers out of --version too; move them into the iteration with underscore separators (RPM convention)

Example fix

# before
fpm -s dir -t rpm -n app -v 1.2.3 --iteration 2.1-beta .

# after
fpm -s dir -t rpm -n app -v 1.2.3 --iteration 2.1_beta .
Defensive patterns

Strategy: validation

Validate before calling

# Sanitize and hard-fail on dashes before fpm rewrites them silently
ITER="${ITER//-/_}"
if [[ "$ITER" == *-* ]]; then
  echo "iteration still contains dashes: $ITER" >&2
  exit 1
fi

Type guard

def rpm_safe_field?(str)
  str.is_a?(String) && !str.include?('-')
end

Prevention

When it happens

Trigger: Building an rpm with `--iteration 2.1-beta` or with an iteration computed by a source plugin that embeds dashes (branch names, prerelease markers joined with '-').

Common situations: Build scripts deriving iteration from git branches or tags; reusing semver prerelease strings like 'beta-1' as the iteration; downstream rpm repos then display the underscore variant, confusing version comparisons.

Related errors


AI-assisted analysis of jordansissel/fpm@b6d77ba72a (2026-08-21). Data as JSON: /api/errors/2c5207612af3d995. Report an issue: GitHub.