{"record":{"id":"9a1e0930eccfb32c","repo":"jordansissel/fpm","slug":"converting-dependency-dep-to-name-versi","errorCode":null,"errorMessage":"Converting dependency #{dep} to #{name} >= #{version}, #{name} < #{nextversion}","messagePattern":"Converting dependency #(.+?) to #(.+?) >= #(.+?), #(.+?) < #(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"lib/fpm/package/rpm.rb","lineNumber":371,"sourceCode":"      name, op, version = dep.split(/\\s+/)\n      dep_ok = true\n      if op == '!='\n        self.conflicts << \"#{name} = #{version}\"\n        dep_ok = false\n      end\n      dep_ok\n    end\n\n    # if --ignore-iteration-in-dependencies is true convert foo = X, to\n    # foo >= X , foo < X+1\n    if self.attributes[:rpm_ignore_iteration_in_dependencies?]\n      self.dependencies = self.dependencies.collect do |dep|\n        name, op, version = dep.split(/\\s+/)\n        if op == '='\n          nextversion = version.split('.').collect { |v| v.to_i }\n          nextversion[-1] += 1\n          nextversion = nextversion.join(\".\")\n          logger.warn(\"Converting dependency #{dep} to #{name} >= #{version}, #{name} < #{nextversion}\")\n          [\"#{name} >= #{version}\", \"#{name} < #{nextversion}\"]\n        else\n          dep\n        end\n      end.flatten\n    end\n\n  setscript = proc do |scriptname|\n      script_path = self.attributes[scriptname]\n      # Skip scripts not set\n      next if script_path.nil?\n      if !File.exist?(script_path)\n        logger.error(\"No such file (for #{scriptname.to_s}): #{script_path.inspect}\")\n        script_errors\t << script_path\n      end\n      # Load the script into memory.\n      scripts[scriptname] = File.read(script_path)\n    end","sourceCodeStart":353,"sourceCodeEnd":389,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/rpm.rb#L353-L389","documentation":"With --ignore-iteration-in-dependencies enabled, the rpm output target rewrites every exact-pin dependency 'name = X' into the pair 'name >= X' and 'name < X.next', where X.next bumps the last dot-separated component by one. The warning lists the original dep and both replacements. Non-numeric components become 0 via to_i, which can produce an incorrect upper bound.","triggerScenarios":"Building an rpm with `fpm -t rpm --ignore-iteration-in-dependencies --depends 'foo = 1.2.3'`, or any source (e.g. python with '==' pins) that feeds '=' dependencies into an rpm build while the flag is on.","commonSituations":"Teams that want the built rpm to depend on any release/iteration of a base package; mixing python's '==' requirement semantics with rpm output and only noticing the rewrite in the generated spec.","solutions":["Drop --ignore-iteration-in-dependencies when exact '=' pins must survive into the rpm spec","Write the intended range explicitly: `--depends 'foo >= 1.2.3' --depends 'foo < 1.2.4'`","Keep version components numeric so the +1 upper bound is computed correctly; avoid strings like '1.2.beta'"],"exampleFix":"# before\nfpm -s python -t rpm --ignore-iteration-in-dependencies --depends 'requests = 2.31.0' requests\n\n# after: express the range you actually want\nfpm -s python -t rpm --depends 'python-requests >= 2.31.0' --depends 'python-requests < 2.32' requests","handlingStrategy":"validation","validationCode":"# Warn when the automatic rewrite will change your exact pins\nif grep -q -- '--ignore-iteration-in-dependencies' build/fpm.sh \\\n   && grep -qE -- '--depends[= ][^ ]+ = ' build/fpm.sh; then\n  echo 'NOTE: exact = pins will be rewritten to >= / < ranges' >&2\nfi","typeGuard":"def exact_pin?(dep)\n  _name, op, _version = dep.split(/\\s+/)\n  op == '='\nend","tryCatchPattern":null,"preventionTips":["Decide policy once: exact pins or ranges, not both in one build","After building, inspect the generated requirements (`rpm -qp --requires pkg.rpm`) to confirm the dependency list","Keep dependency versions numeric-only so the +1 upper-bound bump is correct"],"tags":["rpm","dependencies","version-range","ignore-iteration"],"backgroundTag":"dependency-version-constraints","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}