From: Alejandro del Castillo <alejandro.delcastillo@ni.com>
To: Haris Okanovic <haris.okanovic@ni.com>, <yocto@yoctoproject.org>
Subject: Re: [PATCH] libopkg: Add disable_intercepts option to opkg.conf
Date: Wed, 6 Jan 2016 17:56:40 -0600 [thread overview]
Message-ID: <568DA9B8.9090204@ni.com> (raw)
In-Reply-To: <1452121621-24213-1-git-send-email-haris.okanovic@ni.com>
On 01/06/2016 05:07 PM, Haris Okanovic wrote:
> When set, this option disables interception and deferral of certain
> utilities (E.g. depmod, ldconfig) when called from maintainer scripts
> (E.g. postinst). Disabled by default to maintain old behavior.
>
> Append "option disable_intercepts 1" to opkg.conf to set it.
>
> Testing:
> * Installed package containing postinst script and verified
> intercept prep/finalize does not run via DEBUG output.
> * Ran `make check` with option set in the test suite's opkg.conf,
> no additional failures.
>
> Yocto bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=8837
>
> Signed-off-by: Haris Okanovic <haris.okanovic@ni.com>
> Cc: Alejandro del Castillo <alejandro.delcastillo@ni.com>
> Cc: Paul Barker <paul@paulbarker.me.uk>
> ---
> libopkg/opkg_cmd.c | 22 ++++++++++++++--------
> libopkg/opkg_conf.c | 1 +
> libopkg/opkg_conf.h | 1 +
> 3 files changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/libopkg/opkg_cmd.c b/libopkg/opkg_cmd.c
> index 050e6ec..ff3dcc0 100644
> --- a/libopkg/opkg_cmd.c
> +++ b/libopkg/opkg_cmd.c
> @@ -328,7 +328,7 @@ static int opkg_configure_packages(char *pkg_name)
> pkg_vec_t *all, *ordered, *visited;
> unsigned int i;
> pkg_t *pkg;
> - opkg_intercept_t ic;
> + opkg_intercept_t ic = NULL;
> int r, err = 0;
>
> if (opkg_config->offline_root && !opkg_config->force_postinstall) {
> @@ -352,10 +352,13 @@ static int opkg_configure_packages(char *pkg_name)
> opkg_recurse_pkgs_in_order(pkg, all, visited, ordered);
> }
>
> - ic = opkg_prep_intercepts();
> - if (ic == NULL) {
> - err = -1;
> - goto error;
> + if (!opkg_config->disable_intercepts) {
> + ic = opkg_prep_intercepts();
> + if (ic == NULL) {
> + err = -1;
> + goto error;
> + }
> + opkg_msg(DEBUG, "Intercepts enabled; statedir=\"%s\"\n", ic->statedir);
> }
>
> for (i = 0; i < ordered->len; i++) {
> @@ -379,9 +382,12 @@ static int opkg_configure_packages(char *pkg_name)
> }
> }
>
> - r = opkg_finalize_intercepts(ic);
> - if (r != 0)
> - err = -1;
> + if (!opkg_config->disable_intercepts) {
> + opkg_msg(DEBUG, "Finalizing intercepts\n");
> + r = opkg_finalize_intercepts(ic);
> + if (r != 0)
> + err = -1;
> + }
>
> error:
> pkg_vec_free(all);
> diff --git a/libopkg/opkg_conf.c b/libopkg/opkg_conf.c
> index f52a4db..2d2f4f7 100644
> --- a/libopkg/opkg_conf.c
> +++ b/libopkg/opkg_conf.c
> @@ -85,6 +85,7 @@ static opkg_option_t options[] = {
> {"overwrite_no_owner", OPKG_OPT_TYPE_BOOL, &_conf.overwrite_no_owner},
> {"combine", OPKG_OPT_TYPE_BOOL, &_conf.combine},
> {"cache_local_files", OPKG_OPT_TYPE_BOOL, &_conf.cache_local_files},
> + {"disable_intercepts", OPKG_OPT_TYPE_BOOL, &_conf.disable_intercepts},
> #if defined(HAVE_OPENSSL)
> {"signature_ca_file", OPKG_OPT_TYPE_STRING, &_conf.signature_ca_file},
> {"signature_ca_path", OPKG_OPT_TYPE_STRING, &_conf.signature_ca_path},
> diff --git a/libopkg/opkg_conf.h b/libopkg/opkg_conf.h
> index 7460ca2..5421044 100644
> --- a/libopkg/opkg_conf.h
> +++ b/libopkg/opkg_conf.h
> @@ -107,6 +107,7 @@ typedef struct opkg_conf {
> int volatile_cache;
> int combine;
> int cache_local_files;
> + int disable_intercepts;
> int host_cache_dir;
>
> /* ssl options: used only when opkg is configured with '--enable-curl',
>
Wrong ml, could you resend to opkg-devel@googlegroups.com? Also, you no longer
needed to CC Paul
--
Cheers,
Alejandro
prev parent reply other threads:[~2016-01-07 0:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-06 23:07 [PATCH] libopkg: Add disable_intercepts option to opkg.conf Haris Okanovic
2016-01-06 23:56 ` Alejandro del Castillo [this message]
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=568DA9B8.9090204@ni.com \
--to=alejandro.delcastillo@ni.com \
--cc=haris.okanovic@ni.com \
--cc=yocto@yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.