Github messages for voidlinux
 help / color / mirror / Atom feed
From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Closed]: common/hooks/post-install/04-create-xbps-metadata-scripts.sh: fix return code of failed trigger runs
Date: Tue, 11 Oct 2022 19:48:27 +0200	[thread overview]
Message-ID: <20221011174827.tb8xt_6d30vsJFQzjkT8hVJE0ffcnzS-hixrT8vwU1k@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-32120@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 986 bytes --]

There's a closed pull request on the void-packages repository

common/hooks/post-install/04-create-xbps-metadata-scripts.sh: fix return code of failed trigger runs
https://github.com/void-linux/void-packages/pull/32120

Description:
When a template defines `$triggers`, `xbps-src` writes an `INSTALL` script that will invoke the triggers. If the triggers fail, the test in

    [ $? -ne 0 ] && exit $?

will succeed and `exit` will be invoked. However, at the time `exit` is invoked, `$?` will take the value of *the test* `[ $? -ne 0 ]`, which is always `0` (or else the `&&` will short-circuit and the `exit` will not run).

The right thing to do is capture `$?` in a persistent variable, `$ret`, that can be tested and returned to properly forward the failure code through the trigger.

**NOTE**: This needs a bit of testing, because I don't yet understand the ramifications for `xbps-install` receiving a non-zero trigger return when all of them have returned `0` thus far.

  parent reply	other threads:[~2022-10-11 17:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22  3:03 [PR PATCH] " ahesford
2021-07-22  3:26 ` [PR PATCH] [Updated] " ahesford
2021-07-22  3:30 ` ahesford
2021-08-31 15:39 ` [PR PATCH] [Updated] " ahesford
2021-08-31 15:39 ` ahesford
2021-08-31 15:41 ` ahesford
2022-05-30  2:15 ` github-actions
2022-10-10 10:23 ` Duncaen
2022-10-11 17:48 ` ahesford [this message]
2022-10-11 17:53 ` ahesford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221011174827.tb8xt_6d30vsJFQzjkT8hVJE0ffcnzS-hixrT8vwU1k@z \
    --to=ahesford@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).