env:
In [15]: !uname -a [snip!] 2.6.32-71.14.1.el6.x86_64 #1 SMP Wed Jan 5 17:01:01 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
In [16]: !python -V
Python 2.6.5
In [17]: !rpm -qa cpacman
cpacman-0.7.2-el6.1au.noarch
==
Basically all jamjar does is this right now:
parser = OptionParser()
parser.add_option("-r", "--jarname", action="store", type="string", dest="jarname",
help="name of jar to find the best effort rpm for")
parser.add_option("-j", "--repos", action="store", type="string", dest="repos",
help="What yum repositories to enable")
(options, args) = parser.parse_args()
yb = yum.YumBase()
yb.disablePlugins()
searchterms = [ '/usr/share/java/' + options.jarname, '/usr/share/java/*/' + options.jarname ]
print "searching for..."
for term in searchterms:
print term
p = yb.searchPackageProvides(searchterms)
if p:
for rpm, match in p.iteritems():
print rpm, match
==
which fails with this error b/c of the cpacman plugin:
In [11]: !./jamjar --jarname ant.jar
searching for...
/usr/share/java/ant.jar
/usr/share/java/*/ant.jar
Loaded plugins: cpacman_yum, rhnplugin
*Note* Red Hat Network repositories are not listed below. You must run this command as root to access RHN repositories.
Traceback (most recent call last):
File "./jamjar", line 37, in <module>
p = yb.searchPackageProvides(searchterms)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 2268, in searchPackageProvides
where = self.returnPackagesByDep(arg)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 2649, in returnPackagesByDep
results = self.pkgSack.searchProvides(depstring)
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 774, in <lambda>
pkgSack = property(fget=lambda self: self._getSacks(),
File "/usr/lib/python2.6/site-packages/yum/__init__.py", line 564, in _getSacks
self.repos.populateSack(which=repos)
File "/usr/lib/python2.6/site-packages/yum/repos.py", line 250, in populateSack
self.doSetup()
File "/usr/lib/python2.6/site-packages/yum/repos.py", line 68, in doSetup
self.ayum.plugins.run('prereposetup')
File "/usr/lib/python2.6/site-packages/yum/plugins.py", line 179, in run
func(conduitcls(self, self.base, conf, **kwargs))
File "/usr/lib/yum-plugins/cpacman_yum.py", line 163, in prereposetup_hook
if opts.cpacman and opts.servername:
AttributeError: 'NoneType' object has no attribute 'cpacman'