[caiman-discuss] libbe and beList proper usage question.
Tim Knitter
Tim.Knitter at Sun.COM
Thu Sep 18 07:59:25 PDT 2008
Michal,
> Hello,
> I am writing the simple BE GUI for packagemanager, so the users will be
> able to remove certains BE's.
>
> Currently there was a change in the libbe and the result of
> libbe.beList() is different in the build 97 then it was in the build 94.
>
> Basically I would like to ask what is the reason of having additional
> information in the list returned by libbe.beList() and what should be
> proper usage of new functionallity:
>
The change added a return code so more meaningful messages could be produced by inspecting the return code and mapping it to a message.
> The current list returned by libbe.beList():
>
> [0, [{'orig_be_name': 'opensolaris', ...}, {'orig_be_name':
> 'opensolaris-2', ...}]]
>
> before the beList() returned list:
>
> [{'orig_be_name': 'opensolaris', ...}, {'orig_be_name': 'opensolaris-2',
> ...}]
>
> Please note the leading number 0, which appears in the snv_97 so it's
> list inside another list.
>
> Can I ignore this leading 0 and simply use the second list, or I should
> iterate through the firs list as it may contain another lists like
> 0,1,2,3... ?
The first element in the list will always be the return code. If it is 0 then the rest of the list is correct. If not then something may be wrong with the list. If the list is NULL then the return code should not be 0.
You could, for backward compatibility, just use the second element of the list checking it to None for the failure case.
Tim
>
> best
> Michal Pryc
> _______________________________________________
> caiman-discuss mailing list
> caiman-discuss at opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/caiman-discuss
More information about the caiman-discuss
mailing list