Stephen Hahn wrote:
> * Rinaldo DiGiorgio <[EMAIL PROTECTED]> [2008-04-27 15:45]:
>   
>>     I was using some of the package commands and the error codes are not 
>> changing. I can understand how one could say that the commands completed 
>> and there was no error. Any suggestions on how developers using (sh, 
>> bash, csh, Beanshell, php.... and the versions of exec in each of those 
>> languages) gets  more detailed completion status. Consider the following 
>> uninstall, install, install sequence.
>>
>>
>> [EMAIL PROTECTED]:~# pkg uninstall SUNWzsh
>> PHASE                                        ACTIONS
>> Removal Phase                                817/817
>> [EMAIL PROTECTED]:~# echo $?
>> 0
>> [EMAIL PROTECTED]:~# pkg install SUNWzsh
>> DOWNLOAD                                    PKGS       FILES     XFER (MB)
>> Completed                                    1/1     726/726     3.97/3.97
>>
>> PHASE                                        ACTIONS
>> Install Phase                                774/774
>> [EMAIL PROTECTED]:~# echo $?
>> 0
>> [EMAIL PROTECTED]:~# pkg install SUNWzsh
>> Nothing to install in this image (is this package already installed?)
>> [EMAIL PROTECTED]:~# echo $?
>> 0
>>
>> For example the grep command returns different status depending on the 
>> results of the grep.
>>
>>
>> [EMAIL PROTECTED]:~# cat /etc/motd
>> Sun Microsystems Inc.    SunOS 5.11    snv_86    January 2008
>> [EMAIL PROTECTED]:~# grep 11 /etc/motd
>> Sun Microsystems Inc.    SunOS 5.11    snv_86    January 2008
>> [EMAIL PROTECTED]:~# echo $?
>> 0
>> [EMAIL PROTECTED]:~# grep 12 /etc/motd
>> [EMAIL PROTECTED]:~# echo $?
>> 1
>>     
>
>   The analogy here isn't convincing, possibly because the pkg(1)
>   invocations above are a small subset of those available.  pkg
>   uninstall of an unknown package gives a non-zero exit status; pkg
>   install of an unknown package gives a non-zero exit status.  At the
>   completion of the pkg install invocation in both the cases above, the
>   requested package is actually installed.
>
>   - Stephen
>
>   
That makes sense.

Thanks


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

Reply via email to