On 02/07/12 23:20, Danek Duvall wrote:
Saurabh Vyas wrote:
webrev : https://cr.opensolaris.org/action/browse/pkg/saurabhv/CR-7141684-rev1/
I don't see how this can work, and indeed when I apply your changes to the
current gate, I get the same stack trace described in the bug.
Thanks Danek for looking into this fix.
Not sure why you got the traceback after applying the fix, as get
following o/p :
root@S11:~# diff /usr/bin/pkg /usr/bin/pkg.orig
4528a4529
> pref_pub = api_inst.get_highest_ranked_publisher()
4530d4530
< pref_pub = api_inst.get_highest_ranked_publisher()
4599,4600d4598
< if r is None:
< continue
- With my fix
root@S11:~# pkg publisher -P
PUBLISHER TYPE STATUS URI
- Without my fix
root@S11:~# /usr/bin/pkg.orig publisher -P
PUBLISHER TYPE STATUS URI
Traceback (most recent call last):
File "/usr/bin/pkg.orig", line 5982, in handle_errors
__ret = func(*args, **kwargs)
File "/usr/bin/pkg.orig", line 5960, in main_func
return func(api_inst, pargs)
File "/usr/bin/pkg.orig", line 4602, in publisher_list
for uri in sorted(r.origins):
AttributeError: 'NoneType' object has no attribute 'origins'
pkg: This is an internal error in pkg(5) version 3c00fe4465d3. Please log a
Service Request about this issue including the information above and this
message.
I am not
this test was done on a S11u1 build 8 system.
The problem is that pubs still contains a single element, None. So once
you get into the loop starting at 4599, p is set to None, and the very
first time you try to access its members, on line 4563, you get the stack
trace complaining about "prefix".
But I do not see this here. 'prefix' is set to 'publisher-name' that was
present earlier (and from which we have packages installed on the
system i.e. 'solaris in this case)
I think that you need to just make sure that pubs is empty when there are
no publishers.
So should I move the check for 'pubs is empty' right at the beginning
of the for loop (at 4599 ) ?
@@ -4557,6 +4557,12 @@
msg(fmt % tuple(hdrs))
for p in pubs:
+ if p.repository is None:
+ # We can skip rest of processing if
+ # this publsher do not have any
+ # repository associated
+ continue
+
# Store all our publisher related data in
# field_data ready for output
Please let me know your thoughts.
Thanks again,
~Saurabh
Danek
--
Saurabh Vyas
Solaris Install Group,
Revenue Product Engineering (RPE), Systems
ORACLE India | Off Langford Road | Bangalore | 560025
|Bangalore |
Green Oracle <http://www.oracle.com/commitment> Oracle is committed to
developing practices and products that help protect the environment
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss