{"record":{"id":"d0b5a6b48de69beb","repo":"jordansissel/fpm","slug":"found-invalid-provides-field-values-provide-ins","errorCode":null,"errorMessage":"Found invalid Provides field values (#{provide.inspect}). This is not valid in a Debian package.","messagePattern":"Found invalid Provides field values \\(#(.+?)\\)\\. This is not valid in a Debian package\\.","errorType":"validation","errorClass":"FPM::InvalidPackageConfiguration","httpStatus":null,"severity":"error","filePath":"lib/fpm/package/deb.rb","lineNumber":503,"sourceCode":"        datatar = \"data.tar\"\n        compression = \"\"\n      when nil\n        raise FPM::InvalidPackageConfiguration, \"Missing data.tar in deb source package #{package}\"\n      else\n        raise FPM::InvalidPackageConfiguration,\n          \"Unknown compression type '#{compression}' for data.tar in deb source package #{package}\"\n    end\n\n    # unpack the data.tar.{gz,bz2,xz} from the deb package into staging_path\n    safesystem(ar_cmd[0] + \" p #{package} #{datatar} | tar #{compression} -xf - -C #{staging_path}\")\n  end # def extract_files\n\n  def output(output_path)\n    self.provides = self.provides.collect { |p| fix_provides(p) }\n\n    self.provides.each do |provide|\n      if !valid_provides_field?(provide)\n        raise FPM::InvalidPackageConfiguration, \"Found invalid Provides field values (#{provide.inspect}). This is not valid in a Debian package.\"\n      end\n    end\n    output_check(output_path)\n    # Abort if the target path already exists.\n\n    # create 'debian-binary' file, required to make a valid debian package\n    File.write(build_path(\"debian-binary\"), \"2.0\\n\")\n\n    # If we are given --deb-shlibs but no --after-install script, we\n    # should implicitly create a before/after scripts that run ldconfig\n    if attributes[:deb_shlibs]\n      if !script?(:after_install)\n        logger.info(\"You gave --deb-shlibs but no --after-install, so \" \\\n                     \"I am adding an after-install script that runs \" \\\n                     \"ldconfig to update the system library cache\")\n        scripts[:after_install] = template(\"deb/ldconfig.sh.erb\").result(binding)\n      end\n      if !script?(:after_remove)","sourceCodeStart":485,"sourceCodeEnd":521,"githubUrl":"https://github.com/jordansissel/fpm/blob/b6d77ba72a560b687723376a0e5115c3a92634ad/lib/fpm/package/deb.rb#L485-L521","documentation":"On deb output, every Provides entry is normalized (fix_provides) then checked with valid_provides_field?, which matches RELATIONSHIP_FIELD_PATTERN: a name of at least two characters from [A-z0-9_.-] optionally followed by '(= version)'. Debian policy allows only the '=' relation in Provides, so any other operator or malformed entry raises FPM::InvalidPackageConfiguration.","triggerScenarios":"Passing --provides with an entry like 'libfoo (>= 1.0)' (only '=' allowed), 'a' (name too short), 'foo = bar baz' (bad spacing), or an entry with characters like commas or slashes that break the name pattern. Also hit when converting from another package type whose provides entries are copied verbatim with foreign syntax.","commonSituations":"Reusing RPM-style provides strings ('libfoo >= 1.0' without parentheses, or with >=) in a deb build; automating provides from dependency lists; copy-pasting Debian Depends syntax (which permits <, <=, >, >=) into --provides.","solutions":["Write provides as bare names or with the exact '=' relation: --provides 'libfoo' or --provides 'libfoo (= 1.2.3)'","Replace >=/<=/'>>' operators with '=' or drop the versioned part entirely","Ensure names are at least two characters and contain only letters, digits, underscore, dot, hyphen","When converting package types, sanitize/override provides with --provides instead of carrying them over"],"exampleFix":"# before\nfpm -s dir -t deb -n foo --provides 'libfoo (>= 1.2)' .\n# -> Found invalid Provides field values\n\n# after\nfpm -s dir -t deb -n foo --provides 'libfoo (= 1.2)' .\n# or simply: --provides 'libfoo'","handlingStrategy":"validation","validationCode":"REL = /\\A(?<name>[A-z0-9][A-z0-9_.-]+)(?:\\s*\\((?<relation>[<>=]+)\\s(?<version>.+?)\\))?\\z/\n\ndef valid_provides?(entry)\n  m = REL.match(entry)\n  !m.nil? && (m[:relation].nil? || m[:relation] == '=')\nend\n\nprovides.each { |p| abort \"invalid deb Provides '#{p}'\" unless valid_provides?(p) }","typeGuard":"def deb_provides_entry?(text)\n  m = /\\A([A-z0-9][A-z0-9_.-]+)(?:\\s*([<>=]+)\\s(.+?))?\\z/.match(text)\n  !m.nil? && (m[2].nil? || m[2] == '=')\nend","tryCatchPattern":"begin\n  pkg.output(out)\nrescue FPM::InvalidPackageConfiguration => e\n  raise unless e.message =~ /invalid Provides field values/\n  pkg.provides = pkg.provides.map { |p| p.sub(/\\s*\\([^)]*\\)/, '') }  # drop bad relations\n  retry\nend","preventionTips":["When converting from RPM or other formats, rewrite provides instead of copying: bare name or 'name (= version)'","Remember Provides only permits '=' in Debian policy; other relations belong in Depends/Conflicts","Lint every --provides entry in wrappers with the relationship pattern before invoking fpm"],"tags":["fpm","deb","provides","validation","debian-policy","packaging"],"backgroundTag":"package-metadata-validation","analyzedSha":"b6d77ba72a560b687723376a0e5115c3a92634ad","analyzedAt":"2026-08-21T16:39:02.570Z","schemaVersion":2},"datasetVersion":"2026-08-21T18:17:14.833Z"}