Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Fix per package options in config
@ 2020-08-28 17:34 Chocimier
  2020-08-28 17:57 ` ericonr
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chocimier @ 2020-08-28 17:34 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Chocimier/void-packages-org XBPS_PKG_OPTIONS_foo
https://github.com/void-linux/void-packages/pull/24524

Fix per package options in config
Fixes #24313.

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

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

From 864e34b81afefa67a58680e7d0515ae7dc7f4c58 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Fri, 28 Aug 2020 19:19:13 +0200
Subject: [PATCH 1/3] Revert "xbps-src: fix build-options via cmdline."

Needed to load XBPS_PKG_OPTIONS_foo.

This reverts commit 47175dc8bb4ddc102eda749ff098b2f4db1398ec.
---
 common/xbps-src/shutils/common.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index e8bcf577c6b..dfa63a4e017 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -326,6 +326,8 @@ setup_pkg() {
 
     unset_package_funcs
 
+    . $XBPS_CONFIG_FILE 2>/dev/null
+
     if [ -n "$cross" ]; then
         source_file $XBPS_CROSSPFDIR/${cross}.sh
 

From 5b674fad410d461137af3ae2c74654bfda046f8e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Fri, 28 Aug 2020 19:19:13 +0200
Subject: [PATCH 2/3] xbps-src: make build options from config ang flags work
 together

Flag options was appended to XBPS_PKG_OPTIONS, but was later
overwritten by sourcing config. Instead, pass only flags
options in separate variable and join at very end.
---
 common/xbps-src/shutils/common.sh | 10 ++++++++++
 xbps-src                          | 11 +----------
 2 files changed, 11 insertions(+), 10 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index dfa63a4e017..53ff21a90eb 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -167,6 +167,16 @@ set_build_options() {
         if [ -z "$pkgopts" -o "$pkgopts" = "" ]; then
             pkgopts=${XBPS_PKG_OPTIONS}
         fi
+
+        # If pkg options were set in config(s), merge them with command line
+        if [ -n "$XBPS_ARG_PKG_OPTIONS" ]; then
+            if [ -n "$pkgopts" ]; then
+                pkgopts+=",$XBPS_ARG_PKG_OPTIONS"
+            else
+                pkgopts="$XBPS_ARG_PKG_OPTIONS"
+            fi
+        fi
+
         OIFS="$IFS"; IFS=','
         for j in ${pkgopts}; do
             case "$j" in
diff --git a/xbps-src b/xbps-src
index 1c83708c8da..6a1c4e8350d 100755
--- a/xbps-src
+++ b/xbps-src
@@ -484,15 +484,6 @@ if [ -z "$IN_CHROOT" ]; then
     export XBPS_HOSTDIR="$(readlink -f $XBPS_HOSTDIR 2>/dev/null)"
 fi
 
-# If pkg options were set in config(s), merge them with command line
-if [ -n "$XBPS_ARG_PKG_OPTIONS" ]; then
-    if [ -n "$XBPS_PKG_OPTIONS" ]; then
-        export XBPS_PKG_OPTIONS+=",$XBPS_ARG_PKG_OPTIONS"
-    else
-        export XBPS_PKG_OPTIONS="$XBPS_ARG_PKG_OPTIONS"
-    fi
-fi
-
 # Forbid root unless XBPS_ALLOW_CHROOT_BREAKOUT is set
 # (for travis CI).
 if [ -z "$IN_CHROOT" -a "$UID" -eq 0 -a -z "$XBPS_ALLOW_CHROOT_BREAKOUT" ]; then
@@ -635,7 +626,7 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \
     XBPS_CPPFLAGS XBPS_CFLAGS XBPS_CXXFLAGS XBPS_FFLAGS XBPS_LDFLAGS \
     XBPS_MAKEJOBS XBPS_BUILD_FORCEMODE XBPS_USE_GIT_REVS XBPS_DEBUG_PKGS \
     XBPS_CHECK_PKGS XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \
-    XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_PKG_OPTIONS XBPS_CONFIG_FILE \
+    XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_ARG_PKG_OPTIONS XBPS_CONFIG_FILE \
     XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR XBPS_SRC_VERSION \
     XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR XBPS_BINPKG_EXISTS \
     XBPS_LIBEXECDIR XBPS_DISTDIR XBPS_DISTFILES_MIRROR XBPS_ALLOW_RESTRICTED \

From 111814b9a60da5065bf9f263cb60602f328cc2e4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Piotr=20W=C3=B3jcik?= <chocimier@tlen.pl>
Date: Fri, 28 Aug 2020 19:19:14 +0200
Subject: [PATCH 3/3] xbps-src: separate options of target package and its
 dependencies

---
 common/xbps-src/shutils/common.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 53ff21a90eb..a227301a1c7 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -192,7 +192,7 @@ set_build_options() {
     done
 
     # Prepare final options.
-    for f in ${!options[@]}; do
+    for f in ${build_options}; do
         if [[ ${options[$f]} -eq 1 ]]; then
             eval export build_option_${f}=1
         else

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fix per package options in config
  2020-08-28 17:34 [PR PATCH] Fix per package options in config Chocimier
@ 2020-08-28 17:57 ` ericonr
  2020-08-28 18:08 ` ericonr
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2020-08-28 17:57 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24524#issuecomment-682993568

Comment:
I can check it out later.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fix per package options in config
  2020-08-28 17:34 [PR PATCH] Fix per package options in config Chocimier
  2020-08-28 17:57 ` ericonr
@ 2020-08-28 18:08 ` ericonr
  2020-09-05 20:51 ` ericonr
  2020-09-07 20:18 ` [PR PATCH] [Merged]: " Chocimier
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2020-08-28 18:08 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24524#issuecomment-682993568

Comment:
I can check it out later. Thanks for looking into it!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Fix per package options in config
  2020-08-28 17:34 [PR PATCH] Fix per package options in config Chocimier
  2020-08-28 17:57 ` ericonr
  2020-08-28 18:08 ` ericonr
@ 2020-09-05 20:51 ` ericonr
  2020-09-07 20:18 ` [PR PATCH] [Merged]: " Chocimier
  3 siblings, 0 replies; 5+ messages in thread
From: ericonr @ 2020-09-05 20:51 UTC (permalink / raw)
  To: ml

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

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/24524#issuecomment-687661256

Comment:
Seems to be working fine, thanks!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Merged]: Fix per package options in config
  2020-08-28 17:34 [PR PATCH] Fix per package options in config Chocimier
                   ` (2 preceding siblings ...)
  2020-09-05 20:51 ` ericonr
@ 2020-09-07 20:18 ` Chocimier
  3 siblings, 0 replies; 5+ messages in thread
From: Chocimier @ 2020-09-07 20:18 UTC (permalink / raw)
  To: ml

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

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

Fix per package options in config
https://github.com/void-linux/void-packages/pull/24524

Description:
Fixes #24313.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-09-07 20:18 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-28 17:34 [PR PATCH] Fix per package options in config Chocimier
2020-08-28 17:57 ` ericonr
2020-08-28 18:08 ` ericonr
2020-09-05 20:51 ` ericonr
2020-09-07 20:18 ` [PR PATCH] [Merged]: " Chocimier

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).