Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] xbps-src improvements
@ 2019-06-12 21:58 voidlinux-github
  2019-06-12 22:00 ` [PR PATCH] [Updated] " voidlinux-github
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: voidlinux-github @ 2019-06-12 21:58 UTC (permalink / raw)
  To: ml

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

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

https://github.com/Duncaen/void-packages xbps-src-improvements
https://github.com/void-linux/void-packages/pull/12433

xbps-src improvements


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-src-improvements-12433.patch --]
[-- Type: application/text/x-diff, Size: 5210 bytes --]

From 02bed8bbbbdaca1640ef0c223391e606757fac4d Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Wed, 12 Jun 2019 23:50:19 +0200
Subject: [PATCH 1/3] xbps-src: don't check if base-chroot is installed for
 every single sourced template

---
 common/xbps-src/shutils/common.sh | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index cdf1803a4d5..5125c584791 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -372,12 +372,9 @@ setup_pkg() {
     esac
 
     # Check if base-chroot is already installed.
-    if [ -z "$bootstrap" -a "z$show_problems" != "zignore-problems" ]; then
-        check_installed_pkg base-chroot-0.1_1
-        if [ $? -ne 0 ]; then
-            msg_red "${pkg} is not a bootstrap package and cannot be built without it.\n"
-            msg_error "Please install bootstrap packages and try again.\n"
-        fi
+    if [ -z "$bootstrap" -a -z "$CHROOT_READY" ]; then
+        msg_red "${pkg} is not a bootstrap package and cannot be built without it.\n"
+        msg_error "Please install bootstrap packages and try again.\n"
     fi
 
     sourcepkg="${pkgname}"

From c9a725ede89f7c85959dbecb3a6654ce547f9f02 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Wed, 12 Jun 2019 23:51:09 +0200
Subject: [PATCH 2/3] xbps-src: less forking in get_subpkgs and
 unset_package_funcs

---
 common/xbps-src/shutils/common.sh | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 5125c584791..5328c3dcf9d 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -258,21 +258,26 @@ run_pkg_hooks() {
 unset_package_funcs() {
     local f
 
-    for f in $(typeset -F|grep -E '_package$'); do
-        eval unset -f $f
+    for f in $(typeset -F); do
+        case "$f" in
+        *_package)
+            set -- $f
+            eval unset -f "$3"
+            ;;
+        esac
     done
 }
 
 get_subpkgs() {
     local args list
 
-    args="$(typeset -F|grep -E '_package$')"
-    set -- ${args}
-    while [ $# -gt 0 ]; do
-        list+=" ${3%_package}"; shift 3
-    done
-    for f in ${list}; do
-        echo "$f"
+    for f in $(typeset -F); do
+        case "$f" in
+        *_package)
+            set -- $f
+            echo "${3%_package}"
+            ;;
+        esac
     done
 }
 

From 19222d06798831d1813bb43e5601ad370fce7c22 Mon Sep 17 00:00:00 2001
From: Duncaen <duncaen@voidlinux.org>
Date: Wed, 12 Jun 2019 23:52:24 +0200
Subject: [PATCH 3/3] xbps-src: simplify set_build_options

---
 common/xbps-src/shutils/common.sh | 47 +++++++++----------------------
 1 file changed, 13 insertions(+), 34 deletions(-)

diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh
index 5328c3dcf9d..4c2f6204e39 100644
--- a/common/xbps-src/shutils/common.sh
+++ b/common/xbps-src/shutils/common.sh
@@ -154,7 +154,7 @@ msg_normal_append() {
 }
 
 set_build_options() {
-    local f j opt optval _optsset pkgopts _pkgname
+    local f j opt optval pkgopts _pkgname
     local -A options
 
     if [ -z "$build_options" ]; then
@@ -170,30 +170,21 @@ set_build_options() {
         fi
         OIFS="$IFS"; IFS=','
         for j in ${pkgopts}; do
-            opt=${j#\~}
-            opt_disabled=${j:0:1}
-            if [ "$opt" = "$f" ]; then
-                if [ "$opt_disabled" != "~" ]; then
-                    eval options[$opt]=1
-                else
-                    eval options[$opt]=0
-                fi
-            fi
+            case "$j" in
+            "$f") options[$j]=1 ;;
+            "~$f") options[${j#\~}]=0 ;;
+            esac
         done
         IFS="$OIFS"
     done
 
     for f in ${build_options_default}; do
-        optval=${options[$f]}
-        if [[ -z "$optval" ]] || [[ $optval -eq 1 ]]; then
-            options[$f]=1
-        fi
+        [[ -z "${options[$f]}" ]] && options[$f]=1
     done
 
     # Prepare final options.
     for f in ${!options[@]}; do
-        optval=${options[$f]}
-        if [[ $optval -eq 1 ]]; then
+        if [[ ${options[$f]} -eq 1 ]]; then
             eval export build_option_${f}=1
         else
             eval unset build_option_${f}
@@ -210,25 +201,13 @@ set_build_options() {
         return 0
     fi
 
-    for f in ${build_options}; do
-        eval optval=${options[$f]}
-        if [[ $optval -eq 1 ]]; then
-            _optsset+=" ${f}"
-        else
-            _optsset+=" ~${f}"
-        fi
-    done
-
-    for f in ${_optsset}; do
-        if [ -z "$PKG_BUILD_OPTIONS" ]; then
-            PKG_BUILD_OPTIONS="$f"
-        else
-            PKG_BUILD_OPTIONS+=" $f"
-        fi
-    done
-
     # Sort pkg build options alphabetically.
-    export PKG_BUILD_OPTIONS="$(echo "$PKG_BUILD_OPTIONS"|tr ' ' '\n'|sort|tr '\n' ' ')"
+    export PKG_BUILD_OPTIONS=$(
+        for f in ${build_options}; do
+            [[ "${options[$f]}" -eq 1 ]] || printf '~'
+            printf '%s\n' "$f"
+        done | sort
+    )
 }
 
 source_file() {

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

end of thread, other threads:[~2019-07-05  9:53 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-12 21:58 [PR PATCH] xbps-src improvements voidlinux-github
2019-06-12 22:00 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-12 22:00 ` voidlinux-github
2019-06-12 22:03 ` voidlinux-github
2019-06-12 22:41 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-12 22:41 ` voidlinux-github
2019-06-13 15:26 ` voidlinux-github
2019-06-13 15:26 ` voidlinux-github
2019-06-13 15:27 ` voidlinux-github
2019-06-13 15:27 ` voidlinux-github
2019-06-13 23:25 ` voidlinux-github
2019-06-13 23:25 ` voidlinux-github
2019-06-13 23:26 ` [PR PATCH] [Updated] [WIP] xbps-0.54 - " voidlinux-github
2019-06-13 23:26 ` voidlinux-github
2019-06-19  9:35 ` voidlinux-github
2019-07-05  9:47 ` [PR PATCH] [Closed]: " voidlinux-github
2019-07-05  9:51 ` voidlinux-github
2019-07-05  9:53 ` voidlinux-github

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