[git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-15-g53d2eb3

by NIIBE Yutaka cvs at cvs.gnupg.org
Thu Aug 30 08:28:41 CEST 2018


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Error codes used by GnuPG et al.".

The branch, gniibe/pkg-config-support has been updated
       via  53d2eb399601bdea6cdfe3a5e90203585ddf9e4a (commit)
       via  66ba9c3ad0bf898137e252d9b3d27228656e6ecf (commit)
      from  78be78bd3d9129919544781e17c8d2fefea6e1de (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 53d2eb399601bdea6cdfe3a5e90203585ddf9e4a
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 15:27:54 2018 +0900

    Fixes src/gpg-error-config-main.sh and src/pkgconf-funcs.sh.

diff --git a/src/gpg-error-config-main.sh b/src/gpg-error-config-main.sh
index 0a0dd0f..1ead597 100644
--- a/src/gpg-error-config-main.sh
+++ b/src/gpg-error-config-main.sh
@@ -37,27 +37,28 @@ output_attr=""
 opt_cflags=no
 opt_libs=no
 output=""
+delimiter=" "
 
 while test $# -gt 0; do
     case $1 in
 	--prefix)
 	    # In future, use --variable=prefix instead.
 	    output_var=prefix
-	    break
 	    ;;
 	--exec-prefix)
 	    # In future, use --variable=exec_prefix instead.
 	    output_var=exec_prefix
-	    break
 	    ;;
 	--version)
 	    # In future, use --modversion instead.
 	    output_attr=Version
-	    break
+	    delimiter="
+"
 	    ;;
 	--modversion)
 	    output_attr=Version
-	    break
+	    delimiter="
+"
 	    ;;
 	--cflags)
 	    opt_cflags=yes
@@ -67,12 +68,10 @@ while test $# -gt 0; do
 	    ;;
 	--variable=*)
 	    output_var=${1#*=}
-	    break
 	    ;;
 	--host)
 	    # In future, use --variable=host instead.
 	    output_var=host
-	    break
 	    ;;
 	--help)
 	    usage 0
@@ -84,22 +83,27 @@ while test $# -gt 0; do
     shift
 done
 
-if [ -z "$modules" ]; then
-    modules=${myname%-config}
-fi
-
-if [ myname = "gpg-error-config" -a -z "$modules" ]; then
+if [ $myname = "gpg-error-config" -a -z "$modules" ]; then
     read_config_file ${myname%-config} $PKG_CONFIG_PATH
-    cflags="$(get_attr Cflags)"
-    libs="$(get_attr Libs)"
+    if [ -n "$output_var" ]; then
+	output="$output${output:+ }$(get_var $output_var)"
+    elif [ -n "$output_attr" ]; then
+	output="$output${output:+ }$(get_attr $output_attr)"
+    else
+	cflags="$(get_attr Cflags)"
+	libs="$(get_attr Libs)"
 
-    mtcflags="$(get_var mtcflags)"
-    mtlibs="$(get_var mtlibs)"
+	mtcflags="$(get_var mtcflags)"
+	mtlibs="$(get_var mtlibs)"
+    fi
 
     requires="$(get_attr Requires)"
     cleanup_vars_attrs
     pkg_list=$(all_required_config_files $requires)
 else
+    if [ -z "$modules" ]; then
+	modules=${myname%-config}
+    fi
     cflags=""
     libs=""
     pkg_list=$(all_required_config_files $modules)
@@ -107,24 +111,32 @@ fi
 
 for p in $pkg_list; do
     read_config_file $p $PKG_CONFIG_PATH
-    cflags="$cflags $(get_attr Cflags)"
-    libs="$libs $(get_attr Libs)"
+    if [ -n "$output_var" ]; then
+	output="$output${output:+$delimiter}$(get_var $output_var)"
+    elif [ -n "$output_attr" ]; then
+	output="$output${output:+$delimiter}$(get_attr $output_attr)"
+    else
+	cflags="$cflags${cflags:+ }$(get_attr Cflags)"
+	libs="$libs${libs:+ }$(get_attr Libs)"
+    fi
     cleanup_vars_attrs
 done
 
-if [ $opt_cflags = yes ]; then
-    output="$output $(list_only_once $cflags)"
-    # Backward compatibility to old gpg-error-config
-    if [ $mt = yes ]; then
-	output="$output $mtcflags"
+if [ -z "$output_var" -a -z "$output_attr" ]; then
+    if [ $opt_cflags = yes ]; then
+	output="$output $(list_only_once $cflags)"
+	# Backward compatibility to old gpg-error-config
+	if [ $mt = yes ]; then
+	    output="$output $mtcflags"
+	fi
     fi
-fi
-if [ $opt_libs = yes ]; then
-    output="$output $(list_only_once_for_libs $libs)"
-    # Backward compatibility to old gpg-error-config
-    if [ $mt = yes ]; then
-	output="$output $mtlibs"
+    if [ $opt_libs = yes ]; then
+	output="$output $(list_only_once_for_libs $libs)"
+	# Backward compatibility to old gpg-error-config
+	if [ $mt = yes ]; then
+	    output="$output $mtlibs"
+	fi
     fi
 fi
 
-echo $output
+echo "$output"
diff --git a/src/pkgconf-funcs.sh b/src/pkgconf-funcs.sh
index 04dabc1..7073f81 100644
--- a/src/pkgconf-funcs.sh
+++ b/src/pkgconf-funcs.sh
@@ -137,6 +137,7 @@ cleanup_vars_attrs () {
 
 not_listed_yet () {
     local m=$1
+    local arg
     shift
 
     for arg; do
@@ -153,7 +154,7 @@ list_only_once () {
     local arg
 
     for arg; do
-	if not_listed_yet $arg "$result"; then
+	if not_listed_yet $arg $result; then
 	    result="$result $arg"
 	fi
     done
@@ -163,7 +164,7 @@ list_only_once () {
 
 list_only_once_for_libs () {
     local result=""
-    loca rev_list=""
+    local rev_list=""
     local arg
 
     # Scan the list and eliminate duplicates for non-"-lxxx"
@@ -175,7 +176,7 @@ list_only_once_for_libs () {
 		rev_list="$arg $rev_list"
 		;;
 	    *)
-		if not_listed_yet $arg "$rev_list"; then
+		if not_listed_yet $arg $rev_list; then
 		    rev_list="$arg $rev_list"
 		fi
 		;;
@@ -186,7 +187,7 @@ list_only_once_for_libs () {
     for arg in $rev_list; do
 	case "$arg" in
 	    -l*)
-		if not_listed_yet $arg "$result"; then
+		if not_listed_yet $arg $result; then
 		    result="$arg $result"
 		fi
 		;;
@@ -206,11 +207,12 @@ list_only_once_for_libs () {
 # XXX: version requirement (version comparison) is not yet supported
 #
 all_required_config_files () {
-    local list="$1"
+    local list
     local all_list
     local new_list
     local p
 
+    list="$@"
     all_list="$list"
 
     while [ -n "$list" ]; do

commit 66ba9c3ad0bf898137e252d9b3d27228656e6ecf
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Thu Aug 30 14:36:35 2018 +0900

    Support invocation with module names.

diff --git a/src/gpg-error-config-main.sh b/src/gpg-error-config-main.sh
index c8ee06f..0a0dd0f 100644
--- a/src/gpg-error-config-main.sh
+++ b/src/gpg-error-config-main.sh
@@ -1,8 +1,7 @@
 
-if echo "$0" | grep gpg-error-config 2>/dev/null >/dev/null; then
+myname=${0##*/}
+if [ $myname = gpgrt-config ]; then
   myname="gpg-error-config"
-else
-  myname="gpgrt-config"
 fi
 
 usage()
@@ -32,39 +31,33 @@ else
     shift
 fi
 
-read_config_file ${myname%-config} $PKG_CONFIG_PATH
-
+modules=""
+output_var=""
+output_attr=""
 opt_cflags=no
 opt_libs=no
 output=""
 
 while test $# -gt 0; do
-    case "$1" in
-	-*=*)
-	    optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'`
-	    ;;
-	*)
-	    optarg=
-	    ;;
-    esac
-
     case $1 in
 	--prefix)
 	    # In future, use --variable=prefix instead.
-	    output="$output $(get_var prefix)"
+	    output_var=prefix
+	    break
 	    ;;
 	--exec-prefix)
 	    # In future, use --variable=exec_prefix instead.
-	    output="$output $(get_var exec_prefix)"
+	    output_var=exec_prefix
+	    break
 	    ;;
 	--version)
 	    # In future, use --modversion instead.
-	    echo "$(get_attr Version)"
-	    exit 0
+	    output_attr=Version
+	    break
 	    ;;
 	--modversion)
-	    echo "$(get_attr Version)"
-	    exit 0
+	    output_attr=Version
+	    break
 	    ;;
 	--cflags)
 	    opt_cflags=yes
@@ -73,30 +66,44 @@ while test $# -gt 0; do
 	    opt_libs=yes
 	    ;;
 	--variable=*)
-	    echo "$(get_var ${1#*=})"
-	    exit 0
+	    output_var=${1#*=}
+	    break
 	    ;;
 	--host)
 	    # In future, use --variable=host instead.
-	    echo "$(get_var host)"
-	    exit 0
+	    output_var=host
+	    break
+	    ;;
+	--help)
+	    usage 0
 	    ;;
 	*)
-	    usage 1 1>&2
+	    modules="$modules $1"
 	    ;;
     esac
     shift
 done
 
-cflags="$(get_attr Cflags)"
-libs="$(get_attr Libs)"
+if [ -z "$modules" ]; then
+    modules=${myname%-config}
+fi
+
+if [ myname = "gpg-error-config" -a -z "$modules" ]; then
+    read_config_file ${myname%-config} $PKG_CONFIG_PATH
+    cflags="$(get_attr Cflags)"
+    libs="$(get_attr Libs)"
 
-mtcflags="$(get_var mtcflags)"
-mtlibs="$(get_var mtlibs)"
+    mtcflags="$(get_var mtcflags)"
+    mtlibs="$(get_var mtlibs)"
 
-requires="$(get_attr Requires)"
-cleanup_vars_attrs
-pkg_list=$(all_required_config_files $requires)
+    requires="$(get_attr Requires)"
+    cleanup_vars_attrs
+    pkg_list=$(all_required_config_files $requires)
+else
+    cflags=""
+    libs=""
+    pkg_list=$(all_required_config_files $modules)
+fi
 
 for p in $pkg_list; do
     read_config_file $p $PKG_CONFIG_PATH

-----------------------------------------------------------------------

Summary of changes:
 src/gpg-error-config-main.sh | 111 +++++++++++++++++++++++++------------------
 src/pkgconf-funcs.sh         |  12 +++--
 2 files changed, 72 insertions(+), 51 deletions(-)


hooks/post-receive
-- 
Error codes used by GnuPG et al.
http://git.gnupg.org




More information about the Gnupg-commits mailing list