Danek Duvall wrote:
Saurabh Vyas wrote:

But the call to make_bundle (from gen_actions()) result in TypeError
only, thus we still will end-up having TypeErrror in this case (and not
the bundle not found !!!) Is this correct behavior?

From the way the code was written, it was intentional, but I'm not sure it
was correct.
Thanks again Danek for inputs and clarification.
I'd say you have two options.  One is to fix the bug as narrowly as
possible: catch TypeError like you're doing above and report an unknown
bundle type regardless of whether it's unknown or nonexistent.

The second would be to go through the bundle code and allow
EnvironmentErrors to be raised from each bundle's test() functions.
I am trying out this approach (this will give me more understanding of the code :-) ). And I modified TarBundle.py to raise EnvironmentError (rather than just returning False), then the error trickle downs to gen_action & finally caught in trans_import() & trans_generate()

just for ref : http://cr.opensolaris.org/~saurabhv/fix-15646-rev-3/

does this approach seems right now ?
  But
then you have to decide whether to let them all through, or just certain
ones.  The reason there's a blanket catch statement there is so that the
loop in make_bundle() will continue through all the bundle types before it
gives up.  I think one idea was that a bundle could be made available via a
URL, so the fact that, say, TarBundle might claim ENOENT shouldn't preclude
SolarisPackageStreamBundle from taking a peek at the URL named by
"filename".  But we don't do that right now, and have no specific plans to,
so you could ignore it for your fix.
This is where I need more inputs / ideas about how to handle other cases (also should all those cases need to handle by this bug, or another big to cover them ?)

Thanks,
~Saurabh
Danek

_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to