18 Nov 2010 11:48
Re: opkg return codes
On Wed, Nov 17, 2010 at 11:49 PM, Graham Gower <graham.gower@...> wrote: > On 18 November 2010 04:28, Jin <jin@...> wrote: >> Hi, >> >> I am using the opkg command line client from cgi scripts, there's a >> web interface on top of this, basically a configuration interface that >> allows users to update their system. >> >> Sometimes there are situations where opkg will fail, however the >> return code does not always reflect failure. > > I don't doubt this, but can you give an example? I can give you a good example for more useful return codes, although it doesn't exactly cover the "opkg fail" scenario. Running opkg list-upgradable returns 0 whether there are or not packages to upgrade. In my opinion, giving 0|1 is much useful that only printing the list of upgradable packages. Is true that line counting the command output can be used to distinguish both situations in a script, but is less cleaner, as would be detect by running and actual upgrade with --noaction. In my opinion, this is by far the best to suggest a change in return codes, even if it does not reflect an actual error. I can imagine other situations, as giving non-zero when you install an already installed packages or run an upgrade when there is nothing to upgrade. On the other side for actual opkg "internal" errors, I see not very(Continue reading)
RSS Feed