From cvs at cvs.gnupg.org Sun Sep 2 11:11:30 2018 From: cvs at cvs.gnupg.org (by Ben McGinnes) Date: Sun, 02 Sep 2018 11:11:30 +0200 Subject: [git] GPGME - branch, master, updated. gpgme-1.11.1-268-g879cc1f Message-ID: 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 "GnuPG Made Easy". The branch, master has been updated via 879cc1f84fbf09cb4eeb78bce16f52a1a36032ba (commit) from dacb1197155cb953953b75677c1783df2cba0ed6 (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 879cc1f84fbf09cb4eeb78bce16f52a1a36032ba Author: Ben McGinnes Date: Sun Sep 2 19:07:18 2018 +1000 estreams symbols for python bindings * It turns out that even though some platforms detect differing symbols for estreams, the two types do not appear to be in conflict. At least they don't from the BSD/OS X side of things. As a consequence both versions are now included. Tested-by: Ben McGinnes Signed-off-by: Ben McGinnes diff --git a/src/gpgme.def b/src/gpgme.def index f0f748e..3373f2c 100644 --- a/src/gpgme.def +++ b/src/gpgme.def @@ -272,7 +272,8 @@ EXPORTS gpgme_op_encrypt_sign_ext @202 gpgme_op_encrypt_sign_ext_start @203 - _gpgme_data_new_from_estream @204 + gpgme_data_new_from_estream @204 + _gpgme_data_new_from_estream @205 ; END diff --git a/src/libgpgme.vers b/src/libgpgme.vers index 8faed5e..431d9e0 100644 --- a/src/libgpgme.vers +++ b/src/libgpgme.vers @@ -134,6 +134,7 @@ GPGME_1.1 { gpgme_op_decrypt_ext; gpgme_op_decrypt_ext_start; + gpgme_data_new_from_estream; _gpgme_data_new_from_estream; }; ----------------------------------------------------------------------- Summary of changes: src/gpgme.def | 3 ++- src/libgpgme.vers | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) hooks/post-receive -- GnuPG Made Easy http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 3 04:36:14 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 03 Sep 2018 04:36:14 +0200 Subject: [git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-22-g83d523e Message-ID: 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 83d523e4b9c480594af0d834b36d5897dddf13ec (commit) via 8a6ca0194b6c4ba5dd839c25f97e594017fcd7e7 (commit) via 5a30c1dc7843abe252dc870a51e5510ebf291d96 (commit) via 433075092cd16b3425e4e31ad5a927f697eae646 (commit) via 576499c264eb5ac6a1281d7fb933c0e0634e8259 (commit) from fb1d0cd7105e0603482257e05c559c035b210c9c (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 83d523e4b9c480594af0d834b36d5897dddf13ec Author: NIIBE Yutaka Date: Mon Sep 3 11:29:47 2018 +0900 Fix new gpg-error-config and add a test. diff --git a/src/Makefile.am b/src/Makefile.am index c1efb94..5ba1496 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -115,6 +115,7 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) $(tmp_files) lock-obj-pub.native.h +TESTS=gpg-error-config-test.sh # # {{{ Begin Windows part diff --git a/src/gpg-error-config-new.in b/src/gpg-error-config-new.in index 307b3df..ddf6af2 100644 --- a/src/gpg-error-config-new.in +++ b/src/gpg-error-config-new.in @@ -16,7 +16,7 @@ datadir=@datadir@ PKG_CONFIG_PATH="$PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:}${datadir}/pkgconfig" # -#### start of pkgconf-funcs +#### start of functions for this script # # Bourne shell functions for config file in pkg-config style, so that @@ -394,9 +394,12 @@ all_required_config_files () { pkg_list=$(list_only_once $all_list) } -#### end of pkgconf-funcs +#### end of functions for this script myname=${0##*/} +# Just for a while for testing +myname=${myname%-new} +############################## if [ $myname = gpgrt-config ]; then myname="gpg-error-config" fi @@ -522,15 +525,15 @@ if [ -z "$want_var" -a -z "$want_attr" ]; then if [ -n "$want_cflags" ]; then output="$output${output:+ }$(list_only_once $cflags)" # Backward compatibility to old gpg-error-config - if [ $mt = yes ]; then - output="$output $mtcflags" + if [ $mt = yes -a -n "$mtcflags" ]; then + output="$output${output:+ }$mtcflags" fi fi if [ -n "$want_libs" ]; then output="$output${output:+ }$(list_only_once_for_libs $libs)" # Backward compatibility to old gpg-error-config - if [ $mt = yes ]; then - output="$output $mtlibs" + if [ $mt = yes -a -n "$mtlibs" ]; then + output="$output${output:+ }$mtlibs" fi fi fi diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh new file mode 100755 index 0000000..d65c06d --- /dev/null +++ b/src/gpg-error-config-test.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +PKG_CONFIG_PATH="." + +export PKG_CONFIG_PATH + +OUTPUT_OLD=$(./gpg-error-config --version) +OUTPUT_NEW=$(./gpg-error-config-new --version) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +OUTPUT_OLD=$(./gpg-error-config --libs) +OUTPUT_NEW=$(./gpg-error-config-new --libs) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +OUTPUT_OLD=$(./gpg-error-config --cflags) +OUTPUT_NEW=$(./gpg-error-config-new --cflags) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +OUTPUT_OLD=$(./gpg-error-config --mt --libs) +OUTPUT_NEW=$(./gpg-error-config-new --mt --libs) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +OUTPUT_OLD=$(./gpg-error-config --mt --cflags) +OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +OUTPUT_OLD=$(./gpg-error-config --cflags --libs) +OUTPUT_NEW=$(./gpg-error-config-new --cflags --libs) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +OUTPUT_OLD=$(./gpg-error-config --mt --cflags --libs) +OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + +exit 0 commit 8a6ca0194b6c4ba5dd839c25f97e594017fcd7e7 Author: NIIBE Yutaka Date: Mon Sep 3 11:29:00 2018 +0900 Fix old gpg-config-error with configure.ac substitution. diff --git a/configure.ac b/configure.ac index 9d629d4..16896a6 100644 --- a/configure.ac +++ b/configure.ac @@ -495,11 +495,11 @@ else fi GPG_ERROR_CONFIG_HOST="$host" case "$includedir" in - '${prefix}/include'|/usr/include|/include) ;; + /usr/include|/include) ;; *) GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" ;; esac case "$libdir" in - '${exec_prefix}/lib'|/usr/lib|/usr/lib64|/lib|/lib64) ;; + /usr/lib|/usr/lib64|/lib|/lib64) ;; *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;; esac diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index 92bc13a..93f25f7 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -68,21 +68,12 @@ while test $# -gt 0; do exit 0 ;; --cflags) - if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then - output="$output -I$includedir" - fi output="$output @GPG_ERROR_CONFIG_CFLAGS@" if test $mt = yes ; then output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@" fi ;; --libs) - case "$libdir" in - /usr/lib|/usr/lib64|/lib|/lib64) ;; - *) - output="$output -L$libdir" - ;; - esac output="$output @GPG_ERROR_CONFIG_LIBS@" if test $mt = yes ; then output="$output @GPG_ERROR_CONFIG_MT_LIBS@" commit 5a30c1dc7843abe252dc870a51e5510ebf291d96 Author: NIIBE Yutaka Date: Mon Sep 3 10:25:18 2018 +0900 Change old gpg-error-config for isubdirafter. diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index aa7cb67..92bc13a 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -14,7 +14,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ -isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@" if echo "$0" | grep gpg-error-config 2>/dev/null >/dev/null; then myname="gpg-error-config" @@ -72,11 +71,6 @@ while test $# -gt 0; do if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then output="$output -I$includedir" fi - # Note: -idirafter is a gcc extension. It is only used on - # systems where gcc is the only compiler we support (WindowsCE). - for i in $isubdirafter; do - output="$output -idirafter ${includedir}/${i}" - done output="$output @GPG_ERROR_CONFIG_CFLAGS@" if test $mt = yes ; then output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@" commit 433075092cd16b3425e4e31ad5a927f697eae646 Author: NIIBE Yutaka Date: Mon Sep 3 10:22:42 2018 +0900 Add back old gpg-error-config. diff --git a/configure.ac b/configure.ac index 58957b7..9d629d4 100644 --- a/configure.ac +++ b/configure.ac @@ -635,6 +635,7 @@ AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd]) AC_CONFIG_FILES([src/versioninfo.rc src/gpg-error.w32-manifest]) AC_CONFIG_FILES([src/gpg-error.pc]) AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config]) +AC_CONFIG_FILES([src/gpg-error-config-new], [chmod +x src/gpg-error-config-new]) AC_OUTPUT diff --git a/src/gpg-error-config.in b/src/gpg-error-config-new.in similarity index 100% copy from src/gpg-error-config.in copy to src/gpg-error-config-new.in diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index 307b3df..aa7cb67 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -11,396 +11,20 @@ # SPDX-License-Identifier: FSFULLR prefix=@prefix@ -datarootdir=@datarootdir@ -datadir=@datadir@ -PKG_CONFIG_PATH="$PKG_CONFIG_PATH${PKG_CONFIG_PATH:+:}${datadir}/pkgconfig" -# - -#### start of pkgconf-funcs - -# -# Bourne shell functions for config file in pkg-config style, so that -# we can share such a config file between pkg-config and script -# - -# -# get_var: Get the variable value of NAME -# -# Variables are recorded in the shell variables named "VAR_" -# -get_var () { - local name=$1 - - eval echo \$VAR_$name -} - -# -# get_attr: Get the attribute value of KEY -# -# Attributes are recorded in the shell variables named "ATTR_" -# -get_attr () { - local name=$1 - - eval echo \$ATTR_$name -} - -# Remove ${varname} part in the beginning of a string. -remove_var_expr () { - local varname=$1 - shift - - eval echo \"\${@#\\\$\\\{$varname\\\}}\" -} - -# Given a string, substitute variables. -substitute_vars () { - local string="$1" - local line - local varname - local result - - while [ -n "$string" ]; do - case "$string" in - \$\$*) - result="$result\$" - string="${string#\$\$}" - ;; - \${*}*) - varname="${string#\$\{}" - varname="${varname%%\}*}" - result="$result$(get_var ${varname})" - string=$(remove_var_expr ${varname} ${string}) - ;; - *) - result="${result}$(printf %c "$string")" - string="${string#$(printf %c "$string")}" - ;; - esac - done - - echo "$result" -} - -# -# Read a config from stdin -# -# Variables: -# For VAR=VALUE, value is stored in the shell variable VAR_*. -# -# Attributes: -# For KEY: VALUE, value is stored in the shell variable ATTR_*. -# -read_config_from_stdin () { - local filename=$1 - local line - local varname - local value - local key - local reading_attrs - - while read line; do - if [ -z "$line" ]; then - reading_attrs=yes - continue - elif [ -z "$reading_attrs" ]; then - case "$line" in - *=*) - varname="${line%%=*}" - value="${line#*=}" - VAR_list="$VAR_list VAR_$varname" - read VAR_$varname <&2 - exit 1 - ;; - esac - fi - done -} - - -find_file_in_path () { - local f=$1 - local p=$2 - local IFS=":" # On Windows it should be ";"??? - - for d in $p; do - if [ -r $d/$f ]; then - RESULT="$d/$f" - return 0 - fi - done - RESULT="" - return 1 -} - -read_config_file () { - local config_file - local RESULT - - if find_file_in_path $1.pc $2; then - config_file=$RESULT - else - echo "Can't find $1.pc" 1>&2 - exit 1 - fi - read_config_from_stdin $config_file < $config_file -} - -cleanup_vars_attrs () { - eval unset $VAR_list VAR_list - eval unset $ATTR_list ATTR_list -} - -not_listed_yet () { - local m=$1 - local arg - shift - - for arg; do - if [ $m = $arg ]; then - return 1 - fi - done - - return 0 -} - -list_only_once () { - local result="" - local arg - - for arg; do - if not_listed_yet $arg $result; then - result="$result $arg" - fi - done - - echo $result -} +exec_prefix=@exec_prefix@ +includedir=@includedir@ +libdir=@libdir@ +isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@" -list_only_once_for_libs () { - local result="" - local rev_list="" - local arg - - # Scan the list and eliminate duplicates for non-"-lxxx" - # the resulted list is in reverse order - for arg; do - case "$arg" in - -l*) - # As-is - rev_list="$arg $rev_list" - ;; - *) - if not_listed_yet $arg $rev_list; then - rev_list="$arg $rev_list" - fi - ;; - esac - done - - # Scan again - for arg in $rev_list; do - case "$arg" in - -l*) - if not_listed_yet $arg $result; then - result="$arg $result" - fi - ;; - *) - # As-is - result="$arg $result" - ;; - esac - done - - echo $result -} - -arg1_is_same () { - [ "$1" = "=" -o "$1" = ">=" -o "$1" = "<=" ] -} - -arg1_is_less () { - [ "$1" = "!=" -o "$1" = "<" -o "$1" = "<=" ] -} - -arg1_is_great () { - [ "$1" = "!=" -o "$1" = ">" -o "$1" = ">=" ] -} - -# -# Evaluate comparison between versions in RPM way -# -eval_compare_version () { - local str1="$1" - local cmp="$2" - local str2="$3" - local char1 char2 - local chunk1 chunk2 - - while [ -n "$str1" -a -n "$str2" ]; do - # Trim anything that's not alnum or tilde from the front - str1="$(expr "$str1" : '[^0-9A-Za-z~]*\(.*\)')" - str2="$(expr "$str2" : '[^0-9A-Za-z~]*\(.*\)')" - - # Get the first character - char1=${str1%${str1#?}} - char2=${str2%${str2#?}} - - if [ "$char1" = ~ -o "$char2" = ~ ]; then - if [ "$char1" != ~ ]; then - arg1_is_great $cmp - return - fi - if [ "$char2" != ~ ]; then - arg1_is_less $cmp - return - fi - str1=${str1#~} - str2=${str2#~} - continue - fi - - if [ -z "$char1" -o -z "$char2" ]; then - break - fi - - case "$char1$char2" in - [0-9][A-Za-z]) - arg1_is_great $cmp - return - ;; - [A-Za-z][0-9]) - arg1_is_less $cmp - return - ;; - [0-9][0-9]) - chunk1="$(expr "$str1" : '\([0-9]*\)')" - chunk2="$(expr "$str2" : '\([0-9]*\)')" - ;; - [A-Za-z][A-Za-z]) - chunk1="$(expr "$str1" : '\([A-Za-z]*\)')" - chunk2="$(expr "$str2" : '\([A-Za-z]*\)')" - ;; - esac - - # Compare chunks numerically if digits, or lexicographically - if expr "$chunk1" "!=" "$chunk2" >/dev/null; then - if expr "$chunk1" ">" "$chunk2" >/dev/null; then - arg1_is_great $cmp - return - else - arg1_is_less $cmp - return - fi - fi - - # Remove the chunk - str1="${str1#$chunk1}" - str2="${str2#$chunk2}" - done - - # Either STR1, STR2 or both is empty here - if [ -n "$str1" ]; then - case "$str1" in - ~*) arg1_is_less $cmp ;; - *) arg1_is_great $cmp ;; - esac - elif [ -n "$str2" ]; then - case "$str2" in - ~*) arg1_is_great $cmp ;; - *) arg1_is_less $cmp ;; - esac - else - arg1_is_same $cmp - fi -} - -# -# Recursively solve package dependencies -# -# Result is in the pkg_list variable -# -all_required_config_files () { - local list - local all_list - local new_list - local p pkg cmp ver - - list=$* - while [ -n "$list" ]; do - for p in $list; do - if [ -z "$pkg" ]; then - pkg=$p - elif [ -z "$cmp" ]; then - case "$p" in - "="|"!="|"<"|">"|"<="|">=") cmp=$p ;; - *) - read_config_file $pkg $PKG_CONFIG_PATH - all_list="$all_list $pkg" - new_list="$new_list${new_list:+ }$(get_attr Requires)" - cleanup_vars_attrs - pkg=$p - ;; - esac - else - read_config_file $pkg $PKG_CONFIG_PATH - if ! eval_compare_version "$(get_attr Version)" $cmp $p; then - echo "Version mismatch for $pkg $cmp $p: $(get_attr Version)" 1>&2 - exit 1 - fi - all_list="$all_list $pkg" - new_list="$new_list${new_list:+ }$(get_attr Requires)" - cleanup_vars_attrs - pkg= - cmp= - fi - done - if [ -n "$cmp" ]; then - echo "No version after comparison operator ($cmp): $pkg" 1>&2 - exit 1 - elif [ -n "$pkg" ]; then - read_config_file $pkg $PKG_CONFIG_PATH - all_list="$all_list $pkg" - new_list="$new_list${new_list:+ }$(get_attr Requires)" - cleanup_vars_attrs - fi - - list="$new_list" - new_list="" - done - - pkg_list=$(list_only_once $all_list) -} - -#### end of pkgconf-funcs - -myname=${0##*/} -if [ $myname = gpgrt-config ]; then +if echo "$0" | grep gpg-error-config 2>/dev/null >/dev/null; then myname="gpg-error-config" +else + myname="gpgrt-config" fi +output="" +mt=no + usage() { cat <&2 fi -if [ "$1" != "--mt" ]; then - mt=no -else - # In future, use --variable=mtcflags or --variable=mtlibs - mt=yes - shift -fi - -modules="" -want_var="" -want_attr="" -want_cflags="" -want_libs="" - -cflags="" -libs="" -mtcflags="" -mtlibs="" - -delimiter=" " -output="" - while test $# -gt 0; do - case $1 in - --prefix) - # In future, use --variable=prefix instead. - want_var=prefix + case "$1" in + -*=*) + optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; - --exec-prefix) - # In future, use --variable=exec_prefix instead. - want_var=exec_prefix - ;; - --version) - # In future, use --modversion instead. - want_attr=Version - delimiter=" -" - ;; - --modversion) - want_attr=Version - delimiter=" -" - ;; - --cflags) - want_cflags=yes + *) + optarg= ;; - --libs) - want_libs=yes + esac + + case $1 in + --mt) + mt=yes + ;; + --prefix) + output="$output $prefix" ;; - --variable=*) - want_var=${1#*=} + --exec-prefix) + output="$output $exec_prefix" ;; - --host) - # In future, use --variable=host instead. - want_var=host + --version) + echo "@PACKAGE_VERSION@" + exit 0 ;; - --help) - usage 0 + --cflags) + if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then + output="$output -I$includedir" + fi + # Note: -idirafter is a gcc extension. It is only used on + # systems where gcc is the only compiler we support (WindowsCE). + for i in $isubdirafter; do + output="$output -idirafter ${includedir}/${i}" + done + output="$output @GPG_ERROR_CONFIG_CFLAGS@" + if test $mt = yes ; then + output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@" + fi ;; - --*) - usage 1 1>&2 + --libs) + case "$libdir" in + /usr/lib|/usr/lib64|/lib|/lib64) ;; + *) + output="$output -L$libdir" + ;; + esac + output="$output @GPG_ERROR_CONFIG_LIBS@" + if test $mt = yes ; then + output="$output @GPG_ERROR_CONFIG_MT_LIBS@" + fi ;; + --host) + echo "@GPG_ERROR_CONFIG_HOST@" + exit 0 + ;; *) - # Modules - modules="$modules${modules:+ }$1" + usage 1 1>&2 ;; esac - shift done - -if [ -z "$modules" ]; then - modules=${myname%-config} -elif expr match "$modules" "=\|!=\|<\|>\|<=\|>=" >/dev/null; then - modules="${myname%-config} $modules" -fi - -all_required_config_files $modules - -for p in $pkg_list; do - read_config_file $p $PKG_CONFIG_PATH - if [ -n "$want_var" ]; then - output="$output${output:+$delimiter}$(get_var $want_var)" - elif [ -n "$want_attr" ]; then - output="$output${output:+$delimiter}$(get_attr $want_attr)" - else - cflags="$cflags${cflags:+ }$(get_attr Cflags)" - libs="$libs${libs:+ }$(get_attr Libs)" - - if [ $p = "gpg-error" ]; then - mtcflags="$(get_var mtcflags)" - mtlibs="$(get_var mtlibs)" - fi - fi - cleanup_vars_attrs -done - -if [ -z "$want_var" -a -z "$want_attr" ]; then - if [ -n "$want_cflags" ]; then - output="$output${output:+ }$(list_only_once $cflags)" - # Backward compatibility to old gpg-error-config - if [ $mt = yes ]; then - output="$output $mtcflags" - fi - fi - if [ -n "$want_libs" ]; then - output="$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 commit 576499c264eb5ac6a1281d7fb933c0e0634e8259 Author: NIIBE Yutaka Date: Mon Sep 3 10:16:34 2018 +0900 Support invocation like gpg-erro-config '>=' 1.32. diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index 49451e7..307b3df 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -359,7 +359,7 @@ all_required_config_files () { *) read_config_file $pkg $PKG_CONFIG_PATH all_list="$all_list $pkg" - new_list="$new_list $(get_attr Requires)" + new_list="$new_list${new_list:+ }$(get_attr Requires)" cleanup_vars_attrs pkg=$p ;; @@ -371,7 +371,7 @@ all_required_config_files () { exit 1 fi all_list="$all_list $pkg" - new_list="$new_list $(get_attr Requires)" + new_list="$new_list${new_list:+ }$(get_attr Requires)" cleanup_vars_attrs pkg= cmp= @@ -383,7 +383,7 @@ all_required_config_files () { elif [ -n "$pkg" ]; then read_config_file $pkg $PKG_CONFIG_PATH all_list="$all_list $pkg" - new_list="$new_list $(get_attr Requires)" + new_list="$new_list${new_list:+ }$(get_attr Requires)" cleanup_vars_attrs fi @@ -429,105 +429,104 @@ else fi modules="" -output_var="" -output_attr="" -opt_cflags=no -opt_libs=no -output="" +want_var="" +want_attr="" +want_cflags="" +want_libs="" + +cflags="" +libs="" +mtcflags="" +mtlibs="" + delimiter=" " +output="" while test $# -gt 0; do case $1 in --prefix) # In future, use --variable=prefix instead. - output_var=prefix + want_var=prefix ;; --exec-prefix) # In future, use --variable=exec_prefix instead. - output_var=exec_prefix + want_var=exec_prefix ;; --version) # In future, use --modversion instead. - output_attr=Version + want_attr=Version delimiter=" " ;; --modversion) - output_attr=Version + want_attr=Version delimiter=" " ;; --cflags) - opt_cflags=yes + want_cflags=yes ;; --libs) - opt_libs=yes + want_libs=yes ;; --variable=*) - output_var=${1#*=} + want_var=${1#*=} ;; --host) # In future, use --variable=host instead. - output_var=host + want_var=host ;; --help) usage 0 ;; + --*) + usage 1 1>&2 + ;; *) - modules="$modules $1" + # Modules + modules="$modules${modules:+ }$1" ;; esac + shift done -if [ $myname = "gpg-error-config" -a -z "$modules" ]; then - read_config_file ${myname%-config} $PKG_CONFIG_PATH - 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)" - fi - - requires="$(get_attr Requires)" - cleanup_vars_attrs - all_required_config_files $requires -else - if [ -z "$modules" ]; then - modules=${myname%-config} - fi - cflags="" - libs="" - all_required_config_files $modules +if [ -z "$modules" ]; then + modules=${myname%-config} +elif expr match "$modules" "=\|!=\|<\|>\|<=\|>=" >/dev/null; then + modules="${myname%-config} $modules" fi +all_required_config_files $modules + for p in $pkg_list; do read_config_file $p $PKG_CONFIG_PATH - 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)" + if [ -n "$want_var" ]; then + output="$output${output:+$delimiter}$(get_var $want_var)" + elif [ -n "$want_attr" ]; then + output="$output${output:+$delimiter}$(get_attr $want_attr)" else cflags="$cflags${cflags:+ }$(get_attr Cflags)" libs="$libs${libs:+ }$(get_attr Libs)" + + if [ $p = "gpg-error" ]; then + mtcflags="$(get_var mtcflags)" + mtlibs="$(get_var mtlibs)" + fi fi cleanup_vars_attrs done -if [ -z "$output_var" -a -z "$output_attr" ]; then - if [ $opt_cflags = yes ]; then +if [ -z "$want_var" -a -z "$want_attr" ]; then + if [ -n "$want_cflags" ]; then output="$output${output:+ }$(list_only_once $cflags)" # Backward compatibility to old gpg-error-config if [ $mt = yes ]; then output="$output $mtcflags" fi fi - if [ $opt_libs = yes ]; then + if [ -n "$want_libs" ]; then output="$output${output:+ }$(list_only_once_for_libs $libs)" # Backward compatibility to old gpg-error-config if [ $mt = yes ]; then ----------------------------------------------------------------------- Summary of changes: configure.ac | 5 +- src/Makefile.am | 1 + ...gpg-error-config.in => gpg-error-config-new.in} | 108 +++-- src/gpg-error-config-test.sh | 35 ++ src/gpg-error-config.in | 532 ++------------------- 5 files changed, 137 insertions(+), 544 deletions(-) copy src/{gpg-error-config.in => gpg-error-config-new.in} (85%) create mode 100755 src/gpg-error-config-test.sh hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Mon Sep 3 06:01:30 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Mon, 03 Sep 2018 06:01:30 +0200 Subject: [git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-23-ga2cb8c2 Message-ID: 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 a2cb8c2451d9df5bded10d767eec263cd2739e0a (commit) from 83d523e4b9c480594af0d834b36d5897dddf13ec (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 a2cb8c2451d9df5bded10d767eec263cd2739e0a Author: NIIBE Yutaka Date: Mon Sep 3 13:00:10 2018 +0900 Not by "make check" but gpg-error-config is determined by the test. diff --git a/configure.ac b/configure.ac index 16896a6..ad78677 100644 --- a/configure.ac +++ b/configure.ac @@ -634,7 +634,7 @@ AC_CONFIG_FILES([src/Makefile tests/Makefile]) AC_CONFIG_FILES([lang/Makefile lang/cl/Makefile lang/cl/gpg-error.asd]) AC_CONFIG_FILES([src/versioninfo.rc src/gpg-error.w32-manifest]) AC_CONFIG_FILES([src/gpg-error.pc]) -AC_CONFIG_FILES([src/gpg-error-config], [chmod +x src/gpg-error-config]) +AC_CONFIG_FILES([src/gpg-error-config-old:src/gpg-error-config.in], [chmod +x src/gpg-error-config-old]) AC_CONFIG_FILES([src/gpg-error-config-new], [chmod +x src/gpg-error-config-new]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index 5ba1496..69cc487 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -96,7 +96,8 @@ EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ mkerrcodes.awk mkerrcodes1.awk mkerrcodes2.awk mkerrcodes.c \ mkheader.c gpg-error.h.in mkw32errmap.c w32-add.h w32ce-add.h \ err-sources.h err-codes.h \ - gpg-error-config.in \ + gpg-error-config-old.in gpg-error-config-test.sh \ + gpg-error-config-new.in \ gpg-error.pc.in \ gpg-error.m4 gpgrt.m4 \ gpg-error.vers gpg-error.def.in \ @@ -115,8 +116,6 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) $(tmp_files) lock-obj-pub.native.h -TESTS=gpg-error-config-test.sh - # # {{{ Begin Windows part # @@ -331,6 +330,14 @@ gpgrt.h: gpg-error.h gpgrt-config: gpg-error-config cp gpg-error-config gpgrt-config +gpg-error-config: gpg-error-config-new gpg-error-config-old + if $(srcdir)/gpg-error-config-test.sh; then \ + cp gpg-error-config-new $@; \ + else \ + echo "New gpg-error-config doesn't work on this machine, please report to " \ + cp gpg-error-config-old $@; \ + fi + install-data-local: if HAVE_W32CE_SYSTEM -$(MKDIR_P) "$(DESTDIR)$(includedir)/gpg-extra" diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh index d65c06d..9d8c2ce 100755 --- a/src/gpg-error-config-test.sh +++ b/src/gpg-error-config-test.sh @@ -4,31 +4,31 @@ PKG_CONFIG_PATH="." export PKG_CONFIG_PATH -OUTPUT_OLD=$(./gpg-error-config --version) +OUTPUT_OLD=$(./gpg-error-config-old --version) OUTPUT_NEW=$(./gpg-error-config-new --version) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 -OUTPUT_OLD=$(./gpg-error-config --libs) +OUTPUT_OLD=$(./gpg-error-config-old --libs) OUTPUT_NEW=$(./gpg-error-config-new --libs) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 -OUTPUT_OLD=$(./gpg-error-config --cflags) +OUTPUT_OLD=$(./gpg-error-config-old --cflags) OUTPUT_NEW=$(./gpg-error-config-new --cflags) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 -OUTPUT_OLD=$(./gpg-error-config --mt --libs) +OUTPUT_OLD=$(./gpg-error-config-old --mt --libs) OUTPUT_NEW=$(./gpg-error-config-new --mt --libs) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 -OUTPUT_OLD=$(./gpg-error-config --mt --cflags) +OUTPUT_OLD=$(./gpg-error-config-old --mt --cflags) OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 -OUTPUT_OLD=$(./gpg-error-config --cflags --libs) +OUTPUT_OLD=$(./gpg-error-config-old --cflags --libs) OUTPUT_NEW=$(./gpg-error-config-new --cflags --libs) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 -OUTPUT_OLD=$(./gpg-error-config --mt --cflags --libs) +OUTPUT_OLD=$(./gpg-error-config-old --mt --cflags --libs) OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 ----------------------------------------------------------------------- Summary of changes: configure.ac | 2 +- src/Makefile.am | 13 ++++++++++--- src/gpg-error-config-test.sh | 14 +++++++------- 3 files changed, 18 insertions(+), 11 deletions(-) hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 4 03:52:43 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 04 Sep 2018 03:52:43 +0200 Subject: [git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-26-g1b025ca Message-ID: 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 1b025ca89b58cb630530084c49e40166e4a8e089 (commit) via 6bca1ddc29a70a4efa9ea874f8bbb64772470842 (commit) via 129e75fabd4a97832296ad2677de79bc61fb1ce0 (commit) from a2cb8c2451d9df5bded10d767eec263cd2739e0a (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 1b025ca89b58cb630530084c49e40166e4a8e089 Author: NIIBE Yutaka Date: Tue Sep 4 10:43:29 2018 +0900 Fix configure time check for includedir and libdir. diff --git a/configure.ac b/configure.ac index ad78677..8389b67 100644 --- a/configure.ac +++ b/configure.ac @@ -494,12 +494,37 @@ else GPG_ERROR_CONFIG_MT_CFLAGS="" fi GPG_ERROR_CONFIG_HOST="$host" + case "$includedir" in /usr/include|/include) ;; - *) GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" ;; + '${prefix}/include') + if test "$prefix" != / -a "$prefix" != /usr; then + if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then + GPG_ERROR_CONFIG_CFLAGS="-I$includedir" + else + GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" + fi + fi + ;; + *) + if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then + GPG_ERROR_CONFIG_CFLAGS="-I$includedir" + else + GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" + fi + ;; esac case "$libdir" in /usr/lib|/usr/lib64|/lib|/lib64) ;; + '${exec_prefix}/lib') + if test "$exec_prefix" = "NONE"; then + if test "$prefix" != / -a "$prefix" != /usr; then + GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" + fi + elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then + GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" + fi + ;; *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;; esac @@ -509,6 +534,7 @@ AC_SUBST(GPG_ERROR_CONFIG_MT_LIBS) AC_SUBST(GPG_ERROR_CONFIG_MT_CFLAGS) AC_SUBST(GPG_ERROR_CONFIG_HOST) + # # Special defines for certain platforms # diff --git a/src/Makefile.am b/src/Makefile.am index 04b8fb6..d631ee2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -336,12 +336,14 @@ gpgrt-config: gpg-error-config cp gpg-error-config gpgrt-config gpg-error-config: gpg-error-config-new gpg-error-config-old - @echo "Confirm gpg-error-config works" + @echo "Confirm gpg-error-config works... " @if $(srcdir)/gpg-error-config-test.sh --old-new; then \ - cp gpg-error-config-new $@; \ - else \ - echo "*** New gpg-error-config doesn't work on this machine, please report to "; \ - cp gpg-error-config-old $@; \ + echo "good"; \ + cp gpg-error-config-new $@; \ + else \ + echo "no"; \ + echo "*** Please report to with gpg-error-config-test.log"; \ + cp gpg-error-config-old $@; \ fi install-data-local: commit 6bca1ddc29a70a4efa9ea874f8bbb64772470842 Author: NIIBE Yutaka Date: Tue Sep 4 09:39:23 2018 +0900 Add gpg-error-config to CLEANFILES. diff --git a/src/Makefile.am b/src/Makefile.am index 81be641..04b8fb6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -116,7 +116,7 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \ - gpg-error-config-test.log \ + gpg-error-config gpg-error-config-test.log \ $(tmp_files) lock-obj-pub.native.h TESTS = gpg-error-config-test.sh commit 129e75fabd4a97832296ad2677de79bc61fb1ce0 Author: NIIBE Yutaka Date: Tue Sep 4 09:34:56 2018 +0900 Extend gpg-error-config-test.sh to test against pkg-config. diff --git a/src/Makefile.am b/src/Makefile.am index 69cc487..81be641 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -102,6 +102,7 @@ EXTRA_DIST = mkstrtable.awk err-sources.h.in err-codes.h.in \ gpg-error.m4 gpgrt.m4 \ gpg-error.vers gpg-error.def.in \ versioninfo.rc.in gpg-error.w32-manifest.in \ + gpg-error-config-test.sh \ $(lock_obj_pub) BUILT_SOURCES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ @@ -114,7 +115,11 @@ CLEANFILES = err-sources.h err-codes.h code-to-errno.h code-from-errno.h \ gpg-error.h gpgrt.h gpgrt-config \ mkerrcodes$(EXEEXT_FOR_BUILD) mkerrcodes.h gpg-error.def mkw32errmap.tab.h \ mkw32errmap.map.c err-sources-sym.h err-codes-sym.h errnos-sym.h \ - gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) $(tmp_files) lock-obj-pub.native.h + gpg-extra/errno.h mkheader$(EXEEXT_FOR_BUILD) \ + gpg-error-config-test.log \ + $(tmp_files) lock-obj-pub.native.h + +TESTS = gpg-error-config-test.sh # # {{{ Begin Windows part @@ -331,10 +336,11 @@ gpgrt-config: gpg-error-config cp gpg-error-config gpgrt-config gpg-error-config: gpg-error-config-new gpg-error-config-old - if $(srcdir)/gpg-error-config-test.sh; then \ + @echo "Confirm gpg-error-config works" + @if $(srcdir)/gpg-error-config-test.sh --old-new; then \ cp gpg-error-config-new $@; \ else \ - echo "New gpg-error-config doesn't work on this machine, please report to " \ + echo "*** New gpg-error-config doesn't work on this machine, please report to "; \ cp gpg-error-config-old $@; \ fi diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh index 9d8c2ce..a9a6b8d 100755 --- a/src/gpg-error-config-test.sh +++ b/src/gpg-error-config-test.sh @@ -4,32 +4,71 @@ PKG_CONFIG_PATH="." export PKG_CONFIG_PATH -OUTPUT_OLD=$(./gpg-error-config-old --version) -OUTPUT_NEW=$(./gpg-error-config-new --version) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 +if [ "$1" = --old-new ]; then + PKG_CONFIG_CMD=./gpg-error-config-old +else + PKG_CONFIG_CMD="pkg-config gpg-error" + if ! $PKG_CONFIG_CMD --exists >/dev/null; then + exit 77 # Skip tests + fi +fi -OUTPUT_OLD=$(./gpg-error-config-old --libs) +test_failed="" + +failure () { + ( + echo "Test result: $*" + echo "====================: $PKG_CONFIG_CMD" + echo "$OUTPUT_OLD" + echo "====================: gpg-error-config-new" + echo "$OUTPUT_NEW" + echo "====================" + ) >> gpg-error-config-test.log + test_failed=yes +} + +rm -f gpg-error-config-test.log + +OUTPUT_OLD=$($PKG_CONFIG_CMD --libs) OUTPUT_NEW=$(./gpg-error-config-new --libs) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --libs -OUTPUT_OLD=$(./gpg-error-config-old --cflags) +OUTPUT_OLD=$($PKG_CONFIG_CMD --cflags) OUTPUT_NEW=$(./gpg-error-config-new --cflags) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags -OUTPUT_OLD=$(./gpg-error-config-old --mt --libs) -OUTPUT_NEW=$(./gpg-error-config-new --mt --libs) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 +OUTPUT_OLD=$($PKG_CONFIG_CMD --cflags --libs) +OUTPUT_NEW=$(./gpg-error-config-new --cflags --libs) +[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags --libs -OUTPUT_OLD=$(./gpg-error-config-old --mt --cflags) -OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 +if [ "$PKG_CONFIG_CMD" = ./gpg-error-config-old ]; then + OUTPUT_OLD=$($PKG_CONFIG_CMD --version) + OUTPUT_NEW=$(./gpg-error-config-new --version) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --version -OUTPUT_OLD=$(./gpg-error-config-old --cflags --libs) -OUTPUT_NEW=$(./gpg-error-config-new --cflags --libs) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + OUTPUT_OLD=$($PKG_CONFIG_CMD --mt --libs) + OUTPUT_NEW=$(./gpg-error-config-new --mt --libs) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --libs + + OUTPUT_OLD=$($PKG_CONFIG_CMD --mt --cflags) + OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags + + OUTPUT_OLD=$($PKG_CONFIG_CMD --cflags --libs) + OUTPUT_NEW=$(./gpg-error-config-new --cflags --libs) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --cflags --libs + + OUTPUT_OLD=$($PKG_CONFIG_CMD --mt --cflags --libs) + OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags --libs +fi + +if [ -n "$test_failed" ]; then + OUTPUT_OLD=$($PKG_CONFIG_CMD --version) + OUTPUT_NEW=$(./gpg-error-config-new --version) + failure --version -OUTPUT_OLD=$(./gpg-error-config-old --mt --cflags --libs) -OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs) -[ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || exit 99 + exit 99 +fi exit 0 ----------------------------------------------------------------------- Summary of changes: configure.ac | 28 +++++++++++++++- src/Makefile.am | 20 ++++++++---- src/gpg-error-config-test.sh | 77 +++++++++++++++++++++++++++++++++----------- 3 files changed, 99 insertions(+), 26 deletions(-) hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Tue Sep 4 04:00:22 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Tue, 04 Sep 2018 04:00:22 +0200 Subject: [git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-28-gf77c968 Message-ID: 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 f77c9687187419ee8e5bb7b3a2981199ca6a1332 (commit) via aa697dae4c363b3d24ec9be3a0cd41df3bf806ce (commit) from 1b025ca89b58cb630530084c49e40166e4a8e089 (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 f77c9687187419ee8e5bb7b3a2981199ca6a1332 Merge: 1b025ca aa697da Author: NIIBE Yutaka Date: Tue Sep 4 10:57:43 2018 +0900 Merge branch 'master' into gniibe/pkg-config-support commit aa697dae4c363b3d24ec9be3a0cd41df3bf806ce Author: NIIBE Yutaka Date: Tue Sep 4 10:45:49 2018 +0900 gpg-error-config: Determine output at configure time. * src/gpg-error-config.in (isubdirafter): Remove. Also for --cflags and --libs. * configure.ac (GPG_ERROR_CONFIG_ISUBDIRAFTER): Remove. (GPG_ERROR_CONFIG_CFLAGS): Add -idirafter gpg-extra for W32CE. (GPG_ERROR_CONFIG_CFLAGS): Decide here if adding -I$includedir. (GPG_ERROR_CONFIG_LIBS): Decide here if adding -L$libdir. -- Don't do string substitution at the time of its command invocation, but let it determine at configure time. diff --git a/configure.ac b/configure.ac index b5c01ba..089cb7e 100644 --- a/configure.ac +++ b/configure.ac @@ -483,19 +483,55 @@ if test "x$LIBMULTITHREAD" != x; then else GPG_ERROR_CONFIG_MT_LIBS="" fi -GPG_ERROR_CONFIG_CFLAGS="" +if test "$have_w32ce_system" = yes; then + GPG_ERROR_CONFIG_CFLAGS="-idirafter \${includedir}/gpg-extra" +else + GPG_ERROR_CONFIG_CFLAGS="" +fi if test "x$THREADLIB_CPPFLAGS" != x; then GPG_ERROR_CONFIG_MT_CFLAGS="${THREADLIB_CPPFLAGS}" else GPG_ERROR_CONFIG_MT_CFLAGS="" fi -GPG_ERROR_CONFIG_ISUBDIRAFTER="" GPG_ERROR_CONFIG_HOST="$host" + +case "$includedir" in + /usr/include|/include) ;; + '${prefix}/include') + if test "$prefix" != / -a "$prefix" != /usr; then + if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then + GPG_ERROR_CONFIG_CFLAGS="-I$includedir" + else + GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" + fi + fi + ;; + *) + if test -z "$GPG_ERROR_CONFIG_CFLAGS"; then + GPG_ERROR_CONFIG_CFLAGS="-I$includedir" + else + GPG_ERROR_CONFIG_CFLAGS="-I$includedir $GPG_ERROR_CONFIG_CFLAGS" + fi + ;; +esac +case "$libdir" in + /usr/lib|/usr/lib64|/lib|/lib64) ;; + '${exec_prefix}/lib') + if test "$exec_prefix" = "NONE"; then + if test "$prefix" != / -a "$prefix" != /usr; then + GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" + fi + elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then + GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" + fi + ;; + *) GPG_ERROR_CONFIG_LIBS="-L$libdir $GPG_ERROR_CONFIG_LIBS" ;; +esac + AC_SUBST(GPG_ERROR_CONFIG_LIBS) AC_SUBST(GPG_ERROR_CONFIG_CFLAGS) AC_SUBST(GPG_ERROR_CONFIG_MT_LIBS) AC_SUBST(GPG_ERROR_CONFIG_MT_CFLAGS) -AC_SUBST(GPG_ERROR_CONFIG_ISUBDIRAFTER) AC_SUBST(GPG_ERROR_CONFIG_HOST) @@ -510,7 +546,6 @@ if test "$have_w32_system" = yes; then fi if test "$have_w32ce_system" = yes; then AC_DEFINE(HAVE_W32CE_SYSTEM,1,[Defined if we run on WindowsCE]) - GPG_ERROR_CONFIG_ISUBDIRAFTER="gpg-extra" fi force_use_syscfg=yes fi diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index aa7cb67..93f25f7 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -14,7 +14,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ libdir=@libdir@ -isubdirafter="@GPG_ERROR_CONFIG_ISUBDIRAFTER@" if echo "$0" | grep gpg-error-config 2>/dev/null >/dev/null; then myname="gpg-error-config" @@ -69,26 +68,12 @@ while test $# -gt 0; do exit 0 ;; --cflags) - if test "x$includedir" != "x/usr/include" -a "x$includedir" != "x/include"; then - output="$output -I$includedir" - fi - # Note: -idirafter is a gcc extension. It is only used on - # systems where gcc is the only compiler we support (WindowsCE). - for i in $isubdirafter; do - output="$output -idirafter ${includedir}/${i}" - done output="$output @GPG_ERROR_CONFIG_CFLAGS@" if test $mt = yes ; then output="$output @GPG_ERROR_CONFIG_MT_CFLAGS@" fi ;; --libs) - case "$libdir" in - /usr/lib|/usr/lib64|/lib|/lib64) ;; - *) - output="$output -L$libdir" - ;; - esac output="$output @GPG_ERROR_CONFIG_LIBS@" if test $mt = yes ; then output="$output @GPG_ERROR_CONFIG_MT_LIBS@" ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 5 04:46:40 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Wed, 05 Sep 2018 04:46:40 +0200 Subject: [git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-29-gfa2855d Message-ID: 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 fa2855d9470ed4f367ca90cd46c27050359cfb62 (commit) from f77c9687187419ee8e5bb7b3a2981199ca6a1332 (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 fa2855d9470ed4f367ca90cd46c27050359cfb62 Author: NIIBE Yutaka Date: Wed Sep 5 11:45:45 2018 +0900 Forward compatibility support by gpg-error-config-old (--variable=*). diff --git a/src/Makefile.am b/src/Makefile.am index d631ee2..180f269 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -336,7 +336,7 @@ gpgrt-config: gpg-error-config cp gpg-error-config gpgrt-config gpg-error-config: gpg-error-config-new gpg-error-config-old - @echo "Confirm gpg-error-config works... " + @echo -n "Confirm gpg-error-config works... " @if $(srcdir)/gpg-error-config-test.sh --old-new; then \ echo "good"; \ cp gpg-error-config-new $@; \ diff --git a/src/gpg-error-config-test.sh b/src/gpg-error-config-test.sh index a9a6b8d..7f97ead 100755 --- a/src/gpg-error-config-test.sh +++ b/src/gpg-error-config-test.sh @@ -61,6 +61,18 @@ if [ "$PKG_CONFIG_CMD" = ./gpg-error-config-old ]; then OUTPUT_OLD=$($PKG_CONFIG_CMD --mt --cflags --libs) OUTPUT_NEW=$(./gpg-error-config-new --mt --cflags --libs) [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --mt --cflags --libs + + OUTPUT_OLD=$($PKG_CONFIG_CMD --variable=mtcflags) + OUTPUT_NEW=$(./gpg-error-config-new --variable=mtcflags) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtcflags + + OUTPUT_OLD=$($PKG_CONFIG_CMD --variable=mtlibs) + OUTPUT_NEW=$(./gpg-error-config-new --variable=mtlibs) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=mtlibs + + OUTPUT_OLD=$($PKG_CONFIG_CMD --variable=host) + OUTPUT_NEW=$(./gpg-error-config-new --variable=host) + [ "$OUTPUT_OLD" = "$OUTPUT_NEW" ] || failure --variable=host fi if [ -n "$test_failed" ]; then diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index 93f25f7..e050632 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -67,6 +67,16 @@ while test $# -gt 0; do echo "@PACKAGE_VERSION@" exit 0 ;; + --variable=*) + case "${1#*=}" in + prefix) echo "$prefix" ;; + exec_prefix) echo "$exec_prefix" ;; + host) echo "@GPG_ERROR_CONFIG_HOST@" ;; + mtcflags) echo "@GPG_ERROR_CONFIG_MT_CFLAGS@" ;; + mtlibs) echo "@GPG_ERROR_CONFIG_MT_LIBS@";; + esac + exit 0 + ;; --cflags) output="$output @GPG_ERROR_CONFIG_CFLAGS@" if test $mt = yes ; then ----------------------------------------------------------------------- Summary of changes: src/Makefile.am | 2 +- src/gpg-error-config-test.sh | 12 ++++++++++++ src/gpg-error-config.in | 10 ++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 5 04:57:40 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Wed, 05 Sep 2018 04:57:40 +0200 Subject: [git] GPG-ERROR - branch, master, updated. libgpg-error-1.32-4-g61d78fd Message-ID: 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, master has been updated via 61d78fdc25e5ff9289697c141457d8d322232250 (commit) via aa697dae4c363b3d24ec9be3a0cd41df3bf806ce (commit) from 19f9902b004cb980de4da908fa571103bfe2b630 (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 61d78fdc25e5ff9289697c141457d8d322232250 Author: NIIBE Yutaka Date: Wed Sep 5 11:55:55 2018 +0900 gpg-error-config: Forward compatibility support. * src/gpg-error-config.in: Support --variable=* option. Signed-off-by: NIIBE Yutaka diff --git a/src/gpg-error-config.in b/src/gpg-error-config.in index 93f25f7..e050632 100644 --- a/src/gpg-error-config.in +++ b/src/gpg-error-config.in @@ -67,6 +67,16 @@ while test $# -gt 0; do echo "@PACKAGE_VERSION@" exit 0 ;; + --variable=*) + case "${1#*=}" in + prefix) echo "$prefix" ;; + exec_prefix) echo "$exec_prefix" ;; + host) echo "@GPG_ERROR_CONFIG_HOST@" ;; + mtcflags) echo "@GPG_ERROR_CONFIG_MT_CFLAGS@" ;; + mtlibs) echo "@GPG_ERROR_CONFIG_MT_LIBS@";; + esac + exit 0 + ;; --cflags) output="$output @GPG_ERROR_CONFIG_CFLAGS@" if test $mt = yes ; then ----------------------------------------------------------------------- Summary of changes: configure.ac | 43 +++++++++++++++++++++++++++++++++++++++---- src/gpg-error-config.in | 25 ++++++++++--------------- 2 files changed, 49 insertions(+), 19 deletions(-) hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 5 05:00:25 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Wed, 05 Sep 2018 05:00:25 +0200 Subject: [git] GPG-ERROR - branch, gniibe/pkg-config-support, updated. libgpg-error-1.32-31-g85dcab5 Message-ID: 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 85dcab57cc43bfffd89364f6ad5f402dbd4fba28 (commit) via 61d78fdc25e5ff9289697c141457d8d322232250 (commit) from fa2855d9470ed4f367ca90cd46c27050359cfb62 (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 85dcab57cc43bfffd89364f6ad5f402dbd4fba28 Merge: fa2855d 61d78fd Author: NIIBE Yutaka Date: Wed Sep 5 11:59:51 2018 +0900 Merge branch 'master' into gniibe/pkg-config-support ----------------------------------------------------------------------- Summary of changes: hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 5 05:16:16 2018 From: cvs at cvs.gnupg.org (by NIIBE Yutaka) Date: Wed, 05 Sep 2018 05:16:16 +0200 Subject: [git] GPG-ERROR - branch, master, updated. libgpg-error-1.32-5-gcb0113f Message-ID: 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, master has been updated via cb0113f4690ed130c55ef4c6d8699ebc051e957e (commit) from 61d78fdc25e5ff9289697c141457d8d322232250 (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 cb0113f4690ed130c55ef4c6d8699ebc051e957e Author: NIIBE Yutaka Date: Wed Sep 5 12:15:17 2018 +0900 po: Update Japanese Translation. diff --git a/po/ja.po b/po/ja.po index 08cce86..8bdbc3e 100644 --- a/po/ja.po +++ b/po/ja.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: libgpg-error 1.27\n" "Report-Msgid-Bugs-To: translations at gnupg.org\n" -"PO-Revision-Date: 2018-03-21 19:02+0100\n" +"PO-Revision-Date: 2018-09-05 12:14+0900\n" "Last-Translator: NIIBE Yutaka \n" "Language-Team: none\n" "Language: ja\n" @@ -1351,7 +1351,7 @@ msgid "invalid option \"%.50s\"\n" msgstr "???????? \"%.50s\"\n" msgid "Please report bugs to .\n" -msgstr "" +msgstr "?????????????" #, c-format msgid "warning: could not recognize %s\n" ----------------------------------------------------------------------- Summary of changes: po/ja.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) hooks/post-receive -- Error codes used by GnuPG et al. http://git.gnupg.org From cvs at cvs.gnupg.org Wed Sep 5 16:33:48 2018 From: cvs at cvs.gnupg.org (by Andre Heinecke) Date: Wed, 05 Sep 2018 16:33:48 +0200 Subject: [git] GpgOL - branch, master, updated. gpgol-2.3.0-9-g4384758 Message-ID: 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 "GnuPG extension for MS Outlook". The branch, master has been updated via 4384758e839e816033c07e78bbec1842af076793 (commit) via 062279e5e69ef00d61aac6fddc9fb9ccf1201d9d (commit) via 7ebcc2dc0925864d352935ebe642a8b675cca018 (commit) via abe308f5ce366fc0f9e2e5545676728ac7818085 (commit) via 3b770f928eb17fd876a00e85e7b384d566de2175 (commit) via a507d8bdfb9e31814abf21ad5a9915abd66c96c1 (commit) via 164d89131534bf28ceb0f554bf50d1672445d33f (commit) from 7b5d671c020b32f3d147bcac3585448ea2e65bb0 (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 4384758e839e816033c07e78bbec1842af076793 Author: Andre Heinecke Date: Wed Sep 5 16:24:54 2018 +0200 Add Address Book integration * src/Makefile.am: Add new files. * src/addressbook.cpp, src/addressbook.h: New. Code for Address Book handling. * src/gpgoladdin.cpp (GpgolRibbonExtender::GetIDsOfNames), (GpgolRibbonExtender::Invoke), (GetCustomUI_MIME): Add Button to configure PGP Key. * src/mail.cpp (m_locate_in_progress): Make static locate_in_progress a proper member. (Mail::locateKeys_o): Trigger address book check. (Mail::locateAllCryptoRecipients_o): Don't abort if autoresolve is false. * src/mail.h: Update accordingly. * src/mailitem-events.cpp (PropertyChange): Trigger locate even if autoresolve is off. * src/ribbon-callbacks.cpp (open_contact_key): New. * src/ribbon-callbacks.h: Add id and protoype. * src/windowmessages.cpp (gpgol_window_proc): Handle config key done. * src/windowmessages.h (CONFIG_KEY_DONE): New. -- We do the now usual dance with an external process and windowmessage callback to configure a PGP Key in the Address book. This key or keys override any other key and will be used regardless of validity or user ids. This should allow a power user or administrator to centrally manage keys in a shared address book and enable such use cases as delegateing one mail address to a different key. GnuPG-Bug-Id: T4122 diff --git a/src/Makefile.am b/src/Makefile.am index 7906794..9abce23 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -28,6 +28,7 @@ AM_CXXFLAGS += $(GPGMEPP_CXXFLAGS) -D_FILE_OFFSET_BITS=64 gpgol_SOURCES = \ addin-options.cpp addin-options.h \ + addressbook.cpp addressbook.h \ application-events.cpp \ attachment.h attachment.cpp \ common.h common.cpp \ diff --git a/src/addressbook.cpp b/src/addressbook.cpp new file mode 100644 index 0000000..a61c192 --- /dev/null +++ b/src/addressbook.cpp @@ -0,0 +1,300 @@ +/* addressbook.cpp - Functions for the Addressbook + * Copyright (C) 2018 Intevation GmbH + * + * This file is part of GpgOL. + * + * GpgOL is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GpgOL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, see . + */ + +#include "addressbook.h" + +#include "oomhelp.h" +#include "keycache.h" +#include "mail.h" +#include "cpphelp.h" +#include "windowmessages.h" + +#include +#include + +#include + +typedef struct +{ + std::string name; + std::string data; + HWND hwnd; + shared_disp_t contact; +} keyadder_args_t; + +static DWORD WINAPI +open_keyadder (LPVOID arg) +{ + auto adder_args = std::unique_ptr ((keyadder_args_t*) arg); + + std::vector args; + + // Collect the arguments + char *gpg4win_dir = get_gpg4win_dir (); + if (!gpg4win_dir) + { + TRACEPOINT; + return -1; + } + const auto keyadder = std::string (gpg4win_dir) + "\\bin\\gpgolkeyadder.exe"; + args.push_back (keyadder); + + args.push_back (std::string ("--hwnd")); + args.push_back (std::to_string ((int) (intptr_t) adder_args->hwnd)); + + args.push_back (std::string ("--username")); + args.push_back (adder_args->name); + + auto ctx = GpgME::Context::createForEngine (GpgME::SpawnEngine); + if (!ctx) + { + // can't happen + TRACEPOINT; + return -1; + } + + GpgME::Data mystdin (adder_args->data.c_str(), adder_args->data.size(), + false); + GpgME::Data mystdout, mystderr; + + char **cargs = vector_to_cArray (args); + log_debug ("%s:%s: launching keyadder args:", SRCNAME, __func__); + for (size_t i = 0; cargs && cargs[i]; i++) + { + log_debug (SIZE_T_FORMAT ": '%s'", i, cargs[i]); + } + + GpgME::Error err = ctx->spawn (cargs[0], const_cast (cargs), + mystdin, mystdout, mystderr, + (GpgME::Context::SpawnFlags) ( + GpgME::Context::SpawnAllowSetFg | + GpgME::Context::SpawnShowWindow)); + release_cArray (cargs); + if (err) + { + log_error ("%s:%s: Err code: %i asString: %s", + SRCNAME, __func__, err.code(), err.asString()); + return 0; + } + + auto newKey = mystdout.toString (); + + rtrim(newKey); + + if (newKey.empty()) + { + log_debug ("%s:%s: keyadder canceled.", SRCNAME, __func__); + return 0; + } + if (newKey == "empty") + { + log_debug ("%s:%s: keyadder empty.", SRCNAME, __func__); + newKey = ""; + } + + Addressbook::callback_args_t cb_args; + + /* cb args are valid in the same scope as newKey */ + cb_args.data = newKey.c_str(); + cb_args.contact = adder_args->contact; + + do_in_ui_thread (CONFIG_KEY_DONE, (void*) &cb_args); + return 0; +} + +void +Addressbook::update_key_o (void *callback_args) +{ + if (!callback_args) + { + TRACEPOINT; + return; + } + callback_args_t *cb_args = static_cast (callback_args); + LPDISPATCH contact = cb_args->contact.get(); + + LPDISPATCH user_props = get_oom_object (contact, "UserProperties"); + if (!user_props) + { + TRACEPOINT; + return; + } + + LPDISPATCH pgp_key = find_or_add_text_prop (user_props, "OpenPGP Key"); + if (!pgp_key) + { + TRACEPOINT; + return; + } + put_oom_string (pgp_key, "Value", cb_args->data); + + log_debug ("%s:%s: PGP key data updated", + SRCNAME, __func__); + + gpgol_release (pgp_key); + return; +} + +void +Addressbook::edit_key_o (LPDISPATCH contact) +{ + if (!contact) + { + TRACEPOINT; + return; + } + + LPDISPATCH user_props = get_oom_object (contact, "UserProperties"); + if (!user_props) + { + TRACEPOINT; + return; + } + + auto pgp_key = MAKE_SHARED ( + find_or_add_text_prop (user_props, "OpenPGP Key")); + gpgol_release (user_props); + + if (!pgp_key) + { + TRACEPOINT; + return; + } + + char *key_data = get_oom_string (pgp_key.get(), "Value"); + if (!key_data) + { + TRACEPOINT; + return; + } + + char *name = get_oom_string (contact, "Subject"); + if (!name) + { + TRACEPOINT; + name = get_oom_string (contact, "Email1Address"); + if (!name) + { + name = xstrdup (/* TRANSLATORS: Placeholder for a contact without + a configured name */ _("Unknown contact")); + } + } + + keyadder_args_t *args = new keyadder_args_t; + args->name = name; + args->data = key_data; + args->hwnd = get_active_hwnd (); + contact->AddRef (); + memdbg_addRef (contact); + args->contact = MAKE_SHARED (contact); + + CloseHandle (CreateThread (NULL, 0, open_keyadder, (LPVOID) args, 0, + NULL)); + xfree (name); + xfree (key_data); + + return; +} + +static std::set s_checked_entries; +/* For each new recipient check the address book to look for a potentially + configured key for this recipient and import / register + it into the keycache. +*/ +void +Addressbook::check_o (Mail *mail) +{ + if (!mail) + { + TRACEPOINT; + return; + } + LPDISPATCH mailitem = mail->item (); + if (!mailitem) + { + TRACEPOINT; + return; + } + auto recipients_obj = MAKE_SHARED (get_oom_object (mailitem, "Recipients")); + + if (!recipients_obj) + { + TRACEPOINT; + return; + } + + bool err = false; + const auto recipient_entries = get_oom_recipients_with_addrEntry (recipients_obj.get(), + &err); + for (const auto pair: recipient_entries) + { + if (s_checked_entries.find (pair.first) != s_checked_entries.end ()) + { + continue; + } + s_checked_entries.insert (pair.first); + + if (!pair.second) + { + TRACEPOINT; + continue; + } + + auto contact = MAKE_SHARED (get_oom_object (pair.second.get (), "GetContact")); + if (!contact) + { + log_debug ("%s:%s: failed to resolve contact for %s", + SRCNAME, __func__, + (opt.enable_debug & DBG_MIME_PARSER) ? + pair.first.c_str() : "omitted"); + continue; + } + + LPDISPATCH user_props = get_oom_object (contact.get (), "UserProperties"); + if (!user_props) + { + TRACEPOINT; + continue; + } + + LPDISPATCH pgp_key = find_or_add_text_prop (user_props, "OpenPGP Key"); + gpgol_release (user_props); + + if (!pgp_key) + { + continue; + } + + log_debug ("%s:%s: found configured pgp key for %s", + SRCNAME, __func__, + (opt.enable_debug & DBG_MIME_PARSER) ? + pair.first.c_str() : "omitted"); + + char *key_data = get_oom_string (pgp_key, "Value"); + if (!key_data || !strlen (key_data)) + { + log_debug ("%s:%s: No key data", + SRCNAME, __func__); + } + KeyCache::instance ()->importFromAddrBook (pair.first, key_data, + mail); + xfree (key_data); + gpgol_release (pgp_key); + } +} diff --git a/src/addressbook.h b/src/addressbook.h new file mode 100644 index 0000000..c175bb8 --- /dev/null +++ b/src/addressbook.h @@ -0,0 +1,48 @@ +#ifndef SRC_ADDRESSBOOK_H +#define SRC_ADDRESSBOOK_H +/* addressbook.h - Functions for the Addressbook + * Copyright (C) 2018 Intevation GmbH + * + * This file is part of GpgOL. + * + * GpgOL is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * GpgOL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, see . + */ + +#include "common.h" +#include +#include +#include +#include "oomhelp.h" + +class Mail; + +namespace Addressbook +{ +typedef struct +{ + shared_disp_t contact; + const char *data; +} callback_args_t; + +/* Configure the OpenPGP Key for this contact. */ +void edit_key_o (LPDISPATCH contact); + +/* Check the address book for keys to import. */ +void check_o (Mail *mail); + +/* Update the key information for a contact. */ +void update_key_o (void *callback_args); +} // namespace Addressbook + +#endif // SRC_ADDRESSBOOK_H diff --git a/src/gpgoladdin.cpp b/src/gpgoladdin.cpp index e331b86..6ab5919 100644 --- a/src/gpgoladdin.cpp +++ b/src/gpgoladdin.cpp @@ -714,6 +714,7 @@ GpgolRibbonExtender::GetIDsOfNames (REFIID riid, LPOLESTR *rgszNames, ID_MAPPER (L"getIsDetailsEnabled", ID_GET_IS_DETAILS_ENABLED) ID_MAPPER (L"getIsCrypto", ID_GET_IS_CRYPTO_MAIL) ID_MAPPER (L"printDecrypted", ID_CMD_PRINT_DECRYPTED) + ID_MAPPER (L"openContactKey", ID_CMD_OPEN_CONTACT_KEY) } if (cNames > 1) @@ -803,6 +804,8 @@ GpgolRibbonExtender::Invoke (DISPID dispid, REFIID riid, LCID lcid, return print_decrypted (parms->rgvarg[0].pdispVal); case ID_GET_IS_CRYPTO_MAIL: return get_is_crypto_mail (parms->rgvarg[0].pdispVal, result); + case ID_CMD_OPEN_CONTACT_KEY: + return open_contact_key (parms->rgvarg[0].pdispVal); case ID_BTN_ENCRYPT: case ID_BTN_DECRYPT: case ID_BTN_DECRYPT_LARGE: @@ -1069,6 +1072,43 @@ GetCustomUI_MIME (BSTR RibbonID, BSTR * RibbonXml) optsSTip ); } + else if (!wcscmp (RibbonID, L"Microsoft.Outlook.Contact")) + { + gpgrt_asprintf (&buffer, + "" + " " + " " + " " + " " + "