A bug in RPM ? ( for rubygem-sprockets and rubygem-tilt )

· Read in about 2 min · (301 words) ·

I packaged Rails 3.1.0 and its dependencies few days back for Fedora 16. The repository configuration file is as below:

[rails3]
name=rails3
baseurl=http://tuxdna.fedorapeople.org/packaging/rubygems/f16/
enabled=1
gpgcheck=0

Now when I installed Rails 3.1.0, I got into a in issue:

$ sudo yum install rubygem-rails-3.1.0
...OUTPUT SKIPPED...
--> Running transaction check
---> Package rubygem-polyglot.noarch 0:0.3.3-1.fc16 will be installed
---> Package rubygem-sprockets.noarch 0:2.0.3-1.fc16 will be installed
--> Processing Dependency: rubygem(tilt) < 1.3.0 for package: rubygem-sprockets-2.0.3-1.fc16.noarch
--> Finished Dependency Resolution
Error: Package: rubygem-sprockets-2.0.3-1.fc16.noarch (psb)
           Requires: rubygem(tilt) < 1.3.0
           Installed: rubygem-tilt-1.3.3-1.fc16.noarch (@psb)
               rubygem(tilt) = 1.3.3
           Available: rubygem-tilt-1.3.2-1.fc16.noarch (fedora)
               rubygem(tilt) = 1.3.2
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

On the surface it seems that rubygem-sprockets wants rubygem-tilt with a version less than 1.3.0 ( we have only 1.3.3 and 1.3.2 available here). However rubygem-sprockets also accepts rubygem-tilt with a version greater than 1.3.0, which is evident from the dependency list:

$ sudo yum deplist rubygem-sprockets-2.0.3-1.fc16.noarch 
Loaded plugins: auto-update-debuginfo, langpacks, presto, refresh-packagekit
Finding dependencies: 
package: rubygem-sprockets.noarch 2.0.3-1.fc16
...OUTPUT SKIPPED...
  dependency: rubygem(tilt) >= 1.1
   provider: rubygem-tilt.noarch 1.3.3-1.fc16
  dependency: rubygem(tilt) > 1.3.0
   provider: rubygem-tilt.noarch 1.3.3-1.fc16
  dependency: rubygem(tilt) < 1.3.0
   Unsatisfied dependency
  dependency: rubygem(tilt) < 2
   provider: rubygem-tilt.noarch 1.3.3-1.fc16

To verify that it is actually a problem specific to RPM, I downloaded the RPMs and tried installing with rpm command rather than yum:

$ yumdownloader rubygem-tilt-1.3.3-1.fc16.noarch
$ yumdownloader rubygem-sprockets-2.0.3-1.fc16.noarch
$ ls
rubygem-sprockets-2.0.3-1.fc16.noarch.rpm  rubygem-tilt-1.3.3-1.fc16.noarch.rpm
$ sudo rpm -i rubygem-sprockets-2.0.3-1.fc16.noarch.rpm 
error: Failed dependencies:
	rubygem(hike) >= 1.2 is needed by rubygem-sprockets-2.0.3-1.fc16.noarch
	rubygem(hike) < 2 is needed by rubygem-sprockets-2.0.3-1.fc16.noarch
	rubygem(tilt) < 1.3.0 is needed by rubygem-sprockets-2.0.3-1.fc16.noarch

Cleary RPM doesn’t handle package version intervals well even though the information is available inside the package - rubygem-sprockets requires

rubygem-tilt: >= 1.1, < 1.3.0, > 1.3.0, < 2.0.0

I have RPM version 4.9.1.2 running on Linux 3.2.7-1.fc16.x86_64.