Github messages for voidlinux
 help / color / mirror / Atom feed
From: Chocimier <Chocimier@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] Prefer flags over config file, again
Date: Wed, 09 Sep 2020 23:21:40 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-24790@inbox.vuxu.org> (raw)

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

There is a new pull request by Chocimier against master on the void-packages repository

https://github.com/Chocimier/void-packages-org make_jobs_order
https://github.com/void-linux/void-packages/pull/24790

Prefer flags over config file, again
In reply to https://github.com/void-linux/void-packages/commit/52781a35fe92b19c833f6e809f033b471e391e53#commitcomment-42165452 .

> why was this committed without prior discussion?

@q66: I thought awaiting comments in PR of xbps-src changes for over week suffices. What do you propose to do additionally?

A patch file from https://github.com/void-linux/void-packages/pull/24790.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-make_jobs_order-24790.patch --]
[-- Type: text/x-diff, Size: 1459 bytes --]

From c43a0419029a3a3731a64b1c7d42ca88abfb9f3c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Wed, 9 Sep 2020 23:20:27 +0200
Subject: [PATCH] Prefer flags over config file, again

---
 common/xbps-src/shutils/common.sh | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index db97a212354..4e5e83f416a 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -162,11 +162,14 @@ set_build_options() {
     fi
 
     for f in ${build_options}; do
-        _pkgname=${pkgname//[^A-Za-z0-9_]/_}
-        eval pkgopts="\$XBPS_PKG_OPTIONS_${_pkgname}"
-        if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then
-            pkgopts=${XBPS_PKG_OPTIONS}
-        fi
+        # Select build options from conf
+        export XBPS_CURRENT_PKG=${pkgname}
+        pkgopts="$(
+            . $XBPS_CONFIG_FILE 2>/dev/null
+            var="XBPS_PKG_OPTIONS_${XBPS_CURRENT_PKG//[^A-Za-z0-9_]/_}"
+            echo ${!var:-${XBPS_PKG_OPTIONS}}
+        )"
+        unset XBPS_CURRENT_PKG
 
         # If pkg options were set in config(s), merge them with command line
         if [ -n "$XBPS_ARG_PKG_OPTIONS" ]; then
@@ -336,8 +339,6 @@ setup_pkg() {
 
     unset_package_funcs
 
-    . $XBPS_CONFIG_FILE 2>/dev/null
-
     if [ -n "$cross" ]; then
         source_file $XBPS_CROSSPFDIR/${cross}.sh
 

             reply	other threads:[~2020-09-09 21:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-09 21:21 Chocimier [this message]
2020-09-09 21:42 ` q66
2020-09-11 18:25 ` Chocimier
2020-09-14 21:49 ` q66
2020-09-14 21:52 ` q66
2020-09-14 21:52 ` q66
2020-09-14 21:53 ` q66
2020-09-14 21:55 ` [PR PATCH] [Merged]: " q66
2020-09-14 21:55 ` q66

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=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-24790@inbox.vuxu.org \
    --to=chocimier@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).