Github messages for voidlinux
 help / color / mirror / Atom feed
From: voidlinux-github@inbox.vuxu.org
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] xbps-src improvements
Date: Thu, 13 Jun 2019 00:00:49 +0200	[thread overview]
Message-ID: <20190612220049.AZtzUNHo34oHnCZ5kzkYQ2-ZwW3moJfMqV8XDjyk1s8@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-12433@inbox.vuxu.org>

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

There is an updated 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: 5253 bytes --]

From 4013b2c29c7e8b0d41b79f563b1ad3917ea98b46 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..62d6ae30aec 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" -a "z$show_problems" != "zignore-problems" ]; 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 c71032e87531e8772a901481ca900226be25948b 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 62d6ae30aec..3d5f72a9863 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 70f8870bf84af417d27fc58a2955f7a7aabf984a 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 3d5f72a9863..40e8b41f1ac 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() {

  parent reply	other threads:[~2019-06-12 22:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 21:58 [PR PATCH] " voidlinux-github
2019-06-12 22:00 ` [PR PATCH] [Updated] " voidlinux-github
2019-06-12 22:00 ` voidlinux-github [this message]
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

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=20190612220049.AZtzUNHo34oHnCZ5kzkYQ2-ZwW3moJfMqV8XDjyk1s8@z \
    --to=voidlinux-github@inbox.vuxu.org \
    --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).