Red Hat Bugzilla – Bug 466460
yum-builddep problem with local files
Last modified: 2014-01-21 18:06:13 EST
Description of problem:
I've just tried using yum-builddep for a .src.rpm I have on the local filesystem.
Each time I try to run it, I see the following error:
Traceback (most recent call last):
File "/usr/bin/yum-builddep", line 142, in <module>
util = YumBuildDep()
File "/usr/bin/yum-builddep", line 41, in __init__
File "/usr/bin/yum-builddep", line 66, in main
File "/usr/bin/yum-builddep", line 109, in get_build_deps
File "/usr/lib/python2.5/site-packages/yum/packages.py", line 1461, in __init__
'Could not open local rpm file: %s' % self.localpath
yum.Errors.MiscError: Could not open local rpm file:
A few other people seem to be having a similar problem:
Version-Release number of selected component (if applicable):
Steps to Reproduce:
there is an update in updates-newkey which I'm pretty sure fixes this.
Ok, my bad ... it's still broken as the problem is due to what version of rpm you have.
Panu, the problem is this gbit of code from rpmUtils/miscutils.py:hdrFromPackage:
hdr = ts.hdrFromFdno(fdno)
except rpm.error, e:
raise rpmUtils.RpmUtilsError, "RPM Error opening Package"
...on Fedora 9s rpm, this throws an exception when fdno is for a .src.rpm package.
I have f9 here running:
and yum-builddep 1.1.16 works fine for me accessing local src rpms.
The system in question is x86_64, if that makes a difference.
Yeh, I have x86_64 too ... interesting.
% yum --version
Installed: rpm-220.127.116.11-2.fc9.x86_64 at 2008-07-14 15:57
Built : Fedora Project at 2008-04-18 16:52
Committed: Bill Nottingham <email@example.com> at 2008-04-18 22:00
Installed: yum-3.2.19-3.fc9.noarch at 2008-09-08 14:10
Built : Fedora Project at 2008-09-03 15:04
Committed: Seth Vidal <skvidal at fedoraproject.org> at 2008-09-03 22:00
Installed: yum-metadata-parser-1.1.2-8.fc9.x86_64 at 2008-07-14 15:58
Built : Fedora Project at 2008-02-14 13:26
Committed: Seth Vidal <skvidal at fedoraproject.org> at 2008-02-14 22:00
...Panu any info. you want?
Have just updated to yum-utils 1.1.17-1.fc9 and the error is still there.
Ok, this "fix" works for me:
diff --git a/yum-builddep.py b/yum-builddep.py
index 2fafdc5..9dba426 100755
@@ -105,7 +105,9 @@ class YumBuildDep(YumUtilBase):
srpms = 
for arg in self.cmds:
- srpms.append(yum.packages.YumLocalPackage(self.ts, arg))
+ ts = rpmUtils.transaction.initReadOnlyTransaction()
+ srpms.append(yum.packages.YumLocalPackage(ts, arg))
+ del ts
...so rpm seems to be failing only with a R/W ts, on .src.rpm, on x86_64 ... hmmm.
Can you point me to the exact package(s) you experience this with? In http://fedoraforum.org/forum/showthread.php?t=200121 case it's apparently a f10 package which could mean something broken how the new rpm creates (source) packages, so the question is does it happen with all src.rpm packages or with just some?
Ahh, the exception it's failing with is:
"public key not available"
...which I think is due to the gpg key storage in the new rpm ... how aren't you hitting this Seth?
So it might be our problem after all, bah.
I just picked a random .src.rpm on my machine that would have deps. that needed installing ... but yeh, I see that "yumdownloader --source yum" works fine ... so I think Seth just chose a "better" starting pkg.
I used: http://dag.wieers.com/rpm/packages/gringotts/gringotts-1.2.8-1.dag.src.rpm
okay, I get the error with that package. I don't get it with an unsigned pkg from my SRPMS dir.
With F9 rpm the key-handling is still the way it "always" was. Using yum-builddep on a signed package with unknown key is probably just a path that nobody has happened to stumble on (surprising as it may be). IIRC yum's "read-only transaction" disables all signature checking, which would explain why the patch in comment #8 "works". And unsigned packages aren't affected either way.
So is there a work around for this issue?
Easy workaround is to rpm --import the key of the package, whether you actually want to go importing whatever keys into your system rpmdb is another question.
yum-builddep needs to be taught to deal with signed packages, that's the real fix. The patch from comment #8 disables any signature checking at all, might not be exactly what you want either.
In any case, over to yum-utils.
okay, seems to me the best fix is:
- make sure yum-builddep errors out appropriately when it encounters an unsigned src rpm
okay - I checked in a patch which will more intelligently tell you about signed, but unknown-key pkgs. It still allows unsigned srpms, which, we can change - but somehow that seems 'more correct' oddly.
reopen if anyone is unhappy about this.