[pca] PCA return codes

Martin Paul martin at par.univie.ac.at
Wed Sep 24 10:06:14 CEST 2008


Christophe Kalt wrote:
> On Sep 16, Fred Chagnon wrote:
> | In my wrapper script for pca, I would like to be able to determine if pca
> | finished patching completely, or if it finished prematurely, perhaps due to
> | a patch that required an immediate reconfigure reboot. Does pca have
> | different return codes for these situations? 
> 
> Agreed, suggested it back in February as it's part of what
> makes it painful to write a decent wrapper around pca.

I know, but I still haven't found a solution for the problem that there 
are multiple different situations which should be reported by pca, all 
in one exit value.

For the wrapper script it might be interesting whether pca installed 
some patch and succeeded or failed (with all or just one of many). Was 
there a download attempt that failed? If patches were installed - is a 
reboot recommended or required? What if one patch fails to download, 
another downloads fine but fails to install, and even another downloads 
and installs fine?

I guess a solution might be to use different bits in the exit value for 
various cases, e.g.:

   bit 0: set if a download was successful
   bit 1: set if a download failed
   bit 2: set if any patch was installed successfully
   bit 3: set if any patch failed to install
   bit 4: reboot recommended
   bit 5: reboot required
   bit 6: set if any patch is listed, 0 if none
   bit 7: general error (external command not found, etc.)

There are two problems with that as well: Even with the above examples, 
all 8 bits are already used - there's no space for extra flags in the 
future (and I'm sure some of you can think of other required flags right 
now).

Plus, not every shell does have bitwise logical operators; at least I 
couldn't find a way to handle such an exit code in e.g. bourne shell 
(and the "test" and "expr" commands don't seem to handle it either).

Ideas, anyone?

Martin.



More information about the pca mailing list