Projects
openEuler:Mainline
gpgme
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 8
View file
_service:tar_scm:gpgme.spec
Changed
@@ -1,6 +1,6 @@ Name: gpgme -Version: 1.17.0 -Release: 3 +Version: 1.21.0 +Release: 1 Summary: GnuPG Made Easy License: GPLv2+ and LGPLv2+ URL: https://gnupg.org/related_software/gpgme/ @@ -13,14 +13,13 @@ Patch1: gpgme-1.3.2-largefile.patch # Let's fix stupid AX_PYTHON_DEVEL Patch2: 0001-fix-stupid-ax_python_devel.patch -# support python3.10 -Patch3: gpgme-Add-support-for-building-with-Python3.10.patch +Patch3: backport-0002-setup_py_extra_opts.patch BuildRequires: autoconf automake gcc gcc-c++ gawk gnupg2 >= 2.2.24 BuildRequires: libgpg-error-devel >= 1.36 libassuan-devel >= 2.4.2 BuildRequires: swig chrpath cmake qt5-qtbase-devel python3-devel Requires: gnupg2 >= 2.2.24 -Provides: %{name}%{?_isa} <= %{version}-%{release} +Provides: %{name}%{?_isa} = %{version}-%{release} %description @@ -34,10 +33,10 @@ Summary: C++ API wrapper for GPGME Requires: %{name} = %{version}-%{release} Obsoletes: gpgme-pp < 1.8.0-7 -Obsoletes: %{name}pp +Obsoletes: %{name}pp < %{version}-%{release} Provides: gpgme-pp = %{version}-%{release} Provides: gpgme-pp%{?_isa} = %{version}-%{release} -Provides: %{name}pp%{?_isa} <= %{version}-%{release} +Provides: %{name}pp%{?_isa} = %{version}-%{release} %description -n cpp-%{name} %{summary}. @@ -45,8 +44,8 @@ %package -n qt-%{name} Summary: Qt API wrapper for GPGME Requires: cpp-%{name} = %{version}-%{release} -Obsoletes: q%{name} -Provides: q%{name} +Obsoletes: q%{name} < %{version}-%{release} +Provides: q%{name} = %{version}-%{release} %description -n qt-%{name} %{summary}. @@ -56,8 +55,8 @@ %{?python_provide:%python_provide python3-gpg} Requires: %{name} = %{version}-%{release} Obsoletes: platform-python-gpg < %{version}-%{release} -Obsoletes: python3-gpg -Provides: python3-gpg +Obsoletes: python3-gpg < %{version}-%{release} +Provides: python3-gpg = %{version}-%{release} %description -n python3-%{name} %{summary}. @@ -65,10 +64,10 @@ %package devel Summary: Development headers and libraries for %{name} Requires: %{name} = %{version}-%{release} libgpg-error-devel >= 1.36 info -Obsoletes: gpgme-pp-devel < 1.8.0-7 %{name}pp-devel q%{name}-devel -Provides: gpgme-pp-devel = %{version}-%{release} %{name}pp-devel q%{name}-devel -Obsoletes: %{name}pp-devel q%{name}-devel -provides: %{name}pp-devel q%{name}-devel +Obsoletes: gpgme-pp-devel < 1.8.0-7 +Provides: gpgme-pp-devel = %{version}-%{release} +Obsoletes: %{name}pp-devel < %{version}-%{release} q%{name}-devel < %{version}-%{release} +Provides: %{name}pp-devel = %{version}-%{release} q%{name}-devel = %{version}-%{release} %description devel %{summary}. @@ -84,17 +83,13 @@ %autosetup -n %{name}-%{version} -p1 %build -# Generate the same python dir as in the %%install -export SETUPTOOLS_USE_DISTUTILS=stdlib %configure --disable-static --disable-silent-rules --enable-languages=cpp,qt,python %make_build %install -# python-setuptools >= v60.0.0 changes the SETUPTOOLS_USE_DISTUTILS default value to local, -# it does't use Python's standard library distutils default. -# As a result, failed to build gpgme. -# Now, set SETUPTOOLS_USE_DISTUTILS value to stdlib -export SETUPTOOLS_USE_DISTUTILS=stdlib +# The SETUP_PY_EXTRA_OPTS used in the patch backport-0002-setup_py_extra_opts.patch +# This forces setuptools to use .egg-info format +export SETUP_PY_EXTRA_OPTS="--single-version-externally-managed --root=/" %make_install chrpath -d $(find %{buildroot} -name gpgme-json) @@ -108,8 +103,6 @@ chrpath -d %{buildroot}%{_libdir}/libq%{name}.so* %check -# Generate the same python dir as in the %%install -export SETUPTOOLS_USE_DISTUTILS=stdlib make check %ldconfig_scriptlets @@ -155,6 +148,12 @@ %changelog +* Mon Jul 17 2023 yixiangzhike <yixiangzhike007@163.com> - 1.21.0-1 +- Type:bugfix +- CVE:NA +- SUG:NA +- DESC:update to 1.21.0 + * Sat May 13 2023 yixiangzhike <yixiangzhike007@163.com> - 1.17.0-3 - Type:bugfix - CVE:NA
View file
_service:tar_scm:backport-0002-setup_py_extra_opts.patch
Added
@@ -0,0 +1,12 @@ +diff --git a/lang/python/Makefile.in b/lang/python/Makefile.in +index c0fc091..d567ecb 100644 +--- a/lang/python/Makefile.in ++++ b/lang/python/Makefile.in +@@ -802,6 +802,7 @@ install-exec-local: + --build-base="$$(basename "$${PYTHON}")-gpg" \ + install \ + --prefix "$(DESTDIR)$(prefix)" \ ++ $${SETUP_PY_EXTRA_OPTS:-} \ + --verbose ; \ + done +
View file
_service:tar_scm:gpgme-Add-support-for-building-with-Python3.10.patch
Deleted
@@ -1,687 +0,0 @@ -From 82e25a4a831699a08aeefc9f3cda4c6ebedbb26a Mon Sep 17 00:00:00 2001 -From: yixiangzhike <yixiangzhike007@163.com> -Date: Tue, 28 Dec 2021 15:48:33 +0800 -Subject: PATCH gpgme Add support for building with python3.10 - ---- - configure | 634 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - configure.ac | 2 +- - m4/python.m4 | 2 +- - 3 files changed, 636 insertions(+), 2 deletions(-) - -diff --git a/configure b/configure -index f307736..6cfa831 100755 ---- a/configure -+++ b/configure -@@ -23921,6 +23921,642 @@ $as_echo "$as_me: WARNING: - - if test -n "$PYTHON"; then - # If the user set $PYTHON, use it and don't search something else. -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.10" >&5 -+$as_echo_n "checking whether $PYTHON version is >= 3.10... " >&6; } -+ prog="import sys -+# split strings by '.' and convert to numeric. Append some zeros -+# because we need at least 4 digits for the hex conversion. -+# map returns an iterator in Python 3.0 and a list in 2.x -+minver = list(map(int, '3.10'.split('.'))) + 0, 0, 0 -+minverhex = 0 -+# xrange is not present in Python 3.0 and range returns an iterator -+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri -+sys.exit(sys.hexversion < minverhex)" -+ if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 -+ ($PYTHON -c "$prog") >&5 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then : -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ as_fn_error $? "Python interpreter is too old" "$LINENO" 5 -+fi -+ am_display_PYTHON=$PYTHON -+ else -+ # Otherwise, try each interpreter until we find one that satisfies -+ # VERSION. -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.10" >&5 -+$as_echo_n "checking for a Python interpreter with version >= 3.10... " >&6; } -+if ${am_cv_pathless_PYTHON+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ -+ for am_cv_pathless_PYTHON in python3.10 none; do -+ test "$am_cv_pathless_PYTHON" = none && break -+ prog="import sys -+# split strings by '.' and convert to numeric. Append some zeros -+# because we need at least 4 digits for the hex conversion. -+# map returns an iterator in Python 3.0 and a list in 2.x -+minver = list(map(int, '3.10'.split('.'))) + 0, 0, 0 -+minverhex = 0 -+# xrange is not present in Python 3.0 and range returns an iterator -+for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri -+sys.exit(sys.hexversion < minverhex)" -+ if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 -+ ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 -+ ac_status=$? -+ echo "$as_me:$LINENO: \$? = $ac_status" >&5 -+ (exit $ac_status); }; then : -+ break -+fi -+ done -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 -+$as_echo "$am_cv_pathless_PYTHON" >&6; } -+ # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. -+ if test "$am_cv_pathless_PYTHON" = none; then -+ PYTHON=: -+ else -+ # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. -+set dummy $am_cv_pathless_PYTHON; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_path_PYTHON+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $PYTHON in -+ \\/* | ?:\\/*) -+ ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+PYTHON=$ac_cv_path_PYTHON -+if test -n "$PYTHON"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -+$as_echo "$PYTHON" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ fi -+ am_display_PYTHON=$am_cv_pathless_PYTHON -+ fi -+ -+ -+ if test "$PYTHON" = :; then -+ : -+ else -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 -+$as_echo_n "checking for $am_display_PYTHON version... " >&6; } -+if ${am_cv_python_version+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 -+$as_echo "$am_cv_python_version" >&6; } -+ PYTHON_VERSION=$am_cv_python_version -+ -+ -+ -+ PYTHON_PREFIX='${prefix}' -+ -+ PYTHON_EXEC_PREFIX='${exec_prefix}' -+ -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 -+$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } -+if ${am_cv_python_platform+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 -+$as_echo "$am_cv_python_platform" >&6; } -+ PYTHON_PLATFORM=$am_cv_python_platform -+ -+ -+ # Just factor out some code duplication. -+ am_python_setup_sysconfig="\ -+import sys -+# Prefer sysconfig over distutils.sysconfig, for better compatibility -+# with python 3.x. See automake bug#10227. -+try: -+ import sysconfig -+except ImportError: -+ can_use_sysconfig = 0 -+else: -+ can_use_sysconfig = 1 -+# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: -+# <https://github.com/pypa/virtualenv/issues/118> -+try: -+ from platform import python_implementation -+ if python_implementation() == 'CPython' and sys.version:3 == '2.7': -+ can_use_sysconfig = 0 -+except ImportError: -+ pass" -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -+$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } -+if ${am_cv_python_pythondir+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "x$prefix" = xNONE -+ then -+ am_py_prefix=$ac_default_prefix -+ else -+ am_py_prefix=$prefix -+ fi -+ am_cv_python_pythondir=`$PYTHON -c " -+$am_python_setup_sysconfig -+if can_use_sysconfig: -+ sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) -+else: -+ from distutils import sysconfig -+ sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') -+sys.stdout.write(sitedir)"` -+ case $am_cv_python_pythondir in -+ $am_py_prefix*) -+ am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` -+ am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` -+ ;; -+ *) -+ case $am_py_prefix in -+ /usr|/System*) ;; -+ *) -+ am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages -+ ;; -+ esac -+ ;; -+ esac -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 -+$as_echo "$am_cv_python_pythondir" >&6; } -+ pythondir=$am_cv_python_pythondir -+ -+ -+ -+ pkgpythondir=\${pythondir}/$PACKAGE -+ -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -+$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } -+if ${am_cv_python_pyexecdir+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ if test "x$exec_prefix" = xNONE -+ then -+ am_py_exec_prefix=$am_py_prefix -+ else -+ am_py_exec_prefix=$exec_prefix -+ fi -+ am_cv_python_pyexecdir=`$PYTHON -c " -+$am_python_setup_sysconfig -+if can_use_sysconfig: -+ sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) -+else: -+ from distutils import sysconfig -+ sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') -+sys.stdout.write(sitedir)"` -+ case $am_cv_python_pyexecdir in -+ $am_py_exec_prefix*) -+ am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` -+ am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` -+ ;; -+ *) -+ case $am_py_exec_prefix in -+ /usr|/System*) ;; -+ *) -+ am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages -+ ;; -+ esac -+ ;; -+ esac -+ -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 -+$as_echo "$am_cv_python_pyexecdir" >&6; } -+ pyexecdir=$am_cv_python_pyexecdir -+ -+ -+ -+ pkgpyexecdir=\${pyexecdir}/$PACKAGE -+ -+ -+ -+ -+ # -+ # Allow the use of a (user set) custom python version -+ # -+ -+ -+ # Extract the first word of "python$PYTHON_VERSION", so it can be a program name with args. -+set dummy python$PYTHON_VERSION; ac_word=$2 -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -+$as_echo_n "checking for $ac_word... " >&6; } -+if ${ac_cv_path_PYTHON+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ case $PYTHON in -+ \\/* | ?:\\/*) -+ ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. -+ ;; -+ *) -+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -+for as_dir in $PATH -+do -+ IFS=$as_save_IFS -+ test -z "$as_dir" && as_dir=. -+ for ac_exec_ext in '' $ac_executable_extensions; do -+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then -+ ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" -+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 -+ break 2 -+ fi -+done -+ done -+IFS=$as_save_IFS -+ -+ ;; -+esac -+fi -+PYTHON=$ac_cv_path_PYTHON -+if test -n "$PYTHON"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 -+$as_echo "$PYTHON" >&6; } -+else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+fi -+ -+ -+ if test -z "$PYTHON"; then -+ as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5 -+ PYTHON_VERSION="" -+ fi -+ -+ # -+ # Check for a version of Python >= 2.1.0 -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5 -+$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; } -+ ac_supports_python_ver=`$PYTHON -c "import sys; \ -+ ver = sys.version.split ()0; \ -+ print (ver >= '2.1.0')"` -+ if test "$ac_supports_python_ver" != "True"; then -+ if test -z "$PYTHON_NOVERSIONCHECK"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -+as_fn_error $? " -+This version of the AC_PYTHON_DEVEL macro -+doesn't work properly with versions of Python before -+2.1.0. You may need to re-run configure, setting the -+variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, -+PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. -+Moreover, to disable this check, set PYTHON_NOVERSIONCHECK -+to something else than an empty string. -+ -+See \`config.log' for more details" "$LINENO" 5; } -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5 -+$as_echo "skip at user request" >&6; } -+ fi -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ fi -+ -+ # -+ # if the macro parameter ``version'' is set, honour it -+ # -+ if test -n ""; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python " >&5 -+$as_echo_n "checking for a version of Python ... " >&6; } -+ ac_supports_python_ver=`$PYTHON -c "import sys; \ -+ ver = sys.version.split ()0; \ -+ print (ver )"` -+ if test "$ac_supports_python_ver" = "True"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ as_fn_error $? "this package requires Python . -+If you have it installed, but it isn't the default Python -+interpreter in your system path, please pass the PYTHON_VERSION -+variable to configure. See \`\`configure --help'' for reference. -+" "$LINENO" 5 -+ PYTHON_VERSION="" -+ fi -+ fi -+ -+ # -+ # Check if you have distutils, else fail -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 -+$as_echo_n "checking for the distutils Python package... " >&6; } -+ ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` -+ ac_distutils_return=$? -+ if test -z "$ac_distutils_result"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ else -+ if test $ac_distutils_return = 0; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -+$as_echo "yes" >&6; } -+ else -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -+$as_echo "no" >&6; } -+ as_fn_error $? "cannot import Python module \"distutils\". -+Please check your Python installation. The error was: -+$ac_distutils_result" "$LINENO" 5 -+ PYTHON_VERSION="" -+ fi -+ fi -+ -+ # -+ # Check for Python include path -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5 -+$as_echo_n "checking for Python include path... " >&6; } -+ if test -z "$PYTHON_CPPFLAGS"; then -+ python_path=`$PYTHON -c "import distutils.sysconfig; \ -+ print (distutils.sysconfig.get_python_inc ());"` -+ plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ -+ print (distutils.sysconfig.get_python_inc (plat_specific=1));"` -+ if test -n "${python_path}"; then -+ if test "${plat_python_path}" != "${python_path}"; then -+ python_path="-I$python_path -I$plat_python_path" -+ else -+ python_path="-I$python_path" -+ fi -+ fi -+ PYTHON_CPPFLAGS=$python_path -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5 -+$as_echo "$PYTHON_CPPFLAGS" >&6; } -+ -+ -+ # -+ # Check for Python library path -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5 -+$as_echo_n "checking for Python library path... " >&6; } -+ if test -z "$PYTHON_LDFLAGS"; then -+ # (makes two attempts to ensure we've got a version number -+ # from the interpreter) -+ ac_python_version=`cat<<EOD | $PYTHON - -+ -+# join all versioning strings, on some systems -+# major/minor numbers could be in different list elements -+from distutils.sysconfig import * -+e = get_config_var('VERSION') -+if e is not None: -+ print(e) -+EOD` -+ -+ if test -z "$ac_python_version"; then -+ if test -n "$PYTHON_VERSION"; then -+ ac_python_version=$PYTHON_VERSION -+ else -+ ac_python_version=`$PYTHON -c "import sys; \ -+ print (sys.version:3)"` -+ fi -+ fi -+ -+ # Make the versioning information available to the compiler -+ -+ # JW: We don't need it and it interferes with the hack -+ # to detect multiple Pyhton versions -+ #AC_DEFINE_UNQUOTED(HAVE_PYTHON, "$ac_python_version", -+ # If available, contains the Python version number currently in use.) -+ -+ # First, the library directory: -+ ac_python_libdir=`cat<<EOD | $PYTHON - -+ -+# There should be only one -+import distutils.sysconfig -+e = distutils.sysconfig.get_config_var('LIBDIR') -+if e is not None: -+ print (e) -+EOD` -+ -+ # Now, for the library: -+ ac_python_library=`cat<<EOD | $PYTHON - -+ -+import distutils.sysconfig -+c = distutils.sysconfig.get_config_vars() -+if 'LDVERSION' in c: -+ print ('python'+c'LDVERSION') -+else: -+ print ('python'+c'VERSION') -+EOD` -+ -+ # This small piece shamelessly adapted from PostgreSQL python macro; -+ # credits goes to momjian, I think. I'd like to put the right name -+ # in the credits, if someone can point me in the right direction... ? -+ # -+ if test -n "$ac_python_libdir" -a -n "$ac_python_library" -+ then -+ # use the official shared library -+ ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` -+ PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" -+ else -+ # old way: use libpython from python_configdir -+ ac_python_libdir=`$PYTHON -c \ -+ "from distutils.sysconfig import get_python_lib as f; \ -+ import os; \ -+ print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` -+ PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" -+ fi -+ -+ if test -z "PYTHON_LDFLAGS"; then -+ as_fn_error $? " -+ Cannot determine location of your Python DSO. Please check it was installed with -+ dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. -+ " "$LINENO" 5 -+ fi -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 -+$as_echo "$PYTHON_LDFLAGS" >&6; } -+ -+ -+ # -+ # Check for site packages -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5 -+$as_echo_n "checking for Python site-packages path... " >&6; } -+ if test -z "$PYTHON_SITE_PKG"; then -+ PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ -+ print (distutils.sysconfig.get_python_lib(0,0));"` -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5 -+$as_echo "$PYTHON_SITE_PKG" >&6; } -+ -+ -+ # -+ # libraries which must be linked in when embedding -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5 -+$as_echo_n "checking python extra libraries... " >&6; } -+ if test -z "$PYTHON_EXTRA_LIBS"; then -+ PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ -+ conf = distutils.sysconfig.get_config_var; \ -+ print (conf('LIBS') + ' ' + conf('SYSLIBS'))"` -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5 -+$as_echo "$PYTHON_EXTRA_LIBS" >&6; } -+ -+ -+ # -+ # linking flags needed when embedding -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5 -+$as_echo_n "checking python extra linking flags... " >&6; } -+ if test -z "$PYTHON_EXTRA_LDFLAGS"; then -+ PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ -+ conf = distutils.sysconfig.get_config_var; \ -+ print (conf('LINKFORSHARED'))"` -+ fi -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5 -+$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; } -+ -+ -+ # -+ # final check to see if everything compiles alright -+ # -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5 -+$as_echo_n "checking consistency of all components of python development environment... " >&6; } -+ # save current global flags -+ ac_save_LIBS="$LIBS" -+ ac_save_CPPFLAGS="$CPPFLAGS" -+ LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" -+ CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" -+ ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+ #include <Python.h> -+int -+main () -+{ -+Py_Initialize(); -+ ; -+ return 0; -+} -+ -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ pythonexists=yes -+else -+ pythonexists=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+ ac_ext=c -+ac_cpp='$CPP $CPPFLAGS' -+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -+ac_compiler_gnu=$ac_cv_c_compiler_gnu -+ -+ # turn back to default flags -+ CPPFLAGS="$ac_save_CPPFLAGS" -+ LIBS="$ac_save_LIBS" -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5 -+$as_echo "$pythonexists" >&6; } -+ -+ if test ! "x$pythonexists" = "xyes"; then -+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -+ Could not link test program to Python. Maybe the main Python library has been -+ installed in some non-standard library path. If so, pass it to configure, -+ via the LDFLAGS environment variable. -+ Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" -+ ============================================================================ -+ You probably have to install the development version of the Python package -+ for your distribution. The exact name of this package varies among them. -+ ============================================================================ -+ " >&5 -+$as_echo "$as_me: WARNING: -+ Could not link test program to Python. Maybe the main Python library has been -+ installed in some non-standard library path. If so, pass it to configure, -+ via the LDFLAGS environment variable. -+ Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" -+ ============================================================================ -+ You probably have to install the development version of the Python package -+ for your distribution. The exact name of this package varies among them. -+ ============================================================================ -+ " >&2;} -+ PYTHON_VERSION="" -+ fi -+ -+ # -+ # all done! -+ # -+ -+ if test "$PYTHON_VERSION"; then -+ PYTHONS="$(echo $PYTHONS $PYTHON)" -+ PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)" -+ fi -+ -+ fi -+ -+ -+ unset PYTHON -+ unset PYTHON_VERSION -+ unset PYTHON_CPPFLAGS -+ unset PYTHON_LDFLAGS -+ unset PYTHON_SITE_PKG -+ unset PYTHON_EXTRA_LIBS -+ unset PYTHON_EXTRA_LDFLAGS -+ unset ac_cv_path_PYTHON -+ unset am_cv_pathless_PYTHON -+ unset am_cv_python_version -+ unset am_cv_python_platform -+ unset am_cv_python_pythondir -+ unset am_cv_python_pyexecdir -+ -+ -+ -+ -+ -+ -+ if test -n "$PYTHON"; then -+ # If the user set $PYTHON, use it and don't search something else. - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= all" >&5 - $as_echo_n "checking whether $PYTHON version is >= all... " >&6; } - prog="import sys -diff --git a/configure.ac b/configure.ac -index 4d32366..ba1c374 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -425,7 +425,7 @@ if test "$found_py" = "1"; then - if test "$found_py" = "1" -o "$found_py3" = "1"; then - # Reset everything, so that we can look for another Python. - m4_foreach(mym4pythonver, -- 2.7,3.4,3.5,3.6,3.7,3.8,3.9,all, -+ 2.7,3.4,3.5,3.6,3.7,3.8,3.9,3.10,all, - unset PYTHON - unset PYTHON_VERSION - unset PYTHON_CPPFLAGS -diff --git a/m4/python.m4 b/m4/python.m4 -index fd0fe77..9ddca59 100644 ---- a/m4/python.m4 -+++ b/m4/python.m4 -@@ -42,7 +42,7 @@ AC_DEFUN(AM_PATH_PYTHON, - m4_define_default(_AM_PYTHON_INTERPRETER_LIST, - python2 python2.7 dnl - python dnl -- python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 -+ python3 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 - ) - - AC_ARG_VAR(PYTHON, the Python interpreter) --- -1.8.3.1 -
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmerefreshkeysjob.cpp
Deleted
@@ -1,230 +0,0 @@ -/* - qgpgmerefreshkeysjob.cpp - - This file is part of qgpgme, the Qt API binding for gpgme - Copyright (c) 2004 Klarävdalens Datakonsult AB - Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik - Software engineering by Intevation GmbH - - QGpgME is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - QGpgME 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - In addition, as a special exception, the copyright holders give - permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked - combinations including the two. You must obey the GNU General - Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to - your version of the file, but you are not obligated to do so. If - you do not wish to do so, delete this exception statement from - your version. -*/ - -#define MAX_CMD_LENGTH 32768 - -#ifdef HAVE_CONFIG_H - #include "config.h" -#endif - -#include "qgpgmerefreshkeysjob.h" - -#include <QDebug> -#include "qgpgme_debug.h" - -#include "context.h" - -#include <QByteArray> -#include <QStringList> - -#include <gpg-error.h> - -#include <assert.h> - -QGpgME::QGpgMERefreshKeysJob::QGpgMERefreshKeysJob() - : RefreshKeysJob(nullptr), - mProcess(nullptr), - mError(0) -{ - -} - -QGpgME::QGpgMERefreshKeysJob::~QGpgMERefreshKeysJob() -{ - -} - -GpgME::Error QGpgME::QGpgMERefreshKeysJob::start(const QStringList &patterns) -{ - assert(mPatternsToDo.empty()); - - mPatternsToDo = patterns; - if (mPatternsToDo.empty()) { - mPatternsToDo.push_back(QStringLiteral(" ")); // empty list means all -> mae - } - // sure to fail the first - // startAProcess() guard clause - - return startAProcess(); -} - -#if MAX_CMD_LENGTH < 65 + 128 -#error MAX_CMD_LENGTH is too low -#endif - -GpgME::Error QGpgME::QGpgMERefreshKeysJob::startAProcess() -{ - if (mPatternsToDo.empty()) { - return GpgME::Error(); - } - // create and start gpgsm process: - mProcess = new QProcess(this); - mProcess->setObjectName(QStringLiteral("gpgsm -k --with-validation --force-crl-refresh --enable-crl-checks")); - - // FIXME: obbtain the path to gpgsm from gpgme, so we use the same instance. - mProcess->setProgram(QStringLiteral("gpgsm")); - QStringList arguments; - arguments << QStringLiteral("-k") - << QStringLiteral("--with-validation") - << QStringLiteral("--force-crl-refresh") - << QStringLiteral("--enable-crl-checks"); - unsigned int commandLineLength = MAX_CMD_LENGTH; - commandLineLength -= - strlen("gpgsm") + 1 + strlen("-k") + 1 + - strlen("--with-validation") + 1 + strlen("--force-crl-refresh") + 1 + - strlen("--enable-crl-checks") + 1; - while (!mPatternsToDo.empty()) { - const QByteArray pat = mPatternsToDo.front().toUtf8().trimmed(); - const unsigned int patLength = pat.length(); - if (patLength >= commandLineLength) { - break; - } - mPatternsToDo.pop_front(); - if (pat.isEmpty()) { - continue; - } - arguments << QLatin1String(pat); - commandLineLength -= patLength + 1; - } - - mProcess->setArguments(arguments); - - connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), - SLOT(slotProcessExited(int,QProcess::ExitStatus))); - connect(mProcess, SIGNAL(readyReadStandardOutput()), - SLOT(slotStdout())); - connect(mProcess, &QProcess::readyReadStandardError, - this, &QGpgMERefreshKeysJob::slotStderr); - - mProcess->start(); - if (!mProcess->waitForStarted()) { - mError = GpgME::Error::fromCode(GPG_ERR_ENOENT, GPG_ERR_SOURCE_GPGSM); // what else? - deleteLater(); - return mError; - } else { - return GpgME::Error(); - } -} - -void QGpgME::QGpgMERefreshKeysJob::slotCancel() -{ - if (mProcess) { - mProcess->kill(); - } - mProcess = nullptr; - mError = GpgME::Error::fromCode(GPG_ERR_CANCELED, GPG_ERR_SOURCE_GPGSM); -} - -void QGpgME::QGpgMERefreshKeysJob::slotStatus(QProcess *proc, const QString &type, const QStringList &args) -{ - if (proc != mProcess) { - return; - } - QStringList::const_iterator it = args.begin(); - bool ok = false; - - if (type == QLatin1String("ERROR")) { - - if (args.size() < 2) { - qCDebug(QGPGME_LOG) << "not recognising ERROR with < 2 args!"; - return; - } - const int source = (*++it).toInt(&ok); - if (!ok) { - qCDebug(QGPGME_LOG) << "expected number for first ERROR arg, got something else"; - return; - } - ok = false; - const int code = (*++it).toInt(&ok); - if (!ok) { - qCDebug(QGPGME_LOG) << "expected number for second ERROR arg, got something else"; - return; - } - mError = GpgME::Error::fromCode(code, source); - - } else if (type == QLatin1String("PROGRESS")) { - - if (args.size() < 4) { - qCDebug(QGPGME_LOG) << "not recognising PROGRESS with < 4 args!"; - return; - } - const QString what = *++it; - ok = false; - (*++it).toInt(&ok); - if (!ok) { - qCDebug(QGPGME_LOG) << "expected number for \"type\", got something else"; - return; - } - ok = false; - const int cur = (*++it).toInt(&ok); - if (!ok) { - qCDebug(QGPGME_LOG) << "expected number for \"cur\", got something else"; - return; - } - ok = false; - const int total = (*++it).toInt(&ok); - if (!ok) { - qCDebug(QGPGME_LOG) << "expected number for \"total\", got something else"; - return; - } - // TODO port - Q_EMIT progress(QString(), cur, total); - - } -} - -void QGpgME::QGpgMERefreshKeysJob::slotStderr() -{ - // implement? or not? -} - -void QGpgME::QGpgMERefreshKeysJob::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus) -{ - if (!mError && !mPatternsToDo.empty()) { - if (const GpgME::Error err = startAProcess()) { - mError = err; - } else { - return; - } - } - - Q_EMIT done(); - if (!mError && - (exitStatus != QProcess::NormalExit || exitCode != 0)) { - mError = GpgME::Error::fromCode(GPG_ERR_GENERAL, GPG_ERR_SOURCE_GPGSM); - } - Q_EMIT result(mError); - deleteLater(); -} -#include "qgpgmerefreshkeysjob.moc"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmerefreshkeysjob.h
Deleted
@@ -1,80 +0,0 @@ -/* - qgpgmerefreshkeysjob.h - - This file is part of qgpgme, the Qt API binding for gpgme - Copyright (c) 2004 Klarälvdalens Datakonsult AB - Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik - Software engineering by Intevation GmbH - - QGpgME is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - QGpgME 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 - General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - - In addition, as a special exception, the copyright holders give - permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked - combinations including the two. You must obey the GNU General - Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to - your version of the file, but you are not obligated to do so. If - you do not wish to do so, delete this exception statement from - your version. -*/ - -#ifndef __QGPGME_QGPGMEREFRESHKEYSJOB_H__ -#define __QGPGME_QGPGMEREFRESHKEYSJOB_H__ - -#include "refreshkeysjob.h" -#ifdef BUILDING_QGPGME -# include "context.h" -#else -#include "gpgme++/context.h" -#endif - -#include <QStringList> -#include <QProcess> - -namespace QGpgME -{ - -class QGpgMERefreshKeysJob : public RefreshKeysJob -{ - Q_OBJECT -public: - QGpgMERefreshKeysJob(); - ~QGpgMERefreshKeysJob(); - - /* from RefreshKeysJob */ - GpgME::Error start(const QStringList &patterns) Q_DECL_OVERRIDE; - -private Q_SLOTS: - /* from Job */ - void slotCancel() Q_DECL_OVERRIDE; - - void slotStatus(QProcess *, const QString &, const QStringList &); - void slotStderr(); - void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); - -private: - GpgME::Error startAProcess(); - -private: - QProcess *mProcess; - GpgME::Error mError; - QStringList mPatternsToDo; -}; - -} - -#endif // __QGPGME_QGPGMEREFRESHKEYSJOB_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/m4/qt.m4
Deleted
@@ -1,80 +0,0 @@ -dnl qt.m4 -dnl Copyright (C) 2016 Intevation GmbH -dnl -dnl This file is part of gpgme and is provided under the same license as gpgme - -dnl Autoconf macro to find either Qt4 or Qt5 -dnl -dnl sets GPGME_QT_LIBS and GPGME_QT_CFLAGS -dnl -dnl if QT5 was found have_qt5_libs is set to yes - -AC_DEFUN(FIND_QT, - - have_qt5_libs="no"; - - PKG_CHECK_MODULES(GPGME_QT, - Qt5Core >= 5.0.0, - have_qt5_libs="yes", - have_qt5_libs="no") - - PKG_CHECK_MODULES(GPGME_QTTEST, - Qt5Test >= 5.0.0, - have_qt5test_libs="yes", - have_qt5test_libs="no") - - if ! test "$have_w32_system" = yes; then - if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then - GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fpic" - fi - fi - if test "$have_qt5_libs" = "yes"; then - AC_CHECK_TOOL(MOC, moc) - AC_MSG_CHECKING(moc version) - mocversion=`$MOC -v 2>&1` - mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` - if test x"$mocversiongrep" != x"$mocversion"; then - AC_MSG_RESULT(no) - # moc was not the qt5 one, try with moc-qt5 - AC_CHECK_TOOL(MOC2, moc-qt5) - mocversion=`$MOC2 -v 2>&1` - mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"` - if test x"$mocversiongrep" != x"$mocversion"; then - AC_CHECK_TOOL(QTCHOOSER, qtchooser) - qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` - mocversion=`$qt5tooldir/moc -v 2>&1` - mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` - if test x"$mocversiongrep" != x"$mocversion"; then - # no valid moc found - have_qt5_libs="no"; - else - MOC=$qt5tooldir/moc - fi - else - MOC=$MOC2 - fi - fi - AC_MSG_RESULT($mocversion) - dnl Check that a binary can actually be build with this qt. - dnl pkg-config may be set up in a way that it looks also for libraries - dnl of the build system and not only for the host system. In that case - dnl we check here that we can actually compile / link a qt application - dnl for host. - OLDCPPFLAGS=$CPPFLAGS - CPPFLAGS=$GPGME_QT_CFLAGS - OLDLIBS=$LIBS - LIBS=$GPGME_QT_LIBS - AC_LANG_PUSH(C++) - AC_MSG_CHECKING(whether a simple qt program can be built) - AC_LINK_IFELSE(AC_LANG_SOURCE( - #include <QCoreApplication> - int main (int argc, char **argv) { - QCoreApplication app(argc, argv); - app.exec(); - }), have_qt5_libs='yes', have_qt5_libs='no') - AC_MSG_RESULT($have_qt5_libs) - AC_LANG_POP() - CPPFLAGS=$OLDCPPFLAGS - LIBS=$OLDLIBS - fi -)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/AUTHORS -> _service:tar_scm:gpgme-1.21.0.tar.bz2/AUTHORS
Changed
@@ -22,7 +22,7 @@ Copyright (C) 1991-2013 Free Software Foundation, Inc. Copyright (C) 2000-2001 Werner Koch - Copyright (C) 2001-2021 g10 Code GmbH + Copyright (C) 2001-2023 g10 Code GmbH Copyright (C) 2002 Klarälvdalens Datakonsult AB Copyright (C) 2004-2008 Igor Belyi Copyright (C) 2002 John Goerzen @@ -43,7 +43,7 @@ src/stpcpy.c, src/w32-ce.c. g10 Code GmbH <code@g10code.com> - - All stuff since mid march 2001. + - All stuff since mid March 2001. Werner Koch <wk@gnupg.org> - Design and most stuff.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/ChangeLog -> _service:tar_scm:gpgme-1.21.0.tar.bz2/ChangeLog
Changed
@@ -1,3 +1,1878 @@ +2023-07-07 Werner Koch <wk@gnupg.org> + + Release 1.21.0. + + commit 5bf3e6d0754a179b316f90a885371af99bc03ea1 + + +2023-06-23 NIIBE Yutaka <gniibe@fsij.org> + + build: Add BUILT_SOURCE for better dependency. + + commit 05ac1ce09ff199c715805cf601ea6d65e26c1fff + * Makefile.am (BUILT_SOURCE): Add conf/config.h. + +2023-06-21 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Support reading signed/encrypted archives directly from a file. + + commit 1c2459a5927866931808141ac6c4157cd5e3a157 + * lang/qt/src/decryptverifyarchivejob.cpp, + lang/qt/src/decryptverifyarchivejob.h (DecryptVerifyArchiveJob): Add + member functions setInputFile, inputFile. + * lang/qt/src/decryptverifyarchivejob_p.h + (DecryptVerifyArchiveJobPrivate): Add member m_inputFilePath. + * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp (decrypt_verify): Move + creation of indata to decrypt_verify_from_io_device. + (decrypt_verify_from_io_device, decrypt_verify_from_file_name): New. + (QGpgMEDecryptVerifyArchiveJob::start): Use + decrypt_verify_from_io_device instead of decrypt_verify. + (QGpgMEDecryptVerifyArchiveJobPrivate::startIt): Start the job with the + values from member variables. + + * lang/qt/tests/run-decryptverifyarchivejob.cpp (createInput): Remove. + (main): Remove creation of input. Make the job read the archive directly + from the given archive name. + + core: Support reading the archive to decrypt/verify directly from a file + + commit 1a9f192ab450288aea7a889527e78afd2c067b59 + * src/engine-gpg.c (add_file_name_arg_or_data): New. + (gpg_decrypt): Use add_file_name_arg_or_data instead of add_data for the + ciphertext. + (gpg_verify): Use add_file_name_arg_or_data instead of add_data for the + signature and the signed text. + + * tests/run-decrypt.c (show_usage): New option --direct-file-io. + (main): Parse new option. If option is given, then don't open input + file, create simple data object instead of data object from stream and + set input file name on input data. + * tests/run-verify.c (show_usage): New option --direct-file-io. + (main): Parse new option. If option is given, then don't open input + files, create simple data objects instead of data objects from stream + and set input file names on input data objects. + +2023-06-19 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Support writing signed/encrypted archives directly to a file. + + commit e608315392cc5b7ddf51e16dce5fe7e99b83f011 + * lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h + (EncryptArchiveJob): Add member functions setRecipients, recipients, + setInputPaths, inputPaths, setOutputFile, outputFile, + setEncryptionFlags, encryptionFlags. + * lang/qt/src/encryptarchivejob_p.h (EncryptArchiveJobPrivate): Add + members m_recipients, m_inputPaths, m_outputFilePath, m_encryptionFlags. + * lang/qt/src/qgpgmeencryptarchivejob.cpp (encrypt): Move creation of + outdata to encrypt_to_io_device. + (encrypt_to_io_device, encrypt_to_filename): New. + (QGpgMEEncryptArchiveJob::start): Use encrypt_to_io_device instead of + encrypt. + (QGpgMEEncryptArchiveJobPrivate::startIt): Start the job with the + values from member variables. + * lang/qt/src/qgpgmesignarchivejob.cpp (sign): Move creation of + outdata to sign_to_io_device. + (sign_to_io_device, sign_to_filename): New. + (QGpgMESignArchiveJob::start): Use sign_to_io_device instead of sign. + (QGpgMESignArchiveJobPrivate::startIt): Start the job with the + values from member variables. + * lang/qt/src/qgpgmesignencryptarchivejob.cpp (sign_encrypt): Move + creation of outdata to sign_encrypt_to_io_device. + (sign_encrypt_to_io_device, sign_encrypt_to_filename): New. + (QGpgMESignEncryptArchiveJob::start): Use sign_encrypt_to_io_device + instead of sign_encrypt. + (QGpgMESignEncryptArchiveJobPrivate::startIt): Start the job with the + values from member variables. + * lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h + (SignArchiveJob): Add member functions setSigner, signers, + setInputPaths, inputPaths, setOutputFile, outputFile. + * lang/qt/src/signarchivejob_p.h (SignArchiveJobPrivate): Add + members m_signers, m_inputPaths, m_outputFilePath. + * lang/qt/src/signencryptarchivejob.cpp, + lang/qt/src/signencryptarchivejob.h (SignEncryptArchiveJob): Add + member functions setSigner, signers, setRecipients, recipients, + setInputPaths, inputPaths, setOutputFile, outputFile, + setEncryptionFlags, encryptionFlags. + * lang/qt/src/signencryptarchivejob_p.h (SignEncryptArchiveJobPrivate): + Add members m_signers, m_recipients, m_inputPaths, m_outputFilePath, + m_encryptionFlags. + + * lang/qt/tests/run-encryptarchivejob.cpp (createOutput): Remove. + (checkOutputFilePath): New. + (main): Create file output writing to stdout if no archive name (or "-") + is given. Exit if file with given archive name already exists. Make + the jobs write the created archive directly to the given archive name. + * lang/qt/tests/run-signarchivejob.cpp (createOutput): Remove. + (checkOutputFilePath): New. + (main): Create file output writing to stdout if no archive name (or "-") + is given. Exit if file with given archive name already exists. Make + the jobs write the created archive directly to the given archive name. + + core: Support writing the sign/encrypt output directly to a file. + + commit c38b6200396f703917e4c66aca068f90cfbad325 + * src/engine-gpg.c (gpg_encrypt): Pass output file name to gpg if output + has file name set. + (gpg_encrypt_sign): Ditto. + (gpg_sign): Ditto. + + * tests/run-encrypt.c (show_usage): New option --output. + (main): Parse new option. Set file name on output if --output is given. + Do not print output if --output is given. + * tests/run-sign.c (show_usage): New option --output. + (main): Parse new option. Set file name on output if --output is given. + Do not print output if --output is given. + + qt: Add a generic hook to start a job. + + commit 8b9fabf5d55419a68c2b0fc7fd1a90517c881d78 + * lang/qt/src/job.cpp, lang/qt/src/job.h (Job::startIt): New method. + * lang/qt/src/job_p.h (JobPrivate::startIt): New pure virtual method. + * lang/qt/src/qgpgmechangeexpiryjob.cpp + (QGpgMEChangeExpiryJobPrivate::startIt): New. + * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp + (QGpgMEDecryptVerifyArchiveJobPrivate::startIt): New. + * lang/qt/src/qgpgmeencryptarchivejob.cpp + (QGpgMEEncryptArchiveJobPrivate::startIt): New. + * lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::startIt): + New. + * lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::startIt): + New. + * lang/qt/src/qgpgmelistallkeysjob.cpp + (QGpgMEListAllKeysJobPrivate::startIt): New. + * lang/qt/src/qgpgmesignarchivejob.cpp + (QGpgMESignArchiveJobPrivate::startIt): New. + * lang/qt/src/qgpgmesignencryptarchivejob.cpp + (QGpgMESignEncryptArchiveJobPrivate::startIt): New. + * lang/qt/src/qgpgmesignencryptjob.cpp + (QGpgMESignEncryptJobPrivate::startIt): New. + + qt: Make the run methods of ThreadedJobMixin public. + + commit 23526c3ff26be11e4ebb1294b6f60202881a066c + * lang/qt/src/threadedjobmixin.h (ThreadedJobMixin::run): Make all + overloads public. + + qt: Rename JobPrivate::start to JobPrivate::startNow. + + commit 4655b2dc6b33aca3bd6737eadadfb8afcf8694bd + * lang/qt/src/job_p.h (JobPrivate::start): Rename to startNow. + * lang/qt/src/job.cpp (Job::startNow): Adapt function call. + * lang/qt/src/qgpgmechangeexpiryjob.cpp + (QGpgMEChangeExpiryJobPrivate::start): Rename to startNow. + * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp + (QGpgMEDecryptVerifyArchiveJobPrivate::start): Rename to startNow. + * lang/qt/src/qgpgmeencryptarchivejob.cpp + (QGpgMEEncryptArchiveJobPrivate::start): Rename to startNow. + * lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::start): + Rename to startNow. + * lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::start): + Rename to startNow. + * lang/qt/src/qgpgmelistallkeysjob.cpp + (QGpgMEListAllKeysJobPrivate::start): Rename to startNow. + * lang/qt/src/qgpgmesignarchivejob.cpp + (QGpgMESignArchiveJobPrivate::start): Rename to startNow. + * lang/qt/src/qgpgmesignencryptarchivejob.cpp + (QGpgMESignEncryptArchiveJobPrivate::start): Rename to startNow. + * lang/qt/src/qgpgmesignencryptjob.cpp + (QGpgMESignEncryptJobPrivate::start): Rename to startNow. + + qt: Return const pointer to JobPrivate class for const pointer to Job. + + commit 6f6b35df505af108669bd6ff8c351c970130eb45 + * lang/qt/src/job.cpp, lang/qt/src/job_p.h (getJobPrivate): Replace with + two overloads for non-const pointer and const pointer to Job. + * lang/qt/src/job_p.h (jobPrivate): Replace with two template functions + for non-const pointer and const pointer to Job. + +2023-06-16 Andre Heinecke <aheinecke@gnupg.org> + + qt, cpp: Support larger size-hint on 32 bit builds. + + commit 5811d069d3b391e9fd77c1062a2d96be41645422 + * NEWS: Mention this. + * lang/cpp/src/data.h, lang/cpp/src/data.cpp (Data::setSizeHint): New. + * lang/qt/src/qgpgmedecryptjob.cpp, + lang/qt/src/qgpgmedecryptverifyarchivejob.cpp, + lang/qt/src/qgpgmedecryptverifyjob.cpp, + lang/qt/src/qgpgmeencryptjob.cpp, + lang/qt/src/qgpgmesignencryptjob.cpp, + lang/qt/src/qgpgmesignjob.cpp, + lang/qt/src/qgpgmeverifydetachedjob.cpp, + lang/qt/src/qgpgmeverifyopaquejob.cpp: Set size for input IODevice. + + cpp: Expose gpgme_data_set_flag through cpp API. + + commit cbcea4a09b1309a4bd822247a8dfcdcb73041f9c + * lang/cpp/src/data.cpp (Data::setFlag): New. + * lang/cpp/src/data.h: Update accordingly. + * NEWS: Mention this. + +2023-06-15 Werner Koch <wk@gnupg.org> + + core: Send a input-size-hint for gpgsm. + + commit 91bbb1e482da783b4d1b9d5f663a1a0af77fc0a4 + * src/engine-gpgsm.c (send_input_size_hint): New. + (gpgsm_decrypt): Send hint. + (gpgsm_encrypt): Send hint. + (gpgsm_sign): Send hint. + (gpgsm_verify): Send hint. + + tests: Add option --cancel to run-encrypt. + + commit 8796456d235d2d7a8a1ce7337abc1d4d149bcf9a + * tests/run-encrypt.c (cancel_after_progress): New. + (progress_cb): Take care of it. + (main): Add option --cancel. + + core: Use 64 bit instead of gpgme_off_t for some internal functions. + + commit eb68948c438814b99b81adf44b674738d0b1be34 + * src/conversion.c (_gpgme_string_to_off): Return an u64 value. + * src/data.c (_gpgme_data_get_size_hint): Ditto. + (gpgme_data_set_flag): Use u64 for io-buffer-size due to string_to_off + change. + * src/data.h (struct gpgme_data): Change size_hint to u64. + * src/engine-gpg.c (add_input_size_hint): Replace gpgme_off_t by u64. + +2023-06-13 Andre Heinecke <aheinecke@gnupg.org> + + Fix definition of GPG_ERR_ENABLE_GETTEXT_MACROS. + + commit 7e6d51aa6fc97bed12486540167e9b710c9a3378 + * configure.ac: Add missing value. + +2023-06-01 Ingo Klöcker <dev@ingo-kloecker.de> + + doc,cpp: Treat GPG_ERR_FULLY_CANCELED as canceled. + + commit 7990f70107bc8487f954c6885436a7661e162929 + * doc/gpgme.texi (GPG_ERR_FULLY_CANCELED): New. + * lang/cpp/src/context.cpp (Error::isCanceled): Also return true for + GPG_ERR_FULLY_CANCELED. + +2023-05-30 Biswapriyo Nath <nathbappai@gmail.com> + + cpp,python: Respect --disable-gpg-test for tests. + + commit e2103be390764f62b21a4e5d4fa90a7b78326787 + lang/cpp/Makefile.am (SUBDIRS): Depend tests in RUN_GPG_TESTS. + lang/python/Makefile.am (SUBDIRS): Ditto. + +2023-05-30 Werner Koch <wk@gnupg.org> + + core: For key signing and uid revoking allow an empty user id. + + commit fbc3963d6229853fe9fb1fd599ef39ed0fe2eae6 + * src/engine-gpg.c (gpg_keysign): Required USERID to be non-empty. + +2023-05-23 Werner Koch <wk@gnupg.org> + + python: Fix wrong use of write. + + commit 36a68bc5308c0b4a541ca6adea5d3635217e8af2 + * lang/python/helpers.c (pyPassphraseCb): Use gpgme_io_writen. + (_gpg_interact_cb): Ditto. + * lang/python/helpers.h (write) W32: Remove bad write macro. + +2023-05-16 NIIBE Yutaka <gniibe@fsij.org> + + build: Sync to libtool from libgpg-error for 64-bit Windows. + + commit e622e36f1f32641c66b28a0de95c75ae35f6ca05 + * build-aux/ltmain.hs: Update from libgpg-error. + +2023-04-26 NIIBE Yutaka <gniibe@fsij.org> + Ingo Klöcker + + doc: Fix Python example code. + + commit d44a473e27160a35268789e14dccd0ad55af0690 + * lang/python/doc/src/gpgme-python-howto.org: Fix chmod race. + * lang/python/examples/howto/export-secret-key.py: Likewise. + * lang/python/examples/howto/export-secret-keys.py: Likewise. + * lang/python/examples/howto/temp-homedir-config.py: Likewise. + +2023-04-20 Werner Koch <wk@gnupg.org> + + Release 1.20.0. + + commit 451ed47434c5ffd2916adae25e5a128606b5ef98 + + + core: Support the new macOS Homebrew location. + + commit 7351ef32ce7c04d20ee32fc9b645a1931b3b0aba + * src/posix-util.c (find_executable): Extend the path. + +2023-04-19 Ingo Klöcker <dev@ingo-kloecker.de> + + build,qt: Simplify check for moc. + + commit a14155d2c1b2ddc167dbf278faf1d6b469575492 + m4/qt6.m4: Remove alternative checks for moc that were taken over from + Qt 5 and that are obsolete for Qt 6. + + Update NEWS. + + commit e80bf34bf86f6f183145c31d598dda41c0496a4d + * NEWS: Add news for recent changes + +2023-04-18 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Fix Key::canSign() + + commit 5bd84cfd3f092703bb4b9b993be7d89ca13b36b0 + * lang/cpp/src/key.h (canReallySign): Deprecate. + * lang/cpp/src/key.cpp (canSign): Remove workaround. Use implementation + of canReallySign. + (canReallySign): Use canSign(). + (operator<<): Use canSign(). + +2023-04-17 Werner Koch <wk@gnupg.org> + + core: Avoid printf format warnings due to gpgme_ssize_t. + + commit 7d1159c1e99bb1bae0ab698c85105dcdcb95b7ea + * src/debug.h (_trace_sysres_ssize_t): Cast arg. + + core,w32: Fix invocation of gpgtar. + + commit 0c29119e061cbdcb7342380938a25af91290f1a0 + * src/dirinfo.c (EXEEXT_S): New. + (get_gpgconf_item): Append ".exe" to gpg-wks-client and gpgtar. + + * src/gpgme-w32spawn.c (mystderr): Add code to ease debugging. + +2023-04-06 NIIBE Yutaka <gniibe@fsij.org> + + build: Update gpg-error.m4. + + commit 806a5d18b988449fbaa3c2e6380acf3ae4580f4a + * m4/gpg-error.m4: Update from libgpg-error master. + +2023-04-04 Ingo Klöcker <dev@ingo-kloecker.de> + + w32: Always use UTF-8 for localized texts. + + commit d256ba7cc57d9bfcfa05fb05cf66dc992efbb695 + * configure.ac: Define GPG_ERR_ENABLE_GETTEXT_MACROS. + * src/version.c (do_subsystem_inits) W32: Switch gettext to UTF-8. + +2023-03-27 Werner Koch <wk@gnupg.org> + + core: Minor code cleanup. + + commit 34cc7daba12a2a6baa3cfa337762656c210686fa + * src/engine-gpg.c (build_argv): Remove superfluous tes. + +2023-03-27 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Initialize error variable. + + commit b608c084b9220d8ed288eb916e88a236abac0707 + * src/engine-gpg.c (build_argv): Initialize err. + +2023-03-21 Werner Koch <wk@gnupg.org> + + core,cpp: Add new key flags to gpgme_subkey_t. + + commit 6d21256c9220df05bf92a695a787dde13fe44ca7 + * src/gpgme.h.in (struct _gpgme_subkey): Add bit flags can_renc, + can_timestamp, adn is_group_owned. Reduce size of _unused. + * src/keylist.c (set_subkey_capability): Set them. + * tests/run-keylist.c (main): Print them. + + * lang/cpp/src/key.h (Subkey::canRenc): New. + (Subkey::canTimestamp): New. + (Subkey::isGroupOwned): New. + * lang/cpp/src/key.cpp: Implement new methods. + (Subkey::isQualified): Print them. + (std::ostream &operator<<): Print them. + +2023-03-17 Werner Koch <wk@gnupg.org> + + Release 1.19.0. + + commit 96a30fdf30626a7cefd9c9e620a60817ef44fde2 + + +2023-03-17 Ben Greiner (bnavigator) <unknown@dev.gnupg.org> + + python: Update python.m4 configure script. + + commit d086653cc346d5634bc742d5586e927fc9ee57cf + * configure.ac: Unset PYTHON_LIBS. Support python 3.10. + * m4/python.m4: Find correct version string for python >= 3.10. + +2023-03-17 Ingo Klöcker <dev@ingo-kloecker.de> + + tests: Package the ownertrust file. + + commit e50724e1bbe55678dfcd2a1ea75157f6514fc58a + tests/gpg/Makefile.am (EXTRA_DIST): Add ownertrust.txt. + +2023-03-08 Werner Koch <wk@gnupg.org> + + core: Also detect legacy X.509 v0 certificates. + + commit c1f6535f144dedfbf5507f850d4da5b61fd5ec74 + * src/data-identify.c (basic_detection): Loose the detection of X.509 + certs. + + tests: Add option --binary to run-verify. + + commit 76351c4877d60799a35afccd87037d5dd0871262 + * tests/run-verify.c (main): Set encoding. + +2023-02-14 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Add signals for file-based and data-based progress. + + commit 73e46b34658c0130de5ab9e3f4ce1ac4ee35c5e2 + * lang/qt/src/decryptverifyarchivejob.h (DecryptVerifyArchiveJob): Add + signals fileProgress and dataProgress. + * lang/qt/src/encryptarchivejob.h (EncryptArchiveJob): Ditto. + * lang/qt/src/signarchivejob.h (SignArchiveJob): Ditto. + * lang/qt/src/signencryptarchivejob.h (SignEncryptArchiveJob): Ditto. + * lang/qt/src/job_p.h (emitArchiveProgressSignals): New. + * lang/qt/src/qgpgmedecryptverifyarchivejob.cpp + (QGpgMEDecryptVerifyArchiveJob::QGpgMEDecryptVerifyArchiveJob): Emit + appropriate signal when receiving Job::rawProgress signal. + * lang/qt/src/qgpgmeencryptarchivejob.cpp + (QGpgMEEncryptArchiveJob::QGpgMEEncryptArchiveJob): Ditto. + * lang/qt/src/qgpgmesignarchivejob.cpp + (QGpgMESignArchiveJob::QGpgMESignArchiveJob): Ditto. + * lang/qt/src/qgpgmesignencryptarchivejob.cpp + (QGpgMESignEncryptArchiveJob::QGpgMESignEncryptArchiveJob): Ditto. + + qt: Add simple and extended progress signals replacing old signal. + + commit ea6f15ed602eeb9fa87766ba88acc78361a14b38 + * lang/qt/src/job.h (Job): Add signals jobProgress and rawProgress. + Deprecate signal progress. + * lang/qt/src/multideletejob.cpp (MultiDeleteJob::slotResult): Emit + new progress signals. + * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp + (QGpgMERefreshSMIMEKeysJob::slotStatus): Ditto. + * lang/qt/src/threadedjobmixin.h (ThreadedJobMixin::showProgress): Use + modern overload of QMetaObject::invokeMethod to forward the progress + signal and add the value of what. Add forwarding of progress to the new + signals. + + * lang/qt/tests/t-encrypt.cpp (EncryptionTest::testProgress): Test + the new signals instead of the deprecated one. + +2023-02-10 Werner Koch <wk@gnupg.org> + + core: Switch to logging via gpgrt. + + commit 9c5506fde701f637381614dcfe22e3f9dc82955d + * src/debug.c (errfp): Remove. + (debug_init): Factor some code out to ... + (safe_to_use_debug_file): new. + (tid_log_callback): New. + (debug_init): Rewrite to make use of gpgrt logging. + (_gpgme_debug): Ditto. + (_gpgme_debug_end): Remove extra LF testing code. + * src/dirinfo.c (get_gpgconf_item): Remove now unneeded LFs. Realign + output. + +2023-02-10 Ingo Klöcker <dev@ingo-kloecker.de> + + tests: Fix cleaning up at the end of the test. + + commit 21283dfd1be1e56bc174cf5f12461888af7ab8b5 + * tests/gpg/t-import.c (main): Unref key and release context. + + core: Allow finalization of signature verification of unencrypted data. + + commit 41dc3bd22a3e0001abec8f2bea79b40ee5ad00be + * src/decrypt-verify.c (decrypt_verify_status_handler): Call + _gpgme_verify_status_handler on EOF even if + _gpgme_decrypt_status_handler returned NO DATA error. + + * tests/gpg/t-decrypt-verify.c (normal_signed_message): New. + (main): Add test with signed, but not encrypted data. + +2023-02-09 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Improve debug output of some enums. + + commit 3aaed9cfbfd6821b2e812fbdd24448953d6ca279 + * lang/cpp/src/verificationresult.cpp (operator<<): Fix output of + Signature::PKAStatus which doesn't represent flags. Print corresponding + name of enum value if Signature::Summary or Notation::Flags are 0. + + tests: Stop daemons after setting up test environment. + + commit 7098c14b231113055535abb14b4cde0c845f8728 + * lang/python/tests/Makefile.am, lang/qt/tests/Makefile.am, + tests/gpg/Makefile.am, tests/json/Makefile.am (pubring-stamp): Call + `gpgconf --kill all` after importing test keys. + +2023-02-08 Ingo Klöcker <dev@ingo-kloecker.de> + + tests: Extend tests with an ultimately trusted key. + + commit fcefc78f749a8f39cc587636647b24f8fa48efad + * tests/gpg/Makefile.am (gpg-sample.stamp, pubring-stamp): Unify usage + of tabs. + (pubring-stamp): Import owner trust values. + * tests/gpg/ownertrust.txt: New. + * tests/gpg/t-decrypt-verify.c, tests/gpg/t-verify.c: Update expected + values for signature summary and validity. + * tests/gpg/t-keylist-secret-sig.c, tests/gpg/t-keylist-sig.c, + tests/gpg/t-keylist.c: Update expected values of owner trust and uid + validity. + + tests: Make t-edit-sign idempotent. + + commit 844e6cd3b923834727f042b92d6a9a2db86b3fed + * tests/gpg/t-edit-sign.c (test_key, test_key_fpr, import_key, + delete_key): New. + (main): Remove key_fpr. Import test key to sign. Delete test key after + test. + +2023-02-02 Ingo Klöcker <dev@ingo-kloecker.de> + + qt,tests: Add test for the previous commit. + + commit 52fd0bcde47a676ee1021c870b50e2add78d6973 + * lang/qt/tests/t-decryptverify.cpp: New. + * lang/qt/tests/Makefile.am: Add new test. + + cpp: Return successful verification for signed but not encrypted data. + + commit 1698eec2ae3ec1a97c739e892d9cf288c0ec4ccd + * lang/cpp/src/context.cpp (Context::decrypt): Use decryptionResult(). + (Context::verifyDetachedSignature, Context::verifyOpaqueSignature): + Use verificationResult(). + (Context::verificationResult): Ignore "no data" error for signed but + not encrypted data. + (Context::decryptAndVerify): Use decryptionResult() and + verificationResult(). + + qt: Add job for extracting encrypted and signed archives. + + commit c407728064ca0c9b2f365437c6a7f2acc40e6d84 + * lang/qt/src/decryptverifyarchivejob.cpp, + lang/qt/src/decryptverifyarchivejob.h, + lang/qt/src/decryptverifyarchivejob_p.h, + lang/qt/src/qgpgmedecryptverifyarchivejob.cpp, + lang/qt/src/qgpgmedecryptverifyarchivejob.h: New. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function decryptVerifyArchiveJob + * lang/qt/src/protocol_p.h (Protocol::decryptVerifyArchiveJob): ... and + implement it. + * lang/qt/src/Makefile.am: Update accordingly. + + * lang/qt/tests/run-decryptverifyarchivejob.cpp: New. + * lang/qt/tests/Makefile.am: Add new test runner. + + core: Make usage of input size hint compatible with gpgtar. + + commit 7ad717f6ba00046a26a99d015d701a178ca30630 + * src/engine-gpg.c (add_input_size_hint): Use add_gpg_arg_with_value + to add the --input-size-hint option. + + cpp: Update decryption flags. + + commit b3bdf14b37a313c21de61168e5e7545ab08fea13 + * lang/cpp/src/context.h (DecryptArchive): New flag. + + qt: Allow checking if the sign/encrypt archive jobs are supported. + + commit 55c948866fb8bf4adbf0c8f53edf51a4075b753e + * lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h + (isSupported): New. + * lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h + (isSupported): New. + * lang/qt/src/signencryptarchivejob.cpp, + lang/qt/src/signencryptarchivejob.h (isSupported): New. + + * lang/qt/tests/run-encryptarchivejob.cpp (main), + lang/qt/tests/run-signarchivejob.cpp (main): Check if jobs are + supported. + + cpp: Add const-overloads of version comparison operators. + + commit 84780646910cdd91555a368650e3d92cf52b86bd + * lang/cpp/src/engineinfo.h (EngineInfo::Version): Add const-overloads + of all comparison operators. + + core: Allow usage of gpgtar also for new enough gpg 2.2. + + commit 7f541547fc1783bb9ea119695fb76e2000bdfcf8 + * src/engine-gpg.c (have_usable_gpgtar): New. + (start): Always pass --status-fd to the called process. + (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, gpg_sign, gpg_verify): + Use have_usable_gpgtar() to check for suitable gpg. + +2023-02-01 Werner Koch <wk@gnupg.org> + + core,w32: More robust detection of GnuPG Desktop dir layout. + + commit 5ab9c234d6b507f568fe1d2a2cbc82250a7828ee + * src/w32-util.c (INST_TYPE_GPG4WIN, INST_TYPE_GPGDESK): New to + replace the numeric constants. + (find_version_file): New. + (_gpgme_get_gpgconf_path): Guess a default for inst_type. + +2023-01-31 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Fix build without installed gpgme++ headers. + + commit 343fb33bf02bea74caf4e615483f1a00dc06f7b8 + * lang/qt/src/filelistdataprovider.cpp: Include error.h without + folder prefix. + + qt: Remove unused and commented-out code. + + commit d3a8c2c8b68b290a642c83c53a5989ee7fdc6331 + * lang/qt/src/qgpgmeencryptarchivejob.cpp, + lang/qt/src/qgpgmeencryptarchivejob.h (QGpgMEEncryptArchiveJob): + Remove member function resultHook and member mResult. + * lang/qt/src/qgpgmesignarchivejob.cpp, + lang/qt/src/qgpgmesignarchivejob.h (QGpgMESignArchiveJob): + Remove member function resultHook and member mResult. + + cpp: Fix debug output of SignatureMode. + + commit 41a30f6d9f59b08213ab2c307036be9bc9b6f876 + * lang/cpp/src/context.cpp (operator<<): Treat signature mode as + combination of a 2-bit flag and a 1-bit flag. + + qt: Add job for creating encrypted signed archives. + + commit 8c4436e73af369f79f125f56d020d01b184cafc6 + * lang/qt/src/signencryptarchivejob.cpp, + lang/qt/src/signencryptarchivejob.h, + lang/qt/src/signencryptarchivejob_p.h, + lang/qt/src/qgpgmesignencryptarchivejob.cpp, + lang/qt/src/qgpgmesignencryptarchivejob.h: New. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function signEncryptArchiveJob + * lang/qt/src/protocol_p.h (Protocol::signEncryptArchiveJob): ... and + implement it. + * lang/qt/src/Makefile.am: Update accordingly. + + * lang/qt/tests/run-encryptarchivejob.cpp (displayName): Remove. + (CommandLineOptions): Initialize member armor. Add member sign. + (parseCommandLine): Update application description. Add and parse option + -s/--sign. + (main): Use SignEncryptArchiveJob if sign option is set. + + qt,tests: Avoid leaking Context. + + commit 2b98585c89c1654aa736777eeb92ff79d5fdd72b + * lang/qt/tests/t-import.cpp: Wrap Context*s in unique_ptr. + +2023-01-31 Werner Koch <wk@gnupg.org> + + json: New operation "identify" and convenience option --identify. + + commit 359378c5b3f3aaf274dfc33861978c3cf6ec60ca + * src/gpgme-json.c (data_type_to_string): New. + (op_identify): New. + (process_request): Add to command list. + (cmd_identify): New. + (main): Add option --identify. + +2023-01-30 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Add job for creating signed archives. + + commit 8d672b3b7e5c5d487f20fb742a29fbee21236885 + * lang/qt/src/signarchivejob.cpp, lang/qt/src/signarchivejob.h, + lang/qt/src/signarchivejob_p.h, + lang/qt/src/qgpgmesignarchivejob.cpp, + lang/qt/src/qgpgmesignarchivejob.h: New. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function signArchiveJob + * lang/qt/src/protocol_p.h (Protocol::signArchiveJob): ... and + implement it. + * lang/qt/src/Makefile.am: Update accordingly. + + * lang/qt/tests/run-signarchivejob.cpp: New. + * lang/qt/tests/Makefile.am: Add new test runner. + + cpp: Support new archive signing flag. + + commit 2faa031af24959d5093da430d5f10fe30d77a75d + * lang/cpp/src/global.h (enum SignatureMode): Add constant SignArchive. + * lang/cpp/src/context.cpp (sigmode2sigmode): Rename to + sigflags2sigflags + (sigflags2sigflags): ... and rename argument mode to flags and treat + it as flags. Adjust the callers. + (operator<<): Change local CHECK macro to handle flags. Add new flag + to debug stream. + * lang/cpp/src/signingresult.cpp (CreatedSignature::mode): Handle + new flags (even if it cannot occur currently). + + core: Use signature modes as flags. + + commit 48b11f576260286bddef3833e25d0059638fe0bb + * src/engine-backend.h (engine_ops.sign): Rename argument mode to + flags. + * src/engine-gpg.c (gpg_sign): Rename argument mode to flags. Check + for invalid combination of flags. + * src/engine-gpgsm.c (gpgsm_sign): Rename argument mode to flags. + Check for unsupported flags. + * src/engine-uiserver.c (gpgsm_sign): Rename argument mode to flags. + Check for unsupported flags. + * src/engine.c, src/engine.h (_gpgme_engine_op_sign): Rename argument + mode to flags. + * src/gpgme.h.in (GPGME_SIG_MODE_ARCHIVE): Change value to 4. + (gpgme_op_sign_start, gpgme_op_sign): Rename argument mode to flags. + * src/sign.c (sign_start): Rename argument mode to flags. Adjust + check for invalid flags. + (gpgme_op_sign_start, gpgme_op_sign): Rename argument mode to flags. + +2023-01-27 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Add job for creating encrypted archives. + + commit 7afd135ccec73585e06272f98b4a0895e3ee6579 + * lang/qt/src/encryptarchivejob.cpp, lang/qt/src/encryptarchivejob.h, + lang/qt/src/encryptarchivejob_p.h, + lang/qt/src/qgpgmeencryptarchivejob.cpp, + lang/qt/src/qgpgmeencryptarchivejob.h: New. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function encryptArchiveJob + * lang/qt/src/protocol_p.h (Protocol::encryptArchiveJob): ... and + implement it. + * lang/qt/src/Makefile.am: Update accordingly. + + * lang/qt/tests/run-encryptarchivejob.cpp: New. + * lang/qt/tests/Makefile.am: Add new test runner. + + qt: Add data provider for list of file names. + + commit 275a3a2c16d27e5bc87f7d80af2ee703a92b6758 + * lang/qt/src/Makefile.am: Add new files and corresponding camel-case + header. + * lang/qt/src/dataprovider.h: Include interface from gpgme++ when + not building. + * lang/qt/src/filelistdataprovider.cpp, + lang/qt/src/filelistdataprovider.h: New. + + cpp: Support new archive encryption flag. + + commit d28ea8c6b3db008150e2bae99a33e30b55c4bc10 + * lang/cpp/src/context.h (EncryptArchive): New flag. + * lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert + EncryptArchive to corresponding gpgme encrypt flags. + (operator<<): Add new flag to debug stream. + + cpp: Add convenience overload to set file name. + + commit 261245a2e0e76568607c79a0c80372cb6f46444e + * lang/cpp/src/data.h, lang/cpp/src/data.cpp (setFileName): Add + overload. + +2023-01-26 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Support all encryption flags. + + commit 3e31f648e513bed0029b09104d416d25fca08868 + * lang/cpp/src/context.h (WantAddress): New flag. + * lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert + WantAddress to corresponding gpgme encrypt flags. + (operator<<): Add new flag to debug stream. + + cpp: Pass ThrowKeyIds and EncryptWrap flags to GpgME. + + commit 70aaf05a6a3eafd1ba96df71d03334337b1d071d + * lang/cpp/src/context.cpp (encryptflags2encryptflags): Convert + ThrowKeyIds and EncryptWrap to corresponding gpgme encrypt flags. + (operator<<): Add flags to debug stream. + + core: Update required GnuPG version for new archive features. + + commit 3580bb139b2e41f6c2397e506ee66f4892ceec62 + * src/engine-gpg.c (gpg_decrypt, gpg_encrypt, gpg_encrypt_sign, + gpg_sign, gpg_verify): Require gpg 2.4.1. + +2023-01-25 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Support usage of gpgtar for verifying a signed archive. + + commit 5b79b323971cb0794c45791851d85f8a66f0a441 + * src/gpgme.h.in (gpgme_verify_flags_t): New enum. + (GPGME_VERIFY_ARCHIVE): New const. + (gpgme_op_verify_ext_start): New func. + (gpgme_op_verify_ext): New func. + * src/gpgme.def, src/libgpgme.vers: Add new functions. + * src/verify.c (gpgme_op_verify_ext_start): New. + (gpgme_op_verify_ext): New. + (verify_start): Add arg FLAGS. Pass the flags to + _gpgme_engine_op_verify. + (gpgme_op_verify_start): Call gpgme_op_verify_ext_start with 0 for + FLAGS. + (gpgme_op_verify): Call gpgme_op_verify_ext with 0 for FLAGS. + * src/engine.c, src/engine.h (_gpgme_engine_op_verify): Add arg FLAGS. + * src/engine-backend.h (struct engine_ops): Add FLAGS to 'verify'. + * src/engine-gpg.c (gpg_verify): Add arg FLAGS. Set use_gpgtar engine + flag if GPGME_VERIFY_ARCHIVE flag is set. Check for new enough gpg. Use + add_gpg_arg for gpg-only options without a value. Set extra options for + gpgtar and pass input data to stdin when using gpgtar. + * src/engine-gpgsm.c (gpgsm_verify): Add arg FLAGS. Return error if + GPGME_VERIFY_ARCHIVE flag is set. + * src/engine-uiserver.c (uiserver_verify): Ditto. + + * tests/run-verify.c (show_usage): New options --archive, --directory, + and --diagnostics. + (main): Parse new options. Verify and extract with gpgtar if --archive + is given. Set file name of output data to value of --directory option. + Print stderr of gpg/gpgtar if --diagnostics is given. + +2023-01-24 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Support usage of gpgtar for decrypting an encrypted archive. + + commit 95ea3bf831aeac201108876e73750692aa1ba3f5 + * src/gpgme.h.in (GPGME_DECRYPT_ARCHIVE): New decryption flag. + * src/engine-gpg.c (gpg_decrypt): Set use_gpgtar engine flag if + GPGME_DECRYPT_ARCHIVE flag is set. Check for new enough gpg and + incompatible flags. Use add_gpg_arg_with_value for gpg-only options + with a value and add_gpg_arg for gpg-only options without a value. + Set extra options for gpgtar and pass input data to stdin when using + gpgtar. + + * tests/run-decrypt.c (show_usage): New options --archive and + --directory. + (main): Parse new options. Decrypt with gpgtar if --archive is given. + Set file name of output data to value of --directory option. + +2023-01-23 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Allow setting the base directory when creating an archive. + + commit 419adf41afa40e5b34f646f2cb16d8aebda20048 + * src/engine-gpg.c (gpg_encrypt, gpg_encrypt_sign, gpg_sign): Pass + file name set in data with --directory option to gpgtar. + + * tests/run-encrypt.c (show_usage): New option --directory. + (main): Parse new option. Set file name of input data to option value. + * tests/run-sign.c (show_usage): New option --directory. + (main): Parse new option. Set file name of input data to option value. + +2023-01-19 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Support usage of gpgtar for creating an encrypted signed archive. + + commit 29cfcd316d1bfc98ca663369a9503cc169dd3447 + * src/engine-gpg.c (gpg_encrypt_sign): Set use_gpgtar engine flag if + GPGME_ENCRYPT_ARCHIVE mode is set. Check for new enough gpg. Use + add_gpg_arg_with_value for gpg-only options with a value and + add_gpg_arg for gpg-only options without a value. Set extra options for + gpgtar and pass input data to stdin when using gpgtar. + + * tests/run-encrypt.c (print_result): Rename to print_encrypt_result. + Print header. + (print_sign_result): New. + (show_usage): New option --sign. + (main): Parse new option. Sign and encrypt --sign is given. + Print results of signing additionally to results of encryption. + + core: Support usage of gpgtar for creating a signed archive. + + commit 0ca45e48b45af1978027e6fe26c7e406fd5ec74b + * src/gpgme.h.in (GPGME_SIG_MODE_ARCHIVE): New signature mode. + * src/engine-gpg.c (append_args_from_sender, + append_args_from_sig_notations): Use add_gpg_arg_with_value + for gpg-only options with a value. + (gpg_sign): Set use_gpgtar engine flag if GPGME_SIG_MODE_ARCHIVE mode + is set. Check for new enough gpg. Use add_gpg_arg_with_value for + gpg-only options with a value and add_gpg_arg for gpg-only options + without a value. Set extra options for gpgtar and pass input data to + stdin when using gpgtar. + * src/sign.c (sign_start): Add GPGME_SIG_MODE_ARCHIVE as valid mode. + + * tests/run-sign.c (show_usage): New options --archive and + --diagnostics. + (main): Parse new options. Sign with gpgtar if --archive is given. + Print stderr of gpg/gpgtar if --diagnostics is given. + + core: Fix --set-filename argument. + + commit aa201b0bb63d703a3794826fac2e2013fb0c34e7 + * src/engine-gpg.c (gpg_encrypt): Append equal sign to argument name. + +2023-01-18 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Support usage of gpgtar for encryption. + + commit 5d8316da1d3dd0ab73743898e76c51932d0f13e2 + * src/gpgme.h.in (GPGME_ENCRYPT_ARCHIVE): New encryption flag. + * src/engine-gpg.c (arg_and_data_s): New field gpg_arg. + (engine_gpg): New flag use_gpgtar. + (_add_arg): Add argument gpg_arg and set it. + (add_arg_ext, add_arg_with_locp, add_arg, add_arg_pfx, add_arg_len): + Adjust call of _add_arg. + (add_arg_with_locp): Add argument front. + (add_gpg_arg, add_gpg_arg_with_value): New. + (gpg_new): Use add_gpg_arg_with_value for gpg-only options with a value + and add_gpg_arg for gpg-only options without. + (build_argv): Consider usage of gpgtar when counting arguments to pass + to gpg/gpgtar. Prepend "--gpg-args" to all gpg-only arguments if gpgtar + is used. + (start): Set program to use. Read diagnostics output from stderr when + using gpgtar. Do not pass --status-fd to gpgtar for gpg < 2.4.1. Use + add_gpg_arg_with_value for --lc-ctype and --lc-messages. + (gpg_encrypt): Set use_gpgtar engine flag if GPGME_ENCRYPT_ARCHIVE flag + is set. Check for new enough gpg and incompatible flags. Use + add_gpg_arg_with_value for gpg-only options with a value and + add_gpg_arg for gpg-only options without a value. Set extra options + for gpgtar and pass input data to stdin when using gpgtar. + * src/engine-gpgsm.c (gpgsm_encrypt): Return error if new flag is set. + * src/engine-uiserver.c (uiserver_encrypt): Ditto. + + * tests/run-encrypt.c (show_usage): New options --archive and + --diagnostics. + (main): Parse new options. Encrypt with gpgtar if --archive is given. + Print stderr of gpg/gpgtar if --diagnostics is given. + + core: Defer adding --status-fd and --logger-fd to argument list. + + commit d56b3bc1cfa128d0246cfac59411adaad2579bc4 + * src/engine-gpg.c (_append_to_arglist, _prepend_to_arglist): New. + (_add_arg): Use _append_to_arglist and _prepend_to_arglist. + (add_data_ext): New. Extends add_data. + (add_data): Uses add_data_ext. + (gpg_new): Do not add --status-fd and --logger-fd to argument list. + (start): Prepend --logger-fd and --status-fd to the argument list. + + core: Extend gpgme_get_dirinfo to return the gpgtar name. + + commit 12e490d97f2e7064bc9b5bea0d197790d10db106 + * src/dirinfo.c (WANT_GPGTAR_NAME): New. + (dirinfo): Add field gpgtar_name. + (get_gpgconf_item): Build gpgtar_name on demand and return it. + (_gpgme_get_default_gpgtar_name) : New. + (gpgme_get_dirinfo): New value "gpgtar-name" for WHAT. + * src/util.h (_gpgme_get_default_gpgtar_name): New. + + * tests/t-engine-info.c (main): Add gpgtar-name to the output. + +2023-01-17 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Use "goto leave" pattern to clean up resources. + + commit fbce7deb3b68af900f692591d5d05fa5c1a83f5f + * src/engine-gpg.c (build_argv): Initialize fd_data_map and argv. Goto + leave on error. Free fd_data_map and argv on error. + +2023-01-16 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Do not add obsolete --no-sk-comments to command line. + + commit 984ff7e3a2a9a261a0732cbdaf3b2f22d325b433 + * src/engine-gpg.c (build_argv): Don't add "--no-sk-comments" to argv. + +2023-01-05 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Fix comparisons of integer expressions of different signedness. + + commit 64da77620a451653e9b8c41bb0c9e58e22967123 + * lang/qt/tests/t-import.cpp (ImportTest::testImportWithImportFilter): + Make integer literal unsigned. + + cpp: Fix comparisons of integer expressions of different signedness. + + commit 2e9d72a0be8579d6f1d3c74c64873a9c2f844272 + * lang/cpp/src/gpgrevokekeyeditinteractor.cpp + (GpgRevokeKeyEditInteractor::Private::nextState): Cast signed nextLine + value to std::size_t. + + cpp: Expliticly declare compiler generated copy constructors. + + commit dc9cc9aa0754d834388acabb5a68677f6512b960 + * lang/cpp/src/configuration.h (Component, Option), + lang/cpp/src/data.h (Data), + lang/cpp/src/decryptionresult.h (DecryptionResult, + DecryptionResult::Recipient), + lang/cpp/src/encryptionresult.h (EncryptionResult, InvalidRecipient), + lang/cpp/src/engineinfo.h (EngineInfo), + lang/cpp/src/importresult.h (ImportResult, Import), + lang/cpp/src/key.h (Key, Subkey, UserID, UserID::Signature), + lang/cpp/src/keygenerationresult.h (KeyGenerationResult), + lang/cpp/src/keylistresult.h (KeyListResult), + lang/cpp/src/notation.h (Notation), + lang/cpp/src/signingresult.h (SigningResult, InvalidSigningKey, + CreatedSignature), + lang/cpp/src/swdbresult.h (SwdbResult), + lang/cpp/src/tofuinfo.h (TofuInfo), + lang/cpp/src/verificationresult.h (VerificationResult, Signature), + lang/cpp/src/vfsmountresult.h (VfsMountResult): Explitily declare + compiler generated copy constructor. + + qt: Replace Q_DECL_OVERRIDE with override. + + commit e16c368758e54b99d88529d3a10cecf36ed995b8 + * lang/qt/src/defaultkeygenerationjob.h, + lang/qt/src/hierarchicalkeylistjob.h, lang/qt/src/multideletejob.h, + lang/qt/src/protocol_p.h, lang/qt/src/qgpgmeadduseridjob.h, + lang/qt/src/qgpgmechangeexpiryjob.h, + lang/qt/src/qgpgmechangeownertrustjob.h, + lang/qt/src/qgpgmechangepasswdjob.h, lang/qt/src/qgpgmedecryptjob.h, + lang/qt/src/qgpgmedecryptverifyjob.h, lang/qt/src/qgpgmedeletejob.h, + lang/qt/src/qgpgmedownloadjob.h, lang/qt/src/qgpgmeencryptjob.h, + lang/qt/src/qgpgmeexportjob.h, lang/qt/src/qgpgmegpgcardjob.h, + lang/qt/src/qgpgmeimportfromkeyserverjob.h, + lang/qt/src/qgpgmeimportjob.h, lang/qt/src/qgpgmekeyformailboxjob.h, + lang/qt/src/qgpgmekeygenerationjob.h, lang/qt/src/qgpgmekeylistjob.h, + lang/qt/src/qgpgmelistallkeysjob.h, lang/qt/src/qgpgmenewcryptoconfig.h, + lang/qt/src/qgpgmequickjob.h, lang/qt/src/qgpgmerefreshsmimekeysjob.h, + lang/qt/src/qgpgmesignencryptjob.h, lang/qt/src/qgpgmesignjob.h, + lang/qt/src/qgpgmesignkeyjob.h, lang/qt/src/qgpgmetofupolicyjob.h, + lang/qt/src/qgpgmeverifydetachedjob.h, + lang/qt/src/qgpgmeverifyopaquejob.h, lang/qt/src/qgpgmewkdlookupjob.h, + lang/qt/src/qgpgmewkspublishjob.h, lang/qt/src/threadedjobmixin.h, + lang/qt/tests/t-support.h: Replace Q_DECL_OVERRIDE with override + + qt: Allow deferred start of import job. + + commit 398375a0ab3b819694435c2e46b759d56b3735e0 + * lang/qt/src/importjob.h (ImportJob::startLater): New pure virtual + method. + * lang/qt/src/qgpgmeimportjob.cpp, lang/qt/src/qgpgmeimportjob.h + (QGpgMEImportJob::startLater): New method. + + * lang/qt/tests/t-import.cpp (ImportTest::testDeferredStart): New. + +2023-01-04 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Support deferred start of jobs. + + commit 18c2c0b2509069951829bb0bdd9b39dc467f5e6e + * lang/qt/src/job.cpp, lang/qt/src/job.h (Job::startNow): New method. + * lang/qt/src/job_p.h (JobPrivate::start): New pure virtual method. + * lang/qt/src/qgpgmechangeexpiryjob.cpp + (QGpgMEChangeExpiryJobPrivate::start): New. + * lang/qt/src/qgpgmeencryptjob.cpp (QGpgMEEncryptJobPrivate::start): + New. + * lang/qt/src/qgpgmeimportjob.cpp (QGpgMEImportJobPrivate::start): New. + * lang/qt/src/qgpgmelistallkeysjob.cpp + (QGpgMEListAllKeysJobPrivate::start): New. + * lang/qt/src/qgpgmesignencryptjob.cpp + (QGpgMESignEncryptJobPrivate::start): New. + * lang/qt/src/threadedjobmixin.h (Thread::hasFunction): New method. + (ThreadedJobMixin::run, ThreadedJobMixin::setWorkerFunction): New + methods. + + qt: Explicitly instantiate private job classes. + + commit 270d7523001a57a59ea0be617d8e71d4363e0d50 + * lang/qt/src/Makefile.am: Add new files. + * lang/qt/src/changeexpiryjob_p.h, lang/qt/src/encryptjob_p.h, + lang/qt/src/importjob_p.h, lang/qt/src/listallkeysjob_p.h, + lang/qt/src/signencryptjob_p.h: New. + * lang/qt/src/changeexpiryjob.cpp, lang/qt/src/encryptjob.cpp, + lang/qt/src/importjob.cpp, lang/qt/src/listallkeysjob.cpp, + lang/qt/src/signencryptjob.cpp: Move JobPrivate subclasses to the new + private header files. + * lang/qt/src/job_p.h (jobPrivate): Remove lazy instantiation of private + job classes. + * lang/qt/src/qgpgmechangeexpiryjob.cpp (class + QGpgMEChangeExpiryJobPrivate): New. + (QGpgMEChangeExpiryJob::QGpgMEChangeExpiryJob): Instantiate private job + class. + * lang/qt/src/qgpgmeencryptjob.cpp (class + QGpgMEEncryptJobPrivate): New. + (QGpgMEEncryptJob::QGpgMEEncryptJob): Instantiate private job + class. + * lang/qt/src/qgpgmeimportjob.cpp (class + QGpgMEImportJobPrivate): New. + (QGpgMEImportJob::QGpgMEImportJob): Instantiate private job + class. + * lang/qt/src/qgpgmelistallkeysjob.cpp (class + QGpgMEListAllKeysJobPrivate): New. + (QGpgMEListAllKeysJob::QGpgMEListAllKeysJob): Instantiate private job + class. + * lang/qt/src/qgpgmesignencryptjob.cpp (class + QGpgMESignEncryptJobPrivate): New. + (QGpgMESignEncryptJob::QGpgMESignEncryptJob): Instantiate private job + class. + +2022-12-08 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Handle status errors in the base edit interactor. + + commit e7953dcf1376631719c73d9fa34bcb96752d3794 + * lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl): + Handle status errors. + * lang/cpp/src/gpgrevokekeyeditinteractor.cpp + (GpgRevokeKeyEditInteractor::Private::nextState): Remove handling of + status errors. + + cpp: Handle statuses that need no response in the base edit interactor. + + commit c419376b85ff4a489f3bf7ad97ed656495792523 + * lang/cpp/src/editinteractor.cpp (edit_interactor_callback_impl): Do + not call nextState() if status needs no response. + * lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp + (GpgAddExistingSubkeyEditInteractor::Private::nextState), + lang/cpp/src/gpgadduserideditinteractor.cpp + (GpgAddUserIDEditInteractor::nextState), + lang/cpp/src/gpggencardkeyinteractor.cpp + (GpgGenCardKeyInteractor::nextState), + lang/cpp/src/gpgrevokekeyeditinteractor.cpp + (GpgRevokeKeyEditInteractor::Private::nextState), + lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp + (GpgSetExpiryTimeEditInteractor::nextState), + lang/cpp/src/gpgsetownertrusteditinteractor.cpp + (GpgSetOwnerTrustEditInteractor::nextState), + lang/cpp/src/gpgsignkeyeditinteractor.cpp + (GpgSignKeyEditInteractor::nextState): Remove handling of statuses that + need no response. + +2022-12-06 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Write path values with Unix directory separators. + + commit d04d7b174fb7f27b7434cade22eafdd85b2d424e + * lang/qt/src/qgpgmenewcryptoconfig.cpp + (QGpgMENewCryptoConfigEntry::setURLValue): Remove conversion to native + directory separators. + +2022-11-25 NIIBE Yutaka <gniibe@fsij.org> + + gpgme.m4: Fix AM_PATH_GPGME_PTHREAD. + + commit f9cbf2c8a839d2c3df20157cfe65b67a4b0bcb5a + * src/gpgme.m4 (AM_PATH_GPGME_PTHREAD): It's deprecated, since gpgme + supports threads and GNU C library has integrated pthread features. + +2022-11-15 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Allow nullptr for key on card-edit. + + commit 5903fa454a47d788432192a7860b90b57efd6a10 + * src/edit.c (interact_start, edit_start): Return error if key is null + on edit-key. + +2022-11-15 NIIBE Yutaka <gniibe@fsij.org> + + gpgme.m4: Include _AM_PATH_GPGRT_CONFIG implementation. + + commit abd51848bdc8a5ea5929f9cfb819a408dc53d463 + * src/gpgme.m4 (_AM_PATH_GPGRT_CONFIG): New. + (_AM_PATH_GPGME_CONFIG): Require _AM_PATH_GPGRT_CONFIG. + + m4: Update gpg-error.m4. + + commit 2b7fcbf2f280ca88d76f8398138580155213552a + * m4/gpg-error.m4: Update from libgpg-error master. + +2022-11-11 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Check for nullptr. + + commit 6bcfbb3498f02dc86370cd4f2e3ccc5f9163d51a + * src/edit.c (interact_start, edit_start): Return error if key is null. + +2022-11-04 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Allow disabling automatic trust database check on key listing. + + commit b6593bda1f7bfaf6cf3b869b8379cbb2b619e00a + * lang/qt/src/Makefile.am (qgpgme_sources): Add listallkeysjob.cpp. + * lang/qt/src/listallkeysjob.cpp: New. + * lang/qt/src/listallkeysjob.h (enum ListAllKeysJob::Option, + typedef ListAllKeysJob::Options, ListAllKeysJob::setOptions, + ListAllKeysJob::options): New. + * lang/qt/src/qgpgmelistallkeysjob.cpp (list_keys): Set context flag + "no-auto-check-trustdb" if requested. + (QGpgMEListAllKeysJob::start, QGpgMEListAllKeysJob::exec): Add options + to call of list_keys. + + core: New context flag "no-auto-check-trustdb" + + commit 4f874ea431ba68ba70cf569741488502b1f61e66 + * src/context.h (gpgme_context): Add field no_auto_check_trustdb. + * src/gpgme.c (gpgme_set_ctx_flag, gpgme_get_ctx_flag): Add flag + "no-auto-check-trustdb". + * src/engine-gpg.c (engine_gpg): Add flags.no_auto_check_trustdb. + (gpg_set_engine_flags): Set the flag. + (build_argv): Pass option to gpg. + + * tests/run-keylist.c (show_usage, main): Add option --no-trust-check. + +2022-11-02 NIIBE Yutaka <gniibe@fsij.org> + + build: Update libassuan.m4. + + commit 9f5e11729260b814c4903e2fbccfb3855073abd2 + * m4/libassuan.m4: Update from libassuan master. + + build: Prefer gpgrt-config when available. + + commit 9f55dceca0cf2926d14cb4a70bd0cdc454d89f03 + * src/gpgme.m4: Overriding the decision by --with-gpgme-prefix, + use gpgrt-config gpgme when gpgrt-config is available. + +2022-10-26 Werner Koch <wk@gnupg.org> + + core: New global flags "inst-type". + + commit 1c9694f8d50b1236d2e4f2acbe23f972da36e437 + * src/gpgme.c (gpgme_set_global_flag): Add flag "inst-type". + * src/w32-util.c (_gpgme_set_get_inst_type): New. + (INST_TYPE_GPG4WIN_DIR): New. + (INST_TYPE_GPGDESK_DIR): New. + (_gpgme_get_gpgconf_path): Implement this flag. Replace fixed strings + by the macros. + * src/posix-util.c (_gpgme_set_get_inst_type): New dummy. + +2022-10-26 NIIBE Yutaka <gniibe@fsij.org> + + python: Fix configure generating setup.py. + + commit f1802682c3c8794edaca37966405bd1f070f5e01 + * lang/python/setup.py.in: Handle the case, when substitutions + may be empty. + +2022-10-24 Werner Koch <wk@gnupg.org> + + core: Protect against a theoretical integer overflow in parsetlv.c. + + commit 830e017e5d5f51d956d1188860302655f3e727e9 + * src/parsetlv.c (_gpgme_parse_tlv): Detect integer overflow. + +2022-10-24 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Allow setting the curve to use when generating ECC keys. + + commit d9ac1385950217893be6f0d6fdb3324b8647d16b + lang/cpp/src/gpggencardkeyinteractor.h (class GpgGenCardKeyInteractor): + Add enum Curve. Add member function setCurve. + lang/cpp/src/gpggencardkeyinteractor.cpp + (class GpgGenCardKeyInteractor::Private): Initialize simple members + in-class. Add member curve. + (GpgGenCardKeyInteractor::~GpgGenCardKeyInteractor): Use default d'tor. + (GpgGenCardKeyInteractor::setCurve): New. + (GpgGenCardKeyInteractor::action): Return curve defaulting to + Curve25519. + +2022-10-24 NIIBE Yutaka <gniibe@fsij.org> + + build: Update gpg-error.m4. + + commit d36905bb80c43987f2ca6980d3973d2111f89991 + * m4/gpg-error.m4: Update from libgpg-error 1.46. + +2022-10-14 Ingo Klöcker <dev@ingo-kloecker.de> + + build,qt: Check whether building with -fPIC is needed. + + commit 2ff09f474fb908dff83cce79c9d84b4fa21f5d7b + m4/qt6.m4: Use build test to check whether -fPIC is needed for building + a Qt application. + + build,qt: Fail check for Qt if moc wasn't found. + + commit 1792db58346cb39fd99332478d56dc190bae7836 + * m4/qt5.m4, m4/qt6.m4: Perform build test only if moc was found. + + build,qt: Always compile the Qt 6 test application with -fpic. + + commit f7a46714283bb8c107c68d0f1227abfe223b2365 + * m4/qt6.m4: Do not add -fpic to GPGME_QT6_CFLAGS. Add -fpic to CPPFLAGS + used for build test of simple Qt 6 application. + +2022-10-11 Ingo Klöcker <dev@ingo-kloecker.de> + + build,qt: Clean up all generated files. + + commit e6a1b241b4e6a0a677ed8f0e4e287a5cc82d7fbb + * lang/qt/src/Makefile.am (CLEANFILES): Add QGpgmeConfig-w32.cmake.in + and QGpgmeQt6Config-w32.cmake.in. + + qt,tests: Port test to QRegularExpression. + + commit b2fb26baeada7b39331f71a30c654bfb8b53cb30 + * lang/qt/tests/t-trustsignatures.cpp: Use QRegularExpression instead of + QRegExp. + + qt: Remove obsolete code. + + commit 4938c24a466bf05e707d3e6cbf759705adc7e8d6 + * lang/qt/src/qgpgmenewcryptoconfig.cpp (struct Select1St): Remove. + + build,qt: Allow building QGpgME for Qt 6. + + commit 8d019bbb8d40de2cbed7ad6d3367c6a46a561fab + * configure.ac: Look for Qt 5 and/or Qt 6. Require C++17 if Qt 6 binding + is built. Build cmake files QGpgmeConfig* for Qt 5 and QGpgmeQt6Config* + for Qt 6. + (available_languages): Add "qt5" and "qt6". + (WANT_QT5, WANT_QT6): New conditionals. + * lang/qt/src/Makefile.am: Keep building libqgpgme for Qt 5. Build + libqgpgmeqt6 for Qt 6. + * lang/qt/tests/Makefile.am: Build tests for Qt 5 or Qt 6. + * lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in, + lang/qt/src/QGpgmeQt6Config.cmake.in.in, + lang/qt/src/QGpgmeQt6ConfigVersion.cmake.in, m4/qt6.m4: New. + +2022-10-10 Ingo Klöcker <dev@ingo-kloecker.de> + + build,qt: Explicitly namespace a few Qt variables for Qt5. + + commit 8e908029ffa03d21662030d3111dcf556b722e1a + m4/qt.m4: Rename to + m4/qt5.m4: this. + (FIND_QT): Rename to FIND_QT5. + (GPGME_QT): Change variable prefix to GPGME_QT5. + (GPGME_QTTEST: Change variable prefix to GPGME_QT5TEST. + configure.ac, lang/qt/src/Makefile.am, lang/qt/tests/Makefile.am: + Adjust accordingly. + +2022-09-29 Werner Koch <wk@gnupg.org> + + core: Fix SIG_CREATED status parsing for 0x1F sigs. + + commit b1e5f3b183104a58d71821b7dbe44244d1c3f87f + * src/sign.c (parse_sig_created): Special case the rfc4880 "1F" status. + +2022-09-15 NIIBE Yutaka <gniibe@fsij.org> + + build:python: Don't use gpg-error-config/gpgme-config. + + commit ae9258fbf3b9d434495ef11fc184a91fe7c4ca57 + * lang/python/setup.py.in: Use @prefix@, @GPGME_CONFIG_LIBS@, + @GPGME_CONFIG_CFLAGS@, and @GPG_ERROR_CFLAGS@ of configure. + + Fix for modern compiler. + + commit fbd94076461ec55603d741121fa2ff6a861ea803 + * src/argparse.c (show_version): It's no args. + +2022-09-14 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Reject signing expired keys. + + commit eedaaf70167f5dd7d8438235139b57527d3a961b + * lang/cpp/src/gpgsignkeyeditinteractor.cpp (enum SignKeyState): Add + new state REJECT_SIGN_EXPIRED. + (makeTable): Add entries for new state to transition map. + (GpgSignKeyEditInteractor::action): Handle new state. + +2022-09-07 NIIBE Yutaka <gniibe@fsij.org> + + Fix parsing import status for invalid fingerprint. + + commit 80670f60ba971145dd6792e00d31c08c10cc8159 + * src/import.c (parse_import): Handle invalid fingerprint case. + +2022-08-22 Ingo Klöcker <dev@ingo-kloecker.de> + + build: Omit -I... and -L... for standard paths in pkgconfig file. + + commit 1522813888257aafb6d108b49fb7b24005d2693a + * configure.ac (GPGME_CONFIG_CFLAGS): Prefix with -I${includedir} for + non-standard include paths. + (GPGME_CONFIG_LIBS): Prefix with -L${libdir} for non-standard library + paths. + * src/gpgme.pc.in (Cflags): Remove hard-coded -I${includedir}. + (Libs): Remove hard-coded -L${libdir}. + + build: Update ax_cxx_compile_stdcxx macro. + + commit 73e96bfaa8176cf7b18bfa9edacaaf8d26989998 + * m4/ax_cxx_compile_stdcxx.m4: Replace with current version from the + autoconf archive. + + qt: Fix building with C++11. + + commit 83176ad7d3e57ad7804d3c885e1b4fcd1d4d96f9 + * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp + (QGpgMERefreshSMIMEKeysJob::start): Replace 'auto' in lambda with the + actual type. + * lang/qt/src/qgpgmesignkeyjob.cpp (class TrustSignatureProperties): Add + default c'tor and c'tor initializing all members. + * lang/qt/src/util.cpp (toFingerprints): Replace 'auto' in lambda with + the actual type. + * lang/qt/tests/run-exportjob.cpp (createExportJob): Replace 'auto' + return type with actual type. + + qt: Fix building with Qt6. + + commit 05661806848b8a6ef9005e4a420d8613ddc868f1 + * lang/qt/src/util.cpp, lang/qt/src/util.h: Replace forward declaration + with include. + +2022-08-19 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Fix building with C++11. + + commit f02c20cc9c5756690b07abfd02a43533547ba2ef + * lang/cpp/src/importresult.cpp (ImportResult::mergeWith): Replace + 'auto' in lambdas with the actual type. + +2022-08-18 Ingo Klöcker <dev@ingo-kloecker.de> + + qt,tests: Make test pass on 32-bit systems. + + commit 2e7a61b898fccc1c20000b79dee83cd980901fa9 + * lang/qt/tests/t-addexistingsubkey.cpp + (AddExistingSubkeyJobTest::testAddExistingSubkeyWithExpiration): Handle + negative expiration date. + + cpp: Fix handling of "no key" or "invalid time" situations. + + commit 2fa5c80aeba4528b3bdf41ec5740e7db5d4b6d2b + * lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp + (GpgAddExistingSubkeyEditInteractor::Private::nextState): Fix inverted + logic of string comparisons. + +2022-08-17 Ingo Klöcker <dev@ingo-kloecker.de> + + qt,tests: Make sure expiration time is interpreted as unsigned number. + + commit f2b48de26b8f8c48c293423eda712831544924f6 + * lang/qt/tests/t-addexistingsubkey.cpp, + lang/qt/tests/t-changeexpiryjob.cpp: Convert expiration time to + uint_least32_t. + + qt,tests: Log the actual error code if the assertion fails. + + commit 81d4b7f2d7077297d76af5728949d8f2bdff8cd5 + * lang/qt/tests/t-addexistingsubkey.cpp ( + AddExistingSubkeyJobTest::testAddExistingSubkeyAsync, + AddExistingSubkeyJobTest::testAddExistingSubkeySync, + AddExistingSubkeyJobTest::testAddExistingSubkeyWithExpiration): Use + QCOMPARE instead of QVERIFY for asserting equality. + + qt: Make sure expiration time is interpreted as unsigned number. + + commit c977424a1d39751fc5055131ad3f7819d421dcc8 + * lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp (add_subkey): Convert + expiration time to uint_least32_t. + +2022-08-12 Andre Heinecke <aheinecke@gnupg.org> + + w32: Add another fallback to look for gpgconf.exe. + + commit 5f51a9b4589200486b2833124cbd93455f6ce208 + * src/w32-util.c (_gpgme_get_gpgconf_path): Add fallback for + GnuPG VS-Desktop install scheme. + +2022-08-11 Andre Heinecke <aheinecke@gnupg.org> + + Qt: Fix working with no gpgconf in CryptoConfig. + + commit 586846209b08ce5e9545f53f21de884eb4079115 + * lang/qt/src/cryptoconfig.cpp (CryptoConfig::entry): Add nullptr + checks. + +2022-08-10 Werner Koch <wk@gnupg.org> + + Release 1.18.0. + + commit 26ff163bd6912fa7e8cb522d0799e17095ac1efb + + + tests: Make t-edit-sign more robust. + + commit 9ee74b68e688b474881768a5ae59d857397c8fbf + * tests/gpg/t-edit-sign.c (interact_fnc): Provide the default answer. + +2022-08-10 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Add missing include. + + commit 5d91182c955d128c8ff7cdd29189fc3ae06201d9 + * lang/qt/tests/t-revokekey.cpp: Include QDebug. + +2022-08-09 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Add job to set the primary user ID of OpenPGP keys. + + commit db7d79063f57c6e0ccf382fdf1cf47d514e12f6e + * lang/qt/src/qgpgmesetprimaryuseridjob.cpp, + lang/qt/src/qgpgmesetprimaryuseridjob.h, + lang/qt/src/setprimaryuseridjob.h: New. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function setPrimaryUserIDJob. + * lang/qt/src/protocol_p.h (Protocol::setPrimaryUserIDJob): New. + * lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly. + + * lang/qt/tests/t-setprimaryuserid.cpp: New. + * lang/qt/tests/Makefile.am: Add new test. + + cpp: Add support for gpgme_op_set_uid_flag. + + commit 125867f268f2a49ff060a7adc859500500b77025 + * lang/cpp/src/context.cpp, lang/cpp/src/context.h + (Context::setPrimaryUid, Context::startSetPrimaryUid): New. + +2022-08-09 NIIBE Yutaka <gniibe@fsij.org> + + python: Don't call __del__ from __exit__ method. + + commit f8d99bb9e4a7f6229c19c4fbd951ccad6fa97bde + * lang/python/src/core.py (Context, Data): Don't call __del__ + from __exit__ method, as the object may be still in use. + * lang/python/tests/t-idiomatic.py: Fix the test. + +2022-08-05 NIIBE Yutaka <gniibe@fsij.org> + + python: Don't access gpgme with wrapped=None. + + commit 180899c7c313335128606bfff738da00dce4f5c9 + * lang/python/src/core.py (GpgmeWrapper, Context): Check self.wrapped + is valid. + +2022-08-05 Jasper Spaans <jasper@startmail.com> + + python: Reset passphrase callback correctly. + + commit b2f224a471fecce566443bf0f0e554de6f567f4e + * lang/python/src/core.py (Context(GpgmeWrapper)): Reset passphrase + callback correctly, for encrypt, decrypt, create_key, and + create_subkey methods. + +2022-08-04 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Remove job for refreshing OpenPGP keys. + + commit c3b183831db5a2a490ba49bf4804730679eb59d0 + * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp, + lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, + lang/qt/src/refreshopenpgpkeysjob.h: Remove. + * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. + * lang/qt/src/protocol.h (class Protocol): Remove pure virtual member + function refreshOpenPGPKeysJob. + * lang/qt/src/protocol_p.h (Protocol::refreshOpenPGPKeysJob): Remove. + + * lang/qt/tests/run-refreshkeysjob.cpp (main): Use ReceiveKeysJob for + OpenPGP keys. + +2022-07-21 NIIBE Yutaka <gniibe@fsij.org> + + build: Update config.guess and config.sub. + + commit cc37447b625b45efb5c94c40461084460f03f24a + * build-aux/config.guess: Update from upstream. + * build-aux/config.sub: Ditto. + + build: Fix for modern Autoconf. + + commit 16020c5fd96427961734c4a8f5b2b5e901b1bb60 + * m4/glib-2.0.m4: Use AC_RUN_IFELSE and AC_LINK_IFELSE. + +2022-07-05 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Allow setting the file name of signed and encrypted data. + + commit 5436b309fe67dd3c4531f751d99c98128ca66e4d + * lang/qt/src/Makefile.am (qgpgme_sources): Add signencryptjob.cpp. + * lang/qt/src/signencryptjob.cpp: New. + * lang/qt/src/signencryptjob.h (class SignEncryptJob): Add member + functions setFileName, fileName. + * lang/qt/src/qgpgmesignencryptjob.cpp (sign_encrypt): Set file name of + input. + (sign_encrypt_qba, QGpgMESignEncryptJob::exec, + QGpgMESignEncryptJob::start): Pass file name to sign_encrypt resp. + sign_encrypt_qba. + + qt: Allow setting the file name of encrypted data. + + commit bc10169724d2806b38f91beff39ef637b5e52b8d + * lang/qt/src/Makefile.am (qgpgme_sources): Add encryptjob.cpp. + * lang/qt/src/encryptjob.cpp: New. + * lang/qt/src/encryptjob.h (class EncryptJob): Add member functions + setFileName, fileName. + * lang/qt/src/qgpgmeencryptjob.cpp (encrypt): Set file name of input. + (encrypt_qba, QGpgMEEncryptJob::exec, QGpgMEEncryptJob::start): Pass + file name to encrypt resp. encrypt_qba. + +2022-07-04 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Fix filename of cmake config files for w32. + + commit 31423945d214292f24dd1f700cd8ab53722dd1eb + * lang/qt/src/Makefile.am (EXTRA_DIST): Add + QGpgmeConfig-w32.cmake.in.in. + +2022-07-04 Laurent Montel <montel@kde.org> + + qt: Add #include <QStringList> needed for building against qt6. + + commit d42323f90213157a5e847bfa89bee55a29ee8df0 + * lang/qt/src/downloadjob.h, lang/qt/src/exportjob.h, + lang/qt/src/keylistjob.h lang/qt/src/refreshkeysjob.h: in qt6 we need + to use #include <QStringList> + +2022-06-30 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Remove obsolete compatibility with KF5 variants. + + commit 6e45da30ae787dd45836e55d34f7aa4e001b641c + * lang/cpp/src/GpgmeppConfig-w32.cmake.in.in, + lang/cpp/src/GpgmeppConfig.cmake.in.in: Remove find_package() call. + +2022-06-28 NIIBE Yutaka <gniibe@fsij.org> + + build: When no gpg-error-config, not install gpgme-config. + + commit 02a2f350359013bf33c3957e95c98726273ced8c + * configure.ac (USE_GPGRT_CONFIG): New. + * src/Makefile.am USE_GPGRT_CONFIG: Conditionalize the install + of gpgme-config. + + build: Update gpg-error.m4. + + commit aa94b4cee5aabfa9097abd4560fdf002516db82a + * m4/gpg-error.m4: Update from libgpg-error. + +2022-06-14 Ingo Klöcker <dev@ingo-kloecker.de> + + tests: Add support for clear text signatures to test runner. + + commit d59cf1725755f24e79a0ce12ddc59fedc97292c6 + * tests/run-sign.c (show_usage): Add new argument "--clear". + (main): Handle new argument "--clear". + +2022-06-10 Ingo Klöcker <dev@ingo-kloecker.de> + + qt,tests: Allow 1-day-offset for expiration date. + + commit fd813f5c3938423137db1fcb02c3c527bd9f58c6 + * lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithExpiration): + Assert that the expiration date is either 2106-02-05 or 2106-02-04. + + qt: Prevent u32 overflow when calculating expiration date. + + commit 7870fdbfeff47755138136dbd6648b18f6b4fc76 + * lang/qt/src/qgpgmesignkeyjob.cpp (sign_key): Change maxAllowedDate to + 2106-02-05. Change log-level from warning to debug. + * lang/qt/tests/t-various.cpp (TestVarious::testSignKeyWithExpiration): + Remove check for warning. Adapt assertion. + +2022-06-09 Ingo Klöcker <dev@ingo-kloecker.de> + + Revert "tests: Avoid problems with local time across a day boundary." + + commit 918afc809d40e057266ced6dfc98a5b3e5b4d3ee + This reverts commit 5ba0e454a37c9b0d3badddfc2dad8bcc7c7af874. + + core: Handle import status lines during keylist operation. + + commit 5d19eb4ad5ad9e93c34bf9b03ed6f583c6bf8491 + * src/keylist.c (gpgme_op_keylist_from_data_start): Call + _gpgme_op_import_init_result. + +2022-05-12 Andre Heinecke <aheinecke@gnupg.org> + + cpp: Export KeyListModeSaver. + + commit f3011b5a1918dbe9d2b1316707a2c1034c847507 + * lang/cpp/src/context.h (Context::KeyListModeSaver): Add Export. + +2022-05-06 Ingo Klöcker <dev@ingo-kloecker.de> + + core: Set SECRET flag of subkeys stored on smart cards. + + commit f72cf726ca749a138a8950b02c51e7b3a50c6a83 + * src/keylist.c (parse_sec_field15): Set SECRET flag. + +2022-05-05 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Output more properties of a subkey. + + commit 306fd9c915cbccddbd146f37ba9bd826f10d2535 + * lang/cpp/src/key.cpp (ostream operator<< for Subkey): Fix wrong output + of isInvalid and isDisabled flags. Add output of key grip, card serial + number and the flags isSecret, isQualified, isDeVs, and isCardKey. + + cpp,tests: Actually parse the --with-secret option. + + commit e029fd27350fcbda1b4689bc557e996d749d78ac + * lang/cpp/tests/run-keylist.cpp (main): Handle --with-secret option. + Print error for unknown option. + + qt: Revert change of result signal of RefreshKeysJob. + + commit 9e8c8e448ec83c454fb310f80ce0bf9f828a7145 + * lang/qt/src/refreshkeysjob.h (RefreshKeysJob::result): Remove optional + parameters auditLogAsHtml and auditLogError. + * lang/qt/tests/run-refreshkeysjob.cpp (main): Update accordingly. + + qt: Use lambda instead of std::bind. + + commit 15a4940aa73019bce002302b14aaa73312da3df4 + * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp + (QGpgMERefreshOpenPGPKeysJob::start): Replace std::bind call with a + lambda. + +2022-05-04 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Emit import result when refreshing OpenPGP keys. + + commit c64a8daf507a2216611861a12f312466b0bae8b2 + * lang/qt/src/refreshopenpgpkeysjob.h: New. + * lang/qt/src/Makefile.am, lang/qt/src/job.cpp: Update accordingly. + * lang/qt/src/qgpgmerefreshopenpgpkeysjob.h (class + QGpgMERefreshOpenPGPKeysJob): Derive from RefreshOpenPGPKeysJob with + result ImportResult. Remove unused start overload. + * lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp (locate_external_keys): + Ignore result of KeyListJob. Return import result. + (receive_keys): Return import result. + (refresh_keys): Merge the two import results and return the result. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function refreshOpenPGPKeysJob. + * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Return nullptr + for OpenPGP protocol. + (Protocol::refreshOpenPGPKeysJob): New. + + * lang/qt/tests/run-refreshkeysjob.cpp (main): Use appropriate job + for the protocol of the key to refresh. + + cpp: Allow retrieving import result of key listing with locate mode. + + commit 3519d6117332f25b601c9c0636878baf4e8cf55b + * lang/cpp/src/context_p.h (enum Context::Private::Operation): Add + value KeyListWithImport. + * lang/cpp/src/context.cpp (Context::startKeyListing, Context::nextKey): + Set lastop to KeyListWithImport if keylist mode includes Locate. + + core: Handle import status lines during keylist operation. + + commit f3ca57dfd7af19f9b2fd01616a81dc889707a4d3 + * src/import.c (import_status_handler): Rename to ... + (_gpgme_import_status_handler): this. Make non-static. + (_gpgme_op_import_init_result): New. + (_gpgme_op_import_start, _gpgme_op_import_keys_start, + _gpgme_op_receive_keys_start): Call _gpgme_op_import_init_result. + * src/keylist.c (keylist_status_handler): Call + _gpgme_import_status_handler to handle import status lines. + (gpgme_op_keylist_start, gpgme_op_keylist_ext_start): Call + _gpgme_op_import_init_result. + * src/ops.h (_gpgme_op_import_init_result, + _gpgme_import_status_handler): New prototypes. + + cpp: Allow merging the results of two imports. + + commit d911a1536488a5645f257a48b4d9cf221c0ed6b6 + * lang/cpp/src/importresult.h, lang/cpp/src/importresult.cpp (class + ImportResult): Add member function mergeWith. + +2022-05-02 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Apply compiler hint. + + commit f1a354fd57d6cc9e34ff33ea60aa4ef0aca382a3 + * lang/qt/tests/t-verify.cpp (VerifyTest::testSignatureKey): Use + reference type to prevent copying. + + qt: Use GpgME::Locate alias. + + commit 540e7bf3d457a78497b6b7ac33b486b3c5b50857 + * lang/qt/src/protocol_p.h (Protocol::locateKeysJob): Use Locate alias + instead of Extern|Local. + * lang/qt/src/qgpgmekeyformailboxjob.cpp (do_work): Ditto. + + qt: Add job for refreshing OpenPGP keys. + + commit e12861f18c6b431b40bfa78eb6f1d149690a5fcd + * lang/qt/src/qgpgmerefreshopenpgpkeysjob.h, + lang/qt/src/qgpgmerefreshopenpgpkeysjob.cpp: New. + * lang/qt/src/Makefile.am: Add new files. + * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Add support for + OpenPGP protocol. + + cpp: Add RAII class for saving/restoring the key list mode. + + commit 34786132fed0a776d4cd314c44ed62e29ff75328 + * lang/cpp/src/context.h, lang/cpp/src/context.cpp (class Context): + Add nested class KeyListModeSaver. + + qt: Add debug helper for Result classes with output stream operator. + + commit 99fd565889f3d22459ff82296b206fa228a4c468 + * lang/qt/src/util.h (toLogString): New. + + qt: Factor out helper for getting the fingerprints of some keys. + + commit 0c304beeaab54dc25a8572270704fd5fa90cf836 + * lang/qt/src/util.h, lang/qt/src/util.cpp (toFingerprints): New. + * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: Use the helper. + +2022-04-29 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Fix connection to readyReadStandardOutput signal. + + commit 54c4fd16d1832fcce05aa9e471a4acebff0e3269 + * lang/qt/src/qgpgmerefreshsmimekeysjob.h, + lang/qt/src/qgpgmerefreshsmimekeysjob.cpp + (QGpgMERefreshSMIMEKeysJob::slotStderr): Remove. + * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp + (QGpgMERefreshSMIMEKeysJob::startAProcess): Handle + readyReadStandardOutput and readyReadStandardError signals with lambdas. + + qt: Add test runner for refresh job. + + commit 9686258bd16707a5e1eb292262a6c28faa581c34 + * lang/qt/tests/run-refreshkeysjob.cpp: New. + * lang/qt/tests/Makefile.am (run_refreshkeysjob_SOURCES): New. + (noinst_PROGRAMS): Add new build artifact. + + qt: Make RefreshKeysJob result compatible with standard job result. + + commit f4c35609257156d0e32b8dd7315011b484919f05 + * lang/qt/src/refreshkeysjob.h (RefreshKeysJob::result): Add optional + parameters auditLogAsHtml and auditLogError. + + qt: Allow refreshing a list of keys. + + commit fd97cbaa44b8e7914089319afac1e776c9a64283 + * lang/qt/src/refreshkeysjob.h (class RefreshKeysJob): Add pure virtual + member function start taking a list of keys. + * lang/qt/src/qgpgmerefreshsmimekeysjob.h, + lang/qt/src/qgpgmerefreshsmimekeysjob.cpp (class + QGpgMERefreshSMIMEKeysJob): Implement new member function. + + qt: Minor refactoring. + + commit 62e770971786f272ecc079b78b11e798ec699d77 + * lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: Use namespace QGpgME. + + qt: Rename QGpgMERefreshKeysJob to QGpgMERefreshSMIMEKeysJob. + + commit f47bc992ae6ca6a9043d4de5bfc10179e4676256 + * lang/qt/src/qgpgmerefreshkeysjob.h, + lang/qt/src/qgpgmerefreshkeysjob.cpp: Change name to + * lang/qt/src/qgpgmerefreshsmimekeysjob.h, + lang/qt/src/qgpgmerefreshsmimekeysjob.cpp: ... this, and adapt the + include guard. + (class QGpgMERefreshKeysJob): Rename to QGpgMERefreshSMIMEKeysJob. + * lang/qt/src/Makefile.am: Adapt mentioned file names accordingly. + * lang/qt/src/protocol_p.h (Protocol::refreshKeysJob): Use renamed + class. + +2022-04-28 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp,tests: Verify that requested keylist mode is used. + + commit 359906c8bcde7e351540708777e3678fee0cc2c1 + * lang/cpp/tests/run-getkey.cpp, lang/cpp/tests/run-keylist.cpp (main): + Check used keylist mode. + +2022-04-27 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Support new keylist modes. + + commit dea872f21ff77cd58bafe0966d89d6331c8d2e07 + * lang/cpp/src/global.h (ForceExtern, LocateExternal, KeyListModeMask): + New. + * lang/cpp/src/context.cpp (operator<<): Add check. + * lang/cpp/src/util.h (gpgme_keylist_mode_t, + convert_from_gpgme_keylist_mode_t): Handle ForceExtern. + * lang/cpp/tests/run-getkey.cpp (show_usage, main): Add arguments + --force-extern and --locate-external. + * lang/cpp/tests/run-keylist.cpp (show_usage, main): Ditto. + + core: Support --locate-external-keys command of gpg. + + commit aff9aaac68450e76f84d0f9a3feabffe9e82dd7e + * src/gpgme.h.in (GPGME_KEYLIST_MODE_FORCE_EXTERN): New. + (GPGME_KEYLIST_MODE_LOCATE_EXTERNAL): New. + * src/gpgme.c (gpgme_set_keylist_mode): Check for invalid mode. + * src/engine-gpg.c (gpg_keylist_build_options): Use + "--locate-external-keys" instead of "--locate-keys" if flag is set. + * src/gpgme-json.c (op_keylist): New flag "force-extern". + * src/gpgme-tool.c (gt_get_keylist_mode, cmd_keylist_mode): Handle + new mode. + +2022-04-25 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Rely on the bad passphrase error reported by gpg. + + commit 512f11b458d82bb8a42b5764f11e11978173f896 + * lang/qt/src/qgpgmedecryptverifyjob.cpp (patch_decryption_result): + Removed. + (decrypt_verify): Remove usage of patch_decryption_result. + + core: Return BAD_PASSPHRASE error code on symmetric decryption. + + commit e21c3b559dfb59c61f789572071e72e31bb089bf + * src/decrypt.c (op_data_t): Add field symdecrypt_failed. + (parse_status_error): Handle BAD_PASSPHRASE error code. + (_gpgme_decrypt_status_handler): Consult new field. + +2022-04-22 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Report better error if decryption failed because of bad passphrase. + + commit d8e5871dca9425811873058150677a158235613d + * lang/qt/src/qgpgmedecryptverifyjob.cpp (patch_decryption_result): New. + (decrypt_verify): Call patch_decryption_result. + + cpp: Allow changing the error of a result. + + commit 321c8a0254f4729ff1ffe56956fb049555272321 + * lang/cpp/src/result.h (class Result): Add member function setError. + +2022-04-05 Ingo Klöcker <dev@ingo-kloecker.de> + + cpp: Handle canceling of an edit operation. + + commit 28cdbfdccb347e1ef15f794d4afd36f9275f073c + * lang/cpp/src/editinteractor.cpp + (CallbackHelper::edit_interactor_callback_impl): Check for error _or_ + canceled state. + + cpp: Return actual error if revocation fails. + + commit db532eca8ebd64536985e7a40af22e803e3b3df9 + * lang/cpp/src/editinteractor.cpp, lang/cpp/src/editinteractor.h + (EditInteractor::parseStatusError): New. + * lang/cpp/src/gpgrevokekeyeditinteractor.cpp + (GpgRevokeKeyEditInteractor::Private::nextState): Handle status + error. + + cpp: Add internal utility function for splitting strings. + + commit c965b45bcd915ce92943fd4d436b5bd790f0442f + * lang/cpp/src/util.h (split): New. + + cpp: Do not export symbols of the Private class. + + commit 4beb6f419954b0df475d88bef7fc8b8065848b75 + * lang/cpp/src/gpgrevokekeyeditinteractor.h (class + GpgRevokeKeyEditInteractor): Mark nested class Private as hidden. + +2022-04-05 NIIBE Yutaka <gniibe@fsij.org> + + core: Don't use internal __assuan functions. + + commit a36d71a8e33e817b1cc2fde5d0fd476ddc6ac560 + * configure.ac (nanosleep): Detect. + * src/assuan-support.c: Don't use __assuan_usleep. + (my_socketpair): Don't use __assuan_socketpair. + + core: Don't keep using deprecated ath_ API. + + commit 110a375401878b72984241c0dd84cb7fdeaae795 + * src/posix-io.c: Don't include ath.h. + (_gpgme_io_read): Call read directly. + (_gpgme_io_write): Call write directly. + (_gpgme_io_waitpid): Call waitpid directly. + (_gpgme_io_select_select): Call select directly. + (_gpgme_io_recvmsg): Call recvmsg directly. + (_gpgme_io_sendmsg): Call sendmsg directly. + (_gpgme_io_connect): Call connect directly. + * src/assuan-support.c: Don't include ath.h. + (my_waitpid): Call waitpid directly. + +2022-03-31 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Check arguments passed to the revoke key job. + + commit 7f089165e3ae42274e75e0e6fa1c45ca641f4023 + * lang/qt/src/qgpgmerevokekeyjob.cpp (check_arguments): New. + (QGpgMERevokeKeyJob::start, QGpgMERevokeKeyJob::exec): Call + check_arguments. + * lang/qt/tests/t-revokekey.cpp (RevokeKeyJobTest): Add member functions + testErrorHandling_nullKey, testErrorHandling_invalidReason, + testErrorHandling_invalidDescription. + +2022-03-30 Ingo Klöcker <dev@ingo-kloecker.de> + + qt,tests: Verify reason code and description of revocation. + + commit 3856ae8621bb28873123578a64eb81a4a591758e + * lang/qt/tests/t-revokekey.cpp (RevokeKeyJobTest::testRevokeKeyAsync, + RevokeKeyJobTest::testRevokeKeySync_noReasonDescription, + RevokeKeyJobTest::testRevokeKeySync_oneLineReasonDescription, + RevokeKeyJobTest::testRevokeKeySync_twoLinesReasonDescription): Call + verifyReason. + (class RevokeKeyJobTest): Add private member function verifyReason. + + qt: Add job to revoke own OpenPGP keys. + + commit 41297520da32081d0a34ac2799812f210b7a9335 + * lang/qt/src/revokekeyjob.h, lang/qt/src/qgpgmerevokekeyjob.h, + lang/qt/src/qgpgmerevokekeyjob.cpp: New. + * lang/qt/src/protocol.h (class Protocol): Add pure virtual member + function revokeKeyJob. + * lang/qt/src/protocol_p.h (Protocol::revokeKeyJob): New. + * lang/qt/src/job.cpp, lang/qt/src/Makefile.am: Update accordingly. + + * lang/qt/tests/Makefile.am (the_tests, moc_files, noinst_PROGRAMS): + Add new test. + (t_revokekey_SOURCES): New. + * lang/qt/tests/t-revokekey.cpp: New. + + cpp: Add interactor to revoke a key. + + commit d96e8a7a6bfcaad4587dd2bb648aa764b0d4e1ba + * lang/cpp/src/global.h (enum class RevocationReason): New. + * lang/cpp/src/gpgrevokekeyeditinteractor.cpp, + lang/cpp/src/gpgrevokekeyeditinteractor.h: New. + * lang/cpp/src/Makefile.am: Add new files. + +2022-03-28 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Set default visibility of all symbols to hidden. + + commit 3b3b36a60749ea5c3b166bb1c8f3f6dda8ce6fcd + * configure.ac: Add -fvisibility=hidden to GPGME_QT_CFLAGS if gcc + supports the flag. + + cpp: Set default visibility of all symbols to hidden. + + commit fe588fef0963987b5624dc8c4bc73202ac2c9298 + * configure.ac: Add -fvisibility=hidden to GPGME_CPP_CFLAGS if gcc + supports the flag. + * lang/cpp/src/Makefile.am (AM_CPPFLAGS): Add GPGME_CPP_CFLAGS. + * m4/ax_gcc_func_attribute.m4: New. + + cpp: Put local helper function into unnamed namespace. + + commit 92139e7b6b5fe84015d44d9516f3e1df7a3fc3bc + lang/cpp/src/context.cpp (to_auditlog_flags): Wrap in unnamed namespace. + +2022-03-16 NIIBE Yutaka <gniibe@fsij.org> + + core: Support keylist mode for op_keylist_from_data. + + commit b2a2158384a9f048ff61ee0cebef8346055f0454 + * src/engine-backend.h (keylist_data): Add MODE argument. + * src/engine-gpg.c (gpg_keylist_data): Add MODE argument. + * src/engine.c (_gpgme_engine_op_keylist_data): Likewise. + * src/engine.h (_gpgme_engine_op_keylist_data): Declaration. + * src/keylist.c (gpgme_op_keylist_from_data_start): Call + _gpgme_engine_op_keylist_data with ctx->keylist_mode. + +2022-03-07 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Add missing include of config.h. + + commit 55861ba9ccc6b1087cb81acd93bed81fc0787208 + * lang/qt/src/util.cpp: Include config.h. + +2022-03-06 Werner Koch <wk@gnupg.org> + + Post release updates. + + commit f61a14f189d33ca320f6c4ee6323f1e48c46e4ea + + + Release 1.17.1. + + commit ee50a38823daaa16b151a549a7dafef34bbd1e81 + * configure.ac: Bump QT LT version to C15/A0/R0. + +2022-02-17 Ingo Klöcker <dev@ingo-kloecker.de> + + qt: Fix ABI compatibility with 1.16.0. + + commit ad3aabdd8a64156c7e3a75d695ae1ab2c4bec841 + * lang/qt/src/protocol.h (class Protocol): Move new virtual methods to + the end of the class. + 2022-02-07 Werner Koch <wk@gnupg.org> Release 1.17.0.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/Makefile.am
Changed
@@ -38,6 +38,8 @@ ChangeLog-2011 m4/ChangeLog-2011 \ conf/whatisthis VERSION LICENSES +# This artificial line is to put a dependency to conf/config.h for 'all' +BUILT_SOURCES = conf/config.h if RUN_GPG_TESTS tests = tests
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ @@ -293,10 +295,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -306,6 +313,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -458,6 +466,9 @@ ChangeLog-2011 m4/ChangeLog-2011 \ conf/whatisthis VERSION LICENSES + +# This artificial line is to put a dependency to conf/config.h for 'all' +BUILT_SOURCES = conf/config.h @RUN_GPG_TESTS_FALSE@tests = @RUN_GPG_TESTS_TRUE@tests = tests SUBDIRS = src ${tests} doc lang @@ -465,7 +476,8 @@ # Macro to help the release target. RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION) -all: all-recursive +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: am--refresh: Makefile @@ -833,12 +845,15 @@ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am -check: check-recursive +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: -install: install-recursive -install-exec: install-exec-recursive +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-recursive +install-exec: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive @@ -867,6 +882,7 @@ maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-recursive clean-am: clean-generic clean-libtool mostlyclean-am @@ -937,7 +953,8 @@ uninstall-am: -.MAKE: $(am__recursive_targets) install-am install-strip +.MAKE: $(am__recursive_targets) all check install install-am \ + install-exec install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/NEWS -> _service:tar_scm:gpgme-1.21.0.tar.bz2/NEWS
Changed
@@ -1,3 +1,241 @@ +Noteworthy changes in version 1.21.0 (2023-07-07) +------------------------------------------------- + + * Extended gpgme_op_encrypt, gpgme_op_encrypt_sign, and gpgme_op_sign + to allow writing the output directly to a file. T6530 + + * Extended gpgme_op_decrypt and gpgme_op_verify to allow reading the + input data directly from files. T6530 + + * For key signing and uid revoking allow an empty user id. + rMfbc3963d62 + + * Pass an input-size-hint also to the gpgsm engine. T6534 + + * qt: Allow writing the created archives directly to a + file. T6530 + + * qt: Allow reading the signed/encrypted archive to decrypt + or verify directly from a file. T6530 + + * qt: Qt Jobs working with QIODeviceDataProvider now properly + handle input-size hints and progress for files larger. + 2^32 bytes in 32 bit builds. T6534 + + * cpp: Error::isCanceled now also returns true for error code + GPG_ERR_FULLY_CANCELED. T6510 + + * python: Fix wrong use of write. T6501 + + * Interface changes relative to the 1.20.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + cpp: Data::setFlag NEW. + cpp: Data::setSizeHint NEW. + qt: Job::startIt NEW. + qt: DecryptVerifyArchiveJob::setInputFile NEW. + qt: DecryptVerifyArchiveJob::inputFile NEW. + qt: EncryptArchiveJob::setRecipients NEW. + qt: EncryptArchiveJob::recipients NEW. + qt: EncryptArchiveJob::setInputPaths NEW. + qt: EncryptArchiveJob::inputPaths NEW. + qt: EncryptArchiveJob::setOutputFile NEW. + qt: EncryptArchiveJob::outputFile NEW. + qt: EncryptArchiveJob::setEncryptionFlags NEW. + qt: EncryptArchiveJob::encryptionFlags NEW. + qt: SignArchiveJob::setSigners NEW. + qt: SignArchiveJob::signers NEW. + qt: SignArchiveJob::setInputPaths NEW. + qt: SignArchiveJob::inputPaths NEW. + qt: SignArchiveJob::setOutputFile NEW. + qt: SignArchiveJob::outputFile NEW. + qt: SignEncryptArchiveJob::setSigners NEW. + qt: SignEncryptArchiveJob::signers NEW. + qt: SignEncryptArchiveJob::setRecipients NEW. + qt: SignEncryptArchiveJob::recipients NEW. + qt: SignEncryptArchiveJob::setInputPaths NEW. + qt: SignEncryptArchiveJob::inputPaths NEW. + qt: SignEncryptArchiveJob::setOutputFile NEW. + qt: SignEncryptArchiveJob::outputFile NEW. + qt: SignEncryptArchiveJob::setEncryptionFlags NEW. + qt: SignEncryptArchiveJob::encryptionFlags NEW. + + c=C41/A30/R0 cpp=C24/A18/R0 qt=C18/A3/R0 + + Release-info: https://dev.gnupg.org/T6585 + + +Noteworthy changes in version 1.20.0 (2023-04-20) +------------------------------------------------- + + * On Windows, the gettext functions provided by gpgrt are switched + into utf8 mode, so that all localized texts returned by GpgME or + gpgrt, e.g. the texts for error codes are now UTF-8 encoded. + T5960 + + * Key::canSign now returns false for OpenPGP keys without signing + (sub)key. T6456 + + * The new macOS Homebrew location is now by default supported. + T6440 + + * Fix regression in 1.19.0. rMb608c084b9 + + * Fix invocation of gpgtar on Windows. rM0c29119e06 + + * Interface changes relative to the 1.19.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gpgme_subkey_t EXTENDED: New field 'can_renc'. + gpgme_subkey_t EXTENDED: New field 'can_timestamp'. + gpgme_subkey_t EXTENDED: New field 'is_group_owned'. + cpp: Subkey::canRenc NEW. + cpp: Subkey::canTimestamp NEW. + cpp: Subkey::isGroupOwned NEW. + cpp: Key::canReallySign DEPRECATED. + + c=C40/A29/R0 cpp=C23/A17/R0 qt=C17/A2/R1 + + Release-info: https://dev.gnupg.org/T6463 + + +Noteworthy changes in version 1.19.0 (2023-03-17) +------------------------------------------------- + + * New convenience option --identify for gpgme-json. + + * New context flag "no-auto-check-trustdb". T6261 + + * Optionally, build QGpgME for Qt 6 + + * Support component "gpgtar-name" in gpgme_get_dirinfo. T6342 + + * Extended gpgme_op_encrypt*, gpgme_op_encrypt_sign*, and + gpgme_op_sign* to allow creating an encrypted and/or signed + archive. T6342 + + * Extended gpgme_op_decrypt*, gpgme_op_decrypt_verify*, and gpgme_op_verify* + to allow extracting an encrypted and/or signed archive. T6342 + + * cpp: Handle error when trying to sign expired keys. T6155 + + * cpp: Support encryption flags ThrowKeyIds, EncryptWrap, and WantAddress. + T6359 + + * cpp, qt: Fix building with C++11. T6141 + + * qt: Fix problem with expiration dates after 2038-01-19 on 32-bit systems + when adding an existing subkey to another key. T6137 + + * cpp: Allow setting the curve to use when generating ECC keys + for smart cards. T4429 + + * qt: Extend ListAllKeysJob to allow disabling the automatic trust database + check when listing all keys. T6261 + + * qt: Allow deferred start of import jobs. T6323 + + * qt: Support creating and extracting signed and encrypted archives. T6342 + + * Interface changes relative to the 1.18.0 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + gpgme_get_ctx_flag EXTENDED: New flag 'no-auto-check-trustdb'. + gpgme_set_ctx_flag EXTENDED: New flag 'no-auto-check-trustdb'. + GPGME_DECRYPT_ARCHIVE NEW. + GPGME_ENCRYPT_ARCHIVE NEW. + GPGME_SIG_MODE_ARCHIVE NEW. + GPGME_VERIFY_ARCHIVE NEW. + gpgme_verify_flags_t NEW. + gpgme_op_verify_ext_start NEW. + gpgme_op_verify_ext NEW. + cpp: GpgGenCardKeyInteractor::Curve NEW. + cpp: GpgGenCardKeyInteractor::setCurve NEW. + cpp: Context::WantAddress NEW. + cpp: Context::DecryptArchive NEW. + cpp: Context::EncryptArchive NEW. + cpp: SignArchive NEW. + cpp: Data::setFileName EXTENDED: New overload + qt: ListAllKeysJob::Option NEW. + qt: ListAllKeysJob::Options NEW. + qt: ListAllKeysJob::setOptions NEW. + qt: ListAllKeysJob::options NEW. + qt: Job::startNow NEW. + qt: ImportJob::startLater NEW. + qt: FileListDataProvider NEW. + qt: DecryptVerifyArchiveJob NEW. + qt: EncryptArchiveJob NEW. + qt: SignArchiveJob NEW. + qt: SignEncryptArchiveJob NEW. + qt: Protocol::decryptVerifyArchiveJob NEW. + qt: Protocol::encryptArchiveJob NEW. + qt: Protocol::signArchiveJob NEW. + qt: Protocol::signEncryptArchiveJob NEW. + qt: Job::jobProgress NEW. + qt: Job::rawProgress NEW. + qt: Job::progress DEPRECATED. + + c=C39/A28/R0 cpp=C22/A16/R0 qt=C17/A2/R0 + + Release-info: https://dev.gnupg.org/T6341 + + +Noteworthy changes in version 1.18.0 (2022-08-10) +------------------------------------------------- + + * New keylist mode to force refresh via external methods. T5951 + + * The keylist operations now create an import result to report the + result of the locate keylist modes. T5951 + + * core: Return BAD_PASSPHRASE error code on symmetric decryption + failure. T5939 + + * cpp, qt: Do not export internal symbols anymore. T5906 + + * cpp, qt: Support revocation of own OpenPGP keys. T5904 + + * qt: The file name of (signed and) encrypted data can now be set. T6056 + + * cpp, qt: Support setting the primary user ID. T5938 + + * python: Fix segv(NULL) when inspecting contect after exeception. T6060 + + * Interface changes relative to the 1.17.1 release: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + GPGME_KEYLIST_MODE_FORCE_EXTERN NEW. + GPGME_KEYLIST_MODE_LOCATE_EXTERNAL NEW. + cpp: RevocationReason NEW. + cpp: GpgRevokeKeyEditInteractor NEW. + cpp: Result::setError NEW. + cpp: KeyListMode::ForceExtern NEW. + cpp: KeyListMode::LocateExternal NEW. + cpp: KeyListMode::KeyListModeMask NEW. + cpp: ImportResult::mergeWith NEW. + cpp: KeyListModeSaver NEW. + cpp: Context::setPrimaryUid NEW. + cpp: Context::startSetPrimaryUid NEW. + qt: RevokeKeyJob NEW. + qt: Protocol::revokeKeyJob NEW. + qt: EncryptJob::setFileName NEW. + qt: EncryptJob::fileName NEW. + qt: SignEncryptJob::setFileName NEW. + qt: SignEncryptJob::fileName NEW. + qt: SetPrimaryUserIDJob NEW. + qt: Protocol::setPrimaryUserIDJob NEW. + + c=C38/A27/R0 cpp=C21/A15/R0 qt=C16/A1/R0 + + Release-info: https://dev.gnupg.org/T6128 + + +Noteworthy changes in version 1.17.1 (2022-03-06) +------------------------------------------------- + + * qt: Fix a bug in the ABI compatibility of 1.17.0. T5834 + + c=C37/A26/R0 cpp=C20/A14/R0 qt=C15/A0/R0 + + Release-info: https://dev.gnupg.org/T5872 + + Noteworthy changes in version 1.17.0 (2022-02-07) ------------------------------------------------- @@ -34,7 +272,11 @@ * cpp,qt: Support for adding existing subkeys to other keys. #5770 * qt: Extend ChangeExpiryJob to change expiration of primary key - and of subkeys at the same time. #4717 + and of subkeys at the same time. #4717 + + * qt: Support WKD lookup without implicit import. #5728 + + * qt: Allow specifying an import filter when importing keys. #5739 * qt: Expect UTF-8 on stderr on Windows. rM8fe1546282 @@ -60,6 +302,15 @@ qt: ChangeExpiryJob::Options NEW. qt: ChangeExpiryJob::setOptions NEW. qt: ChangeExpiryJob::options NEW. + qt: CryptoConfigEntry::defaultValue NEW. + qt: WKDLookupJob NEW. + qt: WKDLookupResult NEW. + qt: Protocol::wkdLookupJob NEW. + qt: ImportJob::setKeyOrigin NEW. + qt: ImportJob::keyOrigin NEW. + qt: ImportJob::keyOriginUrl NEW. + qt: setImportFilter NEW. + qt: importFilter NEW. qt: AddExistingSubkeyJob NEW. qt: Protocol::addExistingSubkeyJob NEW. @@ -295,7 +546,7 @@ * Several fixes to the Common Lisp bindings. - * Fixed minor bugs in gpgme-json. #4331,#4341,#4342,#4343 + * Fixed minor bugs in gpgme-json. #4331,#4341,#4342,#4343 * Require trace level 8 to dump all I/O data.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/README -> _service:tar_scm:gpgme-1.21.0.tar.bz2/README
Changed
@@ -1,7 +1,7 @@ GPGME - GnuPG Made Easy --------------------------- -Copyright 2001-2021 g10 Code GmbH +Copyright 2001-2023 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/VERSION -> _service:tar_scm:gpgme-1.21.0.tar.bz2/VERSION
Changed
@@ -1,1 +1,1 @@ -1.17.0 +1.21.0
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/aclocal.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/aclocal.m4
Changed
@@ -1204,6 +1204,7 @@ ) # _AM_PROG_TAR m4_include(m4/ax_cxx_compile_stdcxx.m4) +m4_include(m4/ax_gcc_func_attribute.m4) m4_include(m4/ax_pkg_swig.m4) m4_include(m4/ax_python_devel.m4) m4_include(m4/glib-2.0.m4) @@ -1218,5 +1219,6 @@ m4_include(m4/lt~obsolete.m4) m4_include(m4/pkg.m4) m4_include(m4/python.m4) -m4_include(m4/qt.m4) +m4_include(m4/qt5.m4) +m4_include(m4/qt6.m4) m4_include(acinclude.m4)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/autogen.sh -> _service:tar_scm:gpgme-1.21.0.tar.bz2/autogen.sh
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # autogen.sh -# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH +# Copyright (C) 2003, 2014, 2017, 2018, 2022 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -15,7 +15,7 @@ # configure it for the respective package. It is maintained as part of # GnuPG and source copied by other packages. # -# Version: 2018-07-10 +# Version: 2023-03-15 configure_ac="configure.ac" @@ -137,8 +137,6 @@ # List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc w32_toolprefixes= w32_extraoptions= -w32ce_toolprefixes= -w32ce_extraoptions= w64_toolprefixes= w64_extraoptions= amd64_toolprefixes= @@ -146,7 +144,6 @@ # What follows are variables which are sourced but default to # environment variables or lacking them hardcoded values. #w32root= -#w32ce_root= #w64root= #amd64root= @@ -167,11 +164,6 @@ myhost="w32" shift ;; - --build-w32ce) - myhost="w32" - myhostsub="ce" - shift - ;; --build-w64) myhost="w32" myhostsub="64" @@ -203,7 +195,7 @@ die_p make || fatal "error running make" die_p - make check || fatal "error running male check" + make check || fatal "error running make check" die_p exit 0 fi @@ -241,10 +233,12 @@ if -z "$micro" ; then matchstr1="$package-$major.0-9*" matchstr2="$package-$major-base" + matchstr3="" vers="$major.$minor" else matchstr1="$package-$major.$minor.0-9*" - matchstr2="$package-$major.$minor-base" + matchstr2="$package-$major.0-9*-base" + matchstr3="$package-$major-base" vers="$major.$minor.$micro" fi @@ -252,13 +246,22 @@ if -e .git ; then ingit=yes tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null) - tmp=$(echo "$tmp" | sed s/^"$package"//) if -n "$tmp" ; then - tmp=$(echo "$tmp" | sed s/^"$package"// \ - | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') + tmp=$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') else - tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \ - | awk -F- '$4!=0{print"-beta"$4}') + # (due tof "-base" in the tag we need to take the 4th field) + tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null) + if -n "$tmp" ; then + tmp=$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}') + elif -n "${matchstr3}" ; then + tmp=$(git describe --match "${matchstr3}" --long 2>/dev/null) + if -n "$tmp" ; then + tmp=$(echo "$tmp" | sed s/^"$package"// \ + | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}') + fi + fi fi -n "$tmp" && beta=yes rev=$(git rev-parse --short HEAD | tr -d '\n\r') @@ -294,12 +297,6 @@ # ****************** if "$myhost" = "w32" ; then case $myhostsub in - ce) - w32root="$w32ce_root" - -z "$w32root" && w32root="$HOME/w32ce_root" - toolprefixes="$w32ce_toolprefixes arm-mingw32ce" - extraoptions="$extraoptions $w32ce_extraoptions" - ;; 64) w32root="$w64root" -z "$w32root" && w32root="$HOME/w64root"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/build-aux/config.guess -> _service:tar_scm:gpgme-1.21.0.tar.bz2/build-aux/config.guess
Changed
@@ -1,12 +1,14 @@ #! /bin/sh # Attempt to guess a canonical system name. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2016-05-15' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-09' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -27,11 +29,19 @@ # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess +# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to <config-patches@gnu.org>. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -39,7 +49,7 @@ Output the configuration name of the system \`$me' is run on. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -50,7 +60,7 @@ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -84,7 +94,8 @@ exit 1 fi -trap 'exit 1' 1 2 15 +# Just in case it came from the environment. +GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -96,66 +107,90 @@ # Portable tmp directory creation inspired by the Autoconf team. -set_cc_for_build=' -trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; -: ${TMPDIR=/tmp} ; - { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || - { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || - { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || - { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; -dummy=$tmp/dummy ; -tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; -case $CC_FOR_BUILD,$HOST_CC,$CC in - ,,) echo "int x;" > $dummy.c ; - for c in cc gcc c89 c99 ; do - if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then - CC_FOR_BUILD="$c"; break ; - fi ; - done ; - if test x"$CC_FOR_BUILD" = x ; then - CC_FOR_BUILD=no_compiler_found ; - fi - ;; - ,,*) CC_FOR_BUILD=$CC ;; - ,*,*) CC_FOR_BUILD=$HOST_CC ;; -esac ; set_cc_for_build= ;' +tmp= +# shellcheck disable=SC2172 +trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 + +set_cc_for_build() { + # prevent multiple calls if $tmp is already set + test "$tmp" && return 0 + : "${TMPDIR=/tmp}" + # shellcheck disable=SC2039,SC3028 + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } + dummy=$tmp/dummy + case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in + ,,) echo "int x;" > "$dummy.c" + for driver in cc gcc c89 c99 ; do + if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then + CC_FOR_BUILD=$driver + break + fi + done + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; + esac +} # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) -if (test -f /.attbin/uname) >/dev/null 2>&1 ; then +if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown -UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown -case "${UNAME_SYSTEM}" in +case $UNAME_SYSTEM in Linux|GNU|GNU/*) - # If the system lacks a compiler, then just pick glibc. - # We could probably try harder. - LIBC=gnu + LIBC=unknown - eval $set_cc_for_build - cat <<-EOF > $dummy.c + set_cc_for_build + cat <<-EOF > "$dummy.c" #include <features.h> #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc - #else + #elif defined(__GLIBC__) LIBC=gnu + #else + #include <stdarg.h> + /* First heuristic to detect musl libc. */ + #ifdef __DEFINED_va_list + LIBC=musl + #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` + eval "$cc_set_libc" + + # Second heuristic to detect musl libc. + if "$LIBC" = unknown && + command -v ldd >/dev/null && + ldd --version 2>&1 | grep -q ^musl; then + LIBC=musl + fi + + # If the system lacks a compiler, then just pick glibc. + # We could probably try harder. + if "$LIBC" = unknown ; then + LIBC=gnu + fi ;; esac # Note: order is significant - the case branches are not exclusive. -case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in +case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, @@ -167,32 +202,32 @@ # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". - sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ - /sbin/$sysctl 2>/dev/null || \ - /usr/sbin/$sysctl 2>/dev/null || \ + /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ + /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in + aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) - arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv0-9\).*$,\1,'` - endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'` + arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv0-9\).*$,\1,'` + endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; - *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) - eval $set_cc_for_build + set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then @@ -208,10 +243,10 @@ ;; esac # Determine ABI tags. - case "${UNAME_MACHINE_ARCH}" in + case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv0-9/-eabi/;s/eb$//' - abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"` + abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release @@ -219,47 +254,68 @@ # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. - case "${UNAME_VERSION}" in + case $UNAME_VERSION in Debian*) release='-gnu' ;; *) - release=`echo ${UNAME_RELEASE} | sed -e 's/-_.*//' | cut -d. -f1,2` + release=`echo "$UNAME_RELEASE" | sed -e 's/-_.*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. - echo "${machine}-${os}${release}${abi}" - exit ;; + GUESS=$machine-${os}${release}${abi-} + ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE + ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE + ;; + *:SecBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` + GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE + ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` - echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE + ;; + *:MidnightBSD:*:*) + GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE + ;; *:ekkoBSD:*:*) - echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE + ;; *:SolidBSD:*:*) - echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE + ;; + *:OS108:*:*) + GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE + ;; macppc:MirBSD:*:*) - echo powerpc-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE + ;; *:MirBSD:*:*) - echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE + ;; *:Sortix:*:*) - echo ${UNAME_MACHINE}-unknown-sortix - exit ;; + GUESS=$UNAME_MACHINE-unknown-sortix + ;; + *:Twizzler:*:*) + GUESS=$UNAME_MACHINE-unknown-twizzler + ;; + *:Redox:*:*) + GUESS=$UNAME_MACHINE-unknown-redox + ;; + mips:OSF1:*.*) + GUESS=mips-dec-osf1 + ;; alpha:OSF1:*:*) + # Reset EXIT trap before exiting to avoid spurious non-zero exit code. + trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` @@ -273,7 +329,7 @@ # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` - case "$ALPHA_CPU_TYPE" in + case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") @@ -310,126 +366,121 @@ # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. - echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^PVTX//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` - # Reset EXIT trap before exiting to avoid spurious non-zero exit code. - exitcode=$? - trap '' 0 - exit $exitcode ;; - Alpha\ *:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # Should we change UNAME_MACHINE based on the output of uname instead - # of the specific Alpha model? - echo alpha-pc-interix - exit ;; - 21064:Windows_NT:50:3) - echo alpha-dec-winnt3.5 - exit ;; + OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^PVTX//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` + GUESS=$UNAME_MACHINE-dec-osf$OSF_REL + ;; Amiga*:UNIX_System_V:4.0:*) - echo m68k-unknown-sysv4 - exit ;; + GUESS=m68k-unknown-sysv4 + ;; *:AamigaOoSs:*:*) - echo ${UNAME_MACHINE}-unknown-amigaos - exit ;; + GUESS=$UNAME_MACHINE-unknown-amigaos + ;; *:MmorphOoSs:*:*) - echo ${UNAME_MACHINE}-unknown-morphos - exit ;; + GUESS=$UNAME_MACHINE-unknown-morphos + ;; *:OS/390:*:*) - echo i370-ibm-openedition - exit ;; + GUESS=i370-ibm-openedition + ;; *:z/VM:*:*) - echo s390-ibm-zvmoe - exit ;; + GUESS=s390-ibm-zvmoe + ;; *:OS400:*:*) - echo powerpc-ibm-os400 - exit ;; + GUESS=powerpc-ibm-os400 + ;; arm:RISC*:1.012*:*|arm:riscix:1.012*:*) - echo arm-acorn-riscix${UNAME_RELEASE} - exit ;; + GUESS=arm-acorn-riscix$UNAME_RELEASE + ;; arm*:riscos:*:*|arm*:RISCOS:*:*) - echo arm-unknown-riscos - exit ;; + GUESS=arm-unknown-riscos + ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) - echo hppa1.1-hitachi-hiuxmpp - exit ;; + GUESS=hppa1.1-hitachi-hiuxmpp + ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. - if test "`(/bin/universe) 2>/dev/null`" = att ; then - echo pyramid-pyramid-sysv3 - else - echo pyramid-pyramid-bsd - fi - exit ;; + case `(/bin/universe) 2>/dev/null` in + att) GUESS=pyramid-pyramid-sysv3 ;; + *) GUESS=pyramid-pyramid-bsd ;; + esac + ;; NILE*:*:*:dcosx) - echo pyramid-pyramid-svr4 - exit ;; + GUESS=pyramid-pyramid-svr4 + ;; DRS?6000:unix:4.0:6*) - echo sparc-icl-nx6 - exit ;; + GUESS=sparc-icl-nx6 + ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in - sparc) echo sparc-icl-nx7; exit ;; - esac ;; + sparc) GUESS=sparc-icl-nx7 ;; + esac + ;; s390x:SunOS:*:*) - echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL + ;; sun4H:SunOS:5.*:*) - echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=sparc-hal-solaris2$SUN_REL + ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) - echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=sparc-sun-solaris2$SUN_REL + ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) - echo i386-pc-auroraux${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-auroraux$UNAME_RELEASE + ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - eval $set_cc_for_build + set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. - if "$CC_FOR_BUILD" != no_compiler_found ; then + if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi - echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=$SUN_ARCH-pc-solaris2$SUN_REL + ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. - echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=sparc-sun-solaris3$SUN_REL + ;; sun4*:SunOS:*:*) - case "`/usr/bin/arch -k`" in + case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. - echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` + GUESS=sparc-sun-sunos$SUN_REL + ;; sun3*:SunOS:*:*) - echo m68k-sun-sunos${UNAME_RELEASE} - exit ;; + GUESS=m68k-sun-sunos$UNAME_RELEASE + ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` - test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3 - case "`/bin/arch`" in + test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 + case `/bin/arch` in sun3) - echo m68k-sun-sunos${UNAME_RELEASE} + GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) - echo sparc-sun-sunos${UNAME_RELEASE} + GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac - exit ;; + ;; aushp:SunOS:*:*) - echo sparc-auspex-sunos${UNAME_RELEASE} - exit ;; + GUESS=sparc-auspex-sunos$UNAME_RELEASE + ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor @@ -439,44 +490,44 @@ # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atariste:*MiNT:*:* | atariste:*mint:*:* | atariste:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atariste:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-atari-mint$UNAME_RELEASE + ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-milan-mint$UNAME_RELEASE + ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-hades-mint$UNAME_RELEASE + ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-mint$UNAME_RELEASE + ;; m68k:machten:*:*) - echo m68k-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-machten$UNAME_RELEASE + ;; powerpc:machten:*:*) - echo powerpc-apple-machten${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-machten$UNAME_RELEASE + ;; RISC*:Mach:*:*) - echo mips-dec-mach_bsd4.3 - exit ;; + GUESS=mips-dec-mach_bsd4.3 + ;; RISC*:ULTRIX:*:*) - echo mips-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=mips-dec-ultrix$UNAME_RELEASE + ;; VAX*:ULTRIX*:*:*) - echo vax-dec-ultrix${UNAME_RELEASE} - exit ;; + GUESS=vax-dec-ultrix$UNAME_RELEASE + ;; 2020:CLIX:*:* | 2430:CLIX:*:*) - echo clipper-intergraph-clix${UNAME_RELEASE} - exit ;; + GUESS=clipper-intergraph-clix$UNAME_RELEASE + ;; mips:*:*:UMIPS | mips:*:*:RISCos) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include <stdio.h> /* for printf() prototype */ int main (int argc, char *argv) { @@ -485,95 +536,96 @@ #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) - printf ("mips-mips-riscos%ssysv\n", argv1); exit (0); + printf ("mips-mips-riscos%ssysv\\n", argv1); exit (0); #endif #if defined (SYSTYPE_SVR4) - printf ("mips-mips-riscos%ssvr4\n", argv1); exit (0); + printf ("mips-mips-riscos%ssvr4\\n", argv1); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) - printf ("mips-mips-riscos%sbsd\n", argv1); exit (0); + printf ("mips-mips-riscos%sbsd\\n", argv1); exit (0); #endif #endif exit (-1); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && - dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\(0-9*\).*/\1/p'` && - SYSTEM_NAME=`$dummy $dummyarg` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && + dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\(0-9*\).*/\1/p'` && + SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } - echo mips-mips-riscos${UNAME_RELEASE} - exit ;; + GUESS=mips-mips-riscos$UNAME_RELEASE + ;; Motorola:PowerMAX_OS:*:*) - echo powerpc-motorola-powermax - exit ;; + GUESS=powerpc-motorola-powermax + ;; Motorola:*:4.3:PL8-*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) - echo powerpc-harris-powermax - exit ;; + GUESS=powerpc-harris-powermax + ;; Night_Hawk:Power_UNIX:*:*) - echo powerpc-harris-powerunix - exit ;; + GUESS=powerpc-harris-powerunix + ;; m88k:CX/UX:7*:*) - echo m88k-harris-cxux7 - exit ;; + GUESS=m88k-harris-cxux7 + ;; m88k:*:4*:R4*) - echo m88k-motorola-sysv4 - exit ;; + GUESS=m88k-motorola-sysv4 + ;; m88k:*:3*:R3*) - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` - if $UNAME_PROCESSOR = mc88100 || $UNAME_PROCESSOR = mc88110 + if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then - if ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx || \ - ${TARGET_BINARY_INTERFACE}x = x + if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ + test "$TARGET_BINARY_INTERFACE"x = x then - echo m88k-dg-dgux${UNAME_RELEASE} + GUESS=m88k-dg-dgux$UNAME_RELEASE else - echo m88k-dg-dguxbcs${UNAME_RELEASE} + GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else - echo i586-dg-dgux${UNAME_RELEASE} + GUESS=i586-dg-dgux$UNAME_RELEASE fi - exit ;; + ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) - echo m88k-dolphin-sysv3 - exit ;; + GUESS=m88k-dolphin-sysv3 + ;; M88*:*:R3*:*) # Delta 88k system running SVR3 - echo m88k-motorola-sysv3 - exit ;; + GUESS=m88k-motorola-sysv3 + ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) - echo m88k-tektronix-sysv3 - exit ;; + GUESS=m88k-tektronix-sysv3 + ;; Tek430-90-9:UTek:*:*) # Tektronix 4300 system running UTek (BSD) - echo m68k-tektronix-bsd - exit ;; + GUESS=m68k-tektronix-bsd + ;; *:IRIX*:*:*) - echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` - exit ;; + IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` + GUESS=mips-sgi-irix$IRIX_REL + ;; ????????:AIX?:12.1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. - echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id - exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id + ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) - echo i386-ibm-aix - exit ;; + GUESS=i386-ibm-aix + ;; ia64:AIX:*:*) - if -x /usr/bin/oslevel ; then + if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} - exit ;; + GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV + ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include <sys/systemcfg.h> main() @@ -584,77 +636,77 @@ exit(0); } EOF - if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then - echo "$SYSTEM_NAME" + GUESS=$SYSTEM_NAME else - echo rs6000-ibm-aix3.2.5 + GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then - echo rs6000-ibm-aix3.2.4 + GUESS=rs6000-ibm-aix3.2.4 else - echo rs6000-ibm-aix3.2 + GUESS=rs6000-ibm-aix3.2 fi - exit ;; + ;; *:AIX:*:4567) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` - if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi - if -x /usr/bin/lslpp ; then - IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | + if test -x /usr/bin/lslpp ; then + IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/0-9*$/0/` else - IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi - echo ${IBM_ARCH}-ibm-aix${IBM_REV} - exit ;; + GUESS=$IBM_ARCH-ibm-aix$IBM_REV + ;; *:AIX:*:*) - echo rs6000-ibm-aix - exit ;; - ibmrt:4.4BSD:*|romp-ibm:BSD:*) - echo romp-ibm-bsd4.4 - exit ;; + GUESS=rs6000-ibm-aix + ;; + ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) + GUESS=romp-ibm-bsd4.4 + ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and - echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to - exit ;; # report: romp-ibm BSD 4.3 + GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to + ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) - echo rs6000-bull-bosx - exit ;; + GUESS=rs6000-bull-bosx + ;; DPX/2?00:B.O.S.:*:*) - echo m68k-bull-sysv3 - exit ;; + GUESS=m68k-bull-sysv3 + ;; 9000/34??:4.3bsd:1.*:*) - echo m68k-hp-bsd - exit ;; + GUESS=m68k-hp-bsd + ;; hp300:4.4BSD:*:* | 9000/34??:4.3bsd:2.*:*) - echo m68k-hp-bsd4.4 - exit ;; + GUESS=m68k-hp-bsd4.4 + ;; 9000/34678??:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/^.*.0B*//'` - case "${UNAME_MACHINE}" in - 9000/31? ) HP_ARCH=m68000 ;; - 9000/34?? ) HP_ARCH=m68k ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/^.*.0B*//'` + case $UNAME_MACHINE in + 9000/31?) HP_ARCH=m68000 ;; + 9000/34??) HP_ARCH=m68k ;; 9000/6780-90-9) - if -x /usr/bin/getconf ; then + if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 - case "${sc_kernel_bits}" in + case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi - if "${HP_ARCH}" = "" ; then - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + if test "$HP_ARCH" = ""; then + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include <stdlib.h> @@ -687,13 +739,13 @@ exit (0); } EOF - (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac - if ${HP_ARCH} = hppa2.0w + if test "$HP_ARCH" = hppa2.0w then - eval $set_cc_for_build + set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler @@ -712,15 +764,15 @@ HP_ARCH=hppa64 fi fi - echo ${HP_ARCH}-hp-hpux${HPUX_REV} - exit ;; + GUESS=$HP_ARCH-hp-hpux$HPUX_REV + ;; ia64:HP-UX:*:*) - HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/^.*.0B*//'` - echo ia64-hp-hpux${HPUX_REV} - exit ;; + HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/^.*.0B*//'` + GUESS=ia64-hp-hpux$HPUX_REV + ;; 3050*:HI-UX:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + sed 's/^ //' << EOF > "$dummy.c" #include <unistd.h> int main () @@ -745,38 +797,38 @@ exit (0); } EOF - $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } - echo unknown-hitachi-hiuxwe2 - exit ;; - 9000/7??:4.3bsd:*:* | 9000/8?79:4.3bsd:*:* ) - echo hppa1.1-hp-bsd - exit ;; + GUESS=unknown-hitachi-hiuxwe2 + ;; + 9000/7??:4.3bsd:*:* | 9000/8?79:4.3bsd:*:*) + GUESS=hppa1.1-hp-bsd + ;; 9000/8??:4.3bsd:*:*) - echo hppa1.0-hp-bsd - exit ;; + GUESS=hppa1.0-hp-bsd + ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) - echo hppa1.0-hp-mpeix - exit ;; - hp7??:OSF1:*:* | hp8?79:OSF1:*:* ) - echo hppa1.1-hp-osf - exit ;; + GUESS=hppa1.0-hp-mpeix + ;; + hp7??:OSF1:*:* | hp8?79:OSF1:*:*) + GUESS=hppa1.1-hp-osf + ;; hp8??:OSF1:*:*) - echo hppa1.0-hp-osf - exit ;; + GUESS=hppa1.0-hp-osf + ;; i*86:OSF1:*:*) - if -x /usr/sbin/sysversion ; then - echo ${UNAME_MACHINE}-unknown-osf1mk + if test -x /usr/sbin/sysversion ; then + GUESS=$UNAME_MACHINE-unknown-osf1mk else - echo ${UNAME_MACHINE}-unknown-osf1 + GUESS=$UNAME_MACHINE-unknown-osf1 fi - exit ;; + ;; parisc*:Lites*:*:*) - echo hppa1.1-hp-lites - exit ;; + GUESS=hppa1.1-hp-lites + ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) - echo c1-convex-bsd - exit ;; + GUESS=c1-convex-bsd + ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd @@ -784,139 +836,148 @@ fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) - echo c34-convex-bsd - exit ;; + GUESS=c34-convex-bsd + ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) - echo c38-convex-bsd - exit ;; + GUESS=c38-convex-bsd + ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) - echo c4-convex-bsd - exit ;; + GUESS=c4-convex-bsd + ;; CRAY*Y-MP:*:*:*) - echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=ymp-cray-unicos$CRAY_REL + ;; CRAY*A-Z90:*:*:*) - echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\(A-Z90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.^.*$/.X/' exit ;; CRAY*TS:*:*:*) - echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=t90-cray-unicos$CRAY_REL + ;; CRAY*T3E:*:*:*) - echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=alphaev5-cray-unicosmk$CRAY_REL + ;; CRAY*SV1:*:*:*) - echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=sv1-cray-unicos$CRAY_REL + ;; *:UNICOS/mp:*:*) - echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.^.*$/.X/' - exit ;; + CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.^.*$/.X/'` + GUESS=craynv-cray-unicosmp$CRAY_REL + ;; F3001:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` + GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` + GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} + ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) - echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE + ;; sparc*:BSD/OS:*:*) - echo sparc-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-bsdi$UNAME_RELEASE + ;; *:BSD/OS:*:*) - echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE + ;; + arm:FreeBSD:*:*) + UNAME_PROCESSOR=`uname -p` + set_cc_for_build + if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_PCS_VFP + then + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi + else + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf + fi + ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` - case ${UNAME_PROCESSOR} in + case $UNAME_PROCESSOR in amd64) - echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; - *) - echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` ;; + UNAME_PROCESSOR=x86_64 ;; + i386) + UNAME_PROCESSOR=i586 ;; esac - exit ;; + FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL + ;; i*:CYGWIN*:*) - echo ${UNAME_MACHINE}-pc-cygwin - exit ;; + GUESS=$UNAME_MACHINE-pc-cygwin + ;; *:MINGW64*:*) - echo ${UNAME_MACHINE}-pc-mingw64 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw64 + ;; *:MINGW*:*) - echo ${UNAME_MACHINE}-pc-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-mingw32 + ;; *:MSYS*:*) - echo ${UNAME_MACHINE}-pc-msys - exit ;; - i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-msys + ;; i*:PW*:*) - echo ${UNAME_MACHINE}-pc-pw32 - exit ;; + GUESS=$UNAME_MACHINE-pc-pw32 + ;; + *:SerenityOS:*:*) + GUESS=$UNAME_MACHINE-pc-serenity + ;; *:Interix*:*) - case ${UNAME_MACHINE} in + case $UNAME_MACHINE in x86) - echo i586-pc-interix${UNAME_RELEASE} - exit ;; + GUESS=i586-pc-interix$UNAME_RELEASE + ;; authenticamd | genuineintel | EM64T) - echo x86_64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=x86_64-unknown-interix$UNAME_RELEASE + ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + GUESS=ia64-unknown-interix$UNAME_RELEASE + ;; esac ;; - 34586:Windows_95:* | 34586:Windows_98:* | 34586:Windows_NT:*) - echo i${UNAME_MACHINE}-pc-mks - exit ;; - 8664:Windows_NT:*) - echo x86_64-pc-mks - exit ;; - i*:Windows_NT*:* | Pentium*:Windows_NT*:*) - # How do we know it's Interix rather than the generic POSIX subsystem? - # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we - # UNAME_MACHINE based on the output of uname instead of i386? - echo i586-pc-interix - exit ;; i*:UWIN*:*) - echo ${UNAME_MACHINE}-pc-uwin - exit ;; + GUESS=$UNAME_MACHINE-pc-uwin + ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) - echo x86_64-unknown-cygwin - exit ;; - p*:CYGWIN*:*) - echo powerpcle-unknown-cygwin - exit ;; + GUESS=x86_64-pc-cygwin + ;; prep*:SunOS:5.*:*) - echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/^.*//'` - exit ;; + SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/^.*//'` + GUESS=powerpcle-unknown-solaris2$SUN_REL + ;; *:GNU:*:*) # the GNU system - echo `echo ${UNAME_MACHINE}|sed -e 's,-/.*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` - exit ;; + GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,-/.*$,,'` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` + GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL + ;; *:GNU/*:*:*) # other systems with GNU libc and userland - echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^^/*/,,' | tr ":upper:" ":lower:"``echo ${UNAME_RELEASE}|sed -e 's/-(.*//'`-${LIBC} - exit ;; - i*86:Minix:*:*) - echo ${UNAME_MACHINE}-pc-minix - exit ;; + GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^^/*/,,' | tr ":upper:" ":lower:"` + GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC + ;; + *:Minix:*:*) + GUESS=$UNAME_MACHINE-unknown-minix + ;; aarch64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; @@ -927,177 +988,225 @@ esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; - arc:Linux:*:* | arceb:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; arm*:Linux:*:*) - eval $set_cc_for_build + set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else - echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf + GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi - exit ;; + ;; avr32*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; cris:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; crisv32:Linux:*:*) - echo ${UNAME_MACHINE}-axis-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-axis-linux-$LIBC + ;; e2k:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; frv:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; hexagon:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-pc-linux-$LIBC + ;; ia64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; k1om:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; + loongarch32:Linux:*:* | loongarch64:Linux:*:* | loongarchx32:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m32r*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; m68*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; mips:Linux:*:* | mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c + set_cc_for_build + IS_GLIBC=0 + test x"${LIBC}" = xgnu && IS_GLIBC=1 + sed 's/^ //' << EOF > "$dummy.c" #undef CPU - #undef ${UNAME_MACHINE} - #undef ${UNAME_MACHINE}el + #undef mips + #undef mipsel + #undef mips64 + #undef mips64el + #if ${IS_GLIBC} && defined(_ABI64) + LIBCABI=gnuabi64 + #else + #if ${IS_GLIBC} && defined(_ABIN32) + LIBCABI=gnuabin32 + #else + LIBCABI=${LIBC} + #endif + #endif + + #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa64r6 + #else + #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 + CPU=mipsisa32r6 + #else + #if defined(__mips64) + CPU=mips64 + #else + CPU=mips + #endif + #endif + #endif + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=${UNAME_MACHINE}el + MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=${UNAME_MACHINE} + MIPS_ENDIAN= #else - CPU= + MIPS_ENDIAN= #endif #endif EOF - eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } + cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` + eval "$cc_set_vars" + test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } + ;; + mips64el:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) - echo or1k-unknown-linux-${LIBC} - exit ;; + GUESS=or1k-unknown-linux-$LIBC + ;; or32:Linux:*:* | or1k*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; padre:Linux:*:*) - echo sparc-unknown-linux-${LIBC} - exit ;; + GUESS=sparc-unknown-linux-$LIBC + ;; parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-${LIBC} - exit ;; + GUESS=hppa64-unknown-linux-$LIBC + ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu^a-z*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in - PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; - PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; - *) echo hppa-unknown-linux-${LIBC} ;; + PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; + PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; + *) GUESS=hppa-unknown-linux-$LIBC ;; esac - exit ;; + ;; ppc64:Linux:*:*) - echo powerpc64-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64-unknown-linux-$LIBC + ;; ppc:Linux:*:*) - echo powerpc-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc-unknown-linux-$LIBC + ;; ppc64le:Linux:*:*) - echo powerpc64le-unknown-linux-${LIBC} - exit ;; + GUESS=powerpc64le-unknown-linux-$LIBC + ;; ppcle:Linux:*:*) - echo powerpcle-unknown-linux-${LIBC} - exit ;; + GUESS=powerpcle-unknown-linux-$LIBC + ;; + riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; s390:Linux:*:* | s390x:Linux:*:*) - echo ${UNAME_MACHINE}-ibm-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-ibm-linux-$LIBC + ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sh*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; sparc:Linux:*:* | sparc64:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; tile*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; vax:Linux:*:*) - echo ${UNAME_MACHINE}-dec-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-dec-linux-$LIBC + ;; x86_64:Linux:*:*) - echo ${UNAME_MACHINE}-pc-linux-${LIBC} - exit ;; + set_cc_for_build + LIBCABI=$LIBC + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __ILP32__'; echo IS_X32; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_X32 >/dev/null + then + LIBCABI=${LIBC}x32 + fi + fi + GUESS=$UNAME_MACHINE-pc-linux-$LIBCABI + ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-${LIBC} - exit ;; + GUESS=$UNAME_MACHINE-unknown-linux-$LIBC + ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. - echo i386-sequent-sysv4 - exit ;; + GUESS=i386-sequent-sysv4 + ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. - echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION + ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. - echo ${UNAME_MACHINE}-pc-os2-emx - exit ;; + GUESS=$UNAME_MACHINE-pc-os2-emx + ;; i*86:XTS-300:*:STOP) - echo ${UNAME_MACHINE}-unknown-stop - exit ;; + GUESS=$UNAME_MACHINE-unknown-stop + ;; i*86:atheos:*:*) - echo ${UNAME_MACHINE}-unknown-atheos - exit ;; + GUESS=$UNAME_MACHINE-unknown-atheos + ;; i*86:syllable:*:*) - echo ${UNAME_MACHINE}-pc-syllable - exit ;; + GUESS=$UNAME_MACHINE-pc-syllable + ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.01*:* | i*86:LynxOS:4.02*:*) - echo i386-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=i386-unknown-lynxos$UNAME_RELEASE + ;; i*86:*DOS:*:*) - echo ${UNAME_MACHINE}-pc-msdosdjgpp - exit ;; - i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) - UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + GUESS=$UNAME_MACHINE-pc-msdosdjgpp + ;; + i*86:*:4.*:*) + UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then - echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi - exit ;; + ;; i*86:*:5:678*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in @@ -1105,12 +1214,12 @@ *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac - echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} - exit ;; + GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` - echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + GUESS=$UNAME_MACHINE-pc-isc$UNAME_REL elif /bin/uname -X 2>/dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 @@ -1120,11 +1229,11 @@ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 - echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else - echo ${UNAME_MACHINE}-pc-sysv32 + GUESS=$UNAME_MACHINE-pc-sysv32 fi - exit ;; + ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about @@ -1132,31 +1241,31 @@ # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. - echo i586-pc-msdosdjgpp - exit ;; + GUESS=i586-pc-msdosdjgpp + ;; Intel:Mach:3*:*) - echo i386-pc-mach3 - exit ;; + GUESS=i386-pc-mach3 + ;; paragon:*:*:*) - echo i860-intel-osf1 - exit ;; + GUESS=i860-intel-osf1 + ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then - echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. - echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi - exit ;; + ;; mini*:CTIX:SYS*5:*) # "miniframe" - echo m68010-convergent-sysv - exit ;; + GUESS=m68010-convergent-sysv + ;; mc68k:UNIX:SYSTEM5:3.51m) - echo m68k-convergent-sysv - exit ;; + GUESS=m68k-convergent-sysv + ;; M680?0:D-NIX:5.3:*) - echo m68k-diab-dnix - exit ;; + GUESS=m68k-diab-dnix + ;; M68*:*:R3V5678*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3345??:*:4.0:3.0 | 334??A:*:4.0:3.0 | 334??,*:*:4.0:3.0 | 334??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) @@ -1164,9 +1273,9 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/^ * ^ * \(0-90-9\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 334??:*:4.0:* | 334??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; @@ -1175,249 +1284,437 @@ test -r /etc/.relid \ && OS_REL=.`sed -n 's/^ * ^ * \(0-90-9\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ - && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) - echo m68k-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=m68k-unknown-lynxos$UNAME_RELEASE + ;; mc68030:UNIX_System_V:4.*:*) - echo m68k-atari-sysv4 - exit ;; + GUESS=m68k-atari-sysv4 + ;; TSUNAMI:LynxOS:2.*:*) - echo sparc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=sparc-unknown-lynxos$UNAME_RELEASE + ;; rs6000:LynxOS:2.*:*) - echo rs6000-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=rs6000-unknown-lynxos$UNAME_RELEASE + ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.01*:* | PowerPC:LynxOS:4.02*:*) - echo powerpc-unknown-lynxos${UNAME_RELEASE} - exit ;; + GUESS=powerpc-unknown-lynxos$UNAME_RELEASE + ;; SMBES:UNIX_SV:*:*) - echo mips-dde-sysv${UNAME_RELEASE} - exit ;; + GUESS=mips-dde-sysv$UNAME_RELEASE + ;; RM*:ReliantUNIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; RM*:SINIX-*:*:*) - echo mips-sni-sysv4 - exit ;; + GUESS=mips-sni-sysv4 + ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` - echo ${UNAME_MACHINE}-sni-sysv4 + GUESS=$UNAME_MACHINE-sni-sysv4 else - echo ns32k-sni-sysv + GUESS=ns32k-sni-sysv fi - exit ;; + ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says <Richard.M.Bartel@ccMail.Census.GOV> - echo i586-unisys-sysv4 - exit ;; + GUESS=i586-unisys-sysv4 + ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes <hewes@openmarket.com>. # How about differentiating between stratus architectures? -djm - echo hppa1.1-stratus-sysv4 - exit ;; + GUESS=hppa1.1-stratus-sysv4 + ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. - echo i860-stratus-sysv4 - exit ;; + GUESS=i860-stratus-sysv4 + ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. - echo ${UNAME_MACHINE}-stratus-vos - exit ;; + GUESS=$UNAME_MACHINE-stratus-vos + ;; *:VOS:*:*) # From Paul.Green@stratus.com. - echo hppa1.1-stratus-vos - exit ;; + GUESS=hppa1.1-stratus-vos + ;; mc68*:A/UX:*:*) - echo m68k-apple-aux${UNAME_RELEASE} - exit ;; + GUESS=m68k-apple-aux$UNAME_RELEASE + ;; news*:NEWS-OS:6*:*) - echo mips-sony-newsos6 - exit ;; + GUESS=mips-sony-newsos6 + ;; R34000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) - if -d /usr/nec ; then - echo mips-nec-sysv${UNAME_RELEASE} + if test -d /usr/nec; then + GUESS=mips-nec-sysv$UNAME_RELEASE else - echo mips-unknown-sysv${UNAME_RELEASE} + GUESS=mips-unknown-sysv$UNAME_RELEASE fi - exit ;; + ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. - echo powerpc-be-beos - exit ;; + GUESS=powerpc-be-beos + ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. - echo powerpc-apple-beos - exit ;; + GUESS=powerpc-apple-beos + ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. - echo i586-pc-beos - exit ;; + GUESS=i586-pc-beos + ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. - echo i586-pc-haiku - exit ;; + GUESS=i586-pc-haiku + ;; x86_64:Haiku:*:*) - echo x86_64-unknown-haiku - exit ;; + GUESS=x86_64-unknown-haiku + ;; SX-4:SUPER-UX:*:*) - echo sx4-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx4-nec-superux$UNAME_RELEASE + ;; SX-5:SUPER-UX:*:*) - echo sx5-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx5-nec-superux$UNAME_RELEASE + ;; SX-6:SUPER-UX:*:*) - echo sx6-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx6-nec-superux$UNAME_RELEASE + ;; SX-7:SUPER-UX:*:*) - echo sx7-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx7-nec-superux$UNAME_RELEASE + ;; SX-8:SUPER-UX:*:*) - echo sx8-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8-nec-superux$UNAME_RELEASE + ;; SX-8R:SUPER-UX:*:*) - echo sx8r-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sx8r-nec-superux$UNAME_RELEASE + ;; SX-ACE:SUPER-UX:*:*) - echo sxace-nec-superux${UNAME_RELEASE} - exit ;; + GUESS=sxace-nec-superux$UNAME_RELEASE + ;; Power*:Rhapsody:*:*) - echo powerpc-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=powerpc-apple-rhapsody$UNAME_RELEASE + ;; *:Rhapsody:*:*) - echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE + ;; + arm64:Darwin:*:*) + GUESS=aarch64-apple-darwin$UNAME_RELEASE + ;; *:Darwin:*:*) - UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown - eval $set_cc_for_build - if test "$UNAME_PROCESSOR" = unknown ; then - UNAME_PROCESSOR=powerpc + UNAME_PROCESSOR=`uname -p` + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + if command -v xcode-select > /dev/null 2> /dev/null && \ + ! xcode-select --print-path > /dev/null 2> /dev/null ; then + # Avoid executing cc if there is no toolchain installed as + # cc will be a stub that puts up a graphical alert + # prompting the user to install developer tools. + CC_FOR_BUILD=no_compiler_found + else + set_cc_for_build fi - if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then - if "$CC_FOR_BUILD" != no_compiler_found ; then - if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ - (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ - grep IS_64BIT_ARCH >/dev/null - then - case $UNAME_PROCESSOR in - i386) UNAME_PROCESSOR=x86_64 ;; - powerpc) UNAME_PROCESSOR=powerpc64 ;; - esac - fi + if test "$CC_FOR_BUILD" != no_compiler_found; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + case $UNAME_PROCESSOR in + i386) UNAME_PROCESSOR=x86_64 ;; + powerpc) UNAME_PROCESSOR=powerpc64 ;; + esac + fi + # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc + if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ + (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_PPC >/dev/null + then + UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then - # Avoid executing cc on OS X 10.9, as it ships with a stub - # that puts up a graphical alert prompting to install - # developer tools. Any system running Mac OS X 10.7 or - # later (Darwin 11 and later) is required to have a 64-bit - # processor. This is not true of the ARM version of Darwin - # that Apple uses in portable devices. - UNAME_PROCESSOR=x86_64 + # uname -m returns i386 or x86_64 + UNAME_PROCESSOR=$UNAME_MACHINE fi - echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE + ;; *:procnto*:*:* | *:QNX:0123456789*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi - echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE + ;; *:QNX:*:4*) - echo i386-pc-qnx - exit ;; - NEO-?:NONSTOP_KERNEL:*:*) - echo neo-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=i386-pc-qnx + ;; + NEO-*:NONSTOP_KERNEL:*:*) + GUESS=neo-tandem-nsk$UNAME_RELEASE + ;; NSE-*:NONSTOP_KERNEL:*:*) - echo nse-tandem-nsk${UNAME_RELEASE} - exit ;; - NSR-?:NONSTOP_KERNEL:*:*) - echo nsr-tandem-nsk${UNAME_RELEASE} - exit ;; + GUESS=nse-tandem-nsk$UNAME_RELEASE + ;; + NSR-*:NONSTOP_KERNEL:*:*) + GUESS=nsr-tandem-nsk$UNAME_RELEASE + ;; + NSV-*:NONSTOP_KERNEL:*:*) + GUESS=nsv-tandem-nsk$UNAME_RELEASE + ;; + NSX-*:NONSTOP_KERNEL:*:*) + GUESS=nsx-tandem-nsk$UNAME_RELEASE + ;; *:NonStop-UX:*:*) - echo mips-compaq-nonstopux - exit ;; + GUESS=mips-compaq-nonstopux + ;; BS2000:POSIX*:*:*) - echo bs2000-siemens-sysv - exit ;; + GUESS=bs2000-siemens-sysv + ;; DS/*:UNIX_System_V:*:*) - echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} - exit ;; + GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE + ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. - if test "$cputype" = 386; then + if test "${cputype-}" = 386; then UNAME_MACHINE=i386 - else - UNAME_MACHINE="$cputype" + elif test "x${cputype-}" != x; then + UNAME_MACHINE=$cputype fi - echo ${UNAME_MACHINE}-unknown-plan9 - exit ;; + GUESS=$UNAME_MACHINE-unknown-plan9 + ;; *:TOPS-10:*:*) - echo pdp10-unknown-tops10 - exit ;; + GUESS=pdp10-unknown-tops10 + ;; *:TENEX:*:*) - echo pdp10-unknown-tenex - exit ;; + GUESS=pdp10-unknown-tenex + ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) - echo pdp10-dec-tops20 - exit ;; + GUESS=pdp10-dec-tops20 + ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) - echo pdp10-xkl-tops20 - exit ;; + GUESS=pdp10-xkl-tops20 + ;; *:TOPS-20:*:*) - echo pdp10-unknown-tops20 - exit ;; + GUESS=pdp10-unknown-tops20 + ;; *:ITS:*:*) - echo pdp10-unknown-its - exit ;; + GUESS=pdp10-unknown-its + ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} - exit ;; + GUESS=mips-sei-seiux$UNAME_RELEASE + ;; *:DragonFly:*:*) - echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/-(.*//'` - exit ;; + DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/-(.*//'` + GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL + ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` - case "${UNAME_MACHINE}" in - A*) echo alpha-dec-vms ; exit ;; - I*) echo ia64-dec-vms ; exit ;; - V*) echo vax-dec-vms ; exit ;; + case $UNAME_MACHINE in + A*) GUESS=alpha-dec-vms ;; + I*) GUESS=ia64-dec-vms ;; + V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) - echo i386-pc-xenix - exit ;; + GUESS=i386-pc-xenix + ;; i*86:skyos:*:*) - echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'` - exit ;; + SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` + GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL + ;; i*86:rdos:*:*) - echo ${UNAME_MACHINE}-pc-rdos - exit ;; - i*86:AROS:*:*) - echo ${UNAME_MACHINE}-pc-aros - exit ;; + GUESS=$UNAME_MACHINE-pc-rdos + ;; + i*86:Fiwix:*:*) + GUESS=$UNAME_MACHINE-pc-fiwix + ;; + *:AROS:*:*) + GUESS=$UNAME_MACHINE-unknown-aros + ;; x86_64:VMkernel:*:*) - echo ${UNAME_MACHINE}-unknown-esx - exit ;; + GUESS=$UNAME_MACHINE-unknown-esx + ;; amd64:Isilon\ OneFS:*:*) - echo x86_64-unknown-onefs - exit ;; + GUESS=x86_64-unknown-onefs + ;; + *:Unleashed:*:*) + GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE + ;; +esac + +# Do we have a guess based on uname results? +if test "x$GUESS" != x; then + echo "$GUESS" + exit +fi + +# No uname command or uname output not recognized. +set_cc_for_build +cat > "$dummy.c" <<EOF +#ifdef _SEQUENT_ +#include <sys/types.h> +#include <sys/utsname.h> +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#include <signal.h> +#if defined(_SIZE_T_) || defined(SIGLOST) +#include <sys/utsname.h> +#endif +#endif +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \(0-9*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); +#endif + +#if defined (vax) +#if !defined (ultrix) +#include <sys/param.h> +#if defined (BSD) +#if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +#else +#if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#endif +#else + printf ("vax-dec-bsd\n"); exit (0); +#endif +#else +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname un; + uname (&un); + printf ("vax-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif +#endif +#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) +#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) +#if defined(_SIZE_T_) || defined(SIGLOST) + struct utsname *un; + uname (&un); + printf ("mips-dec-ultrix%s\n", un.release); exit (0); +#else + printf ("mips-dec-ultrix\n"); exit (0); +#endif +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. +test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } + +echo "$0: unable to guess system type" >&2 + +case $UNAME_MACHINE:$UNAME_SYSTEM in + mips:Linux | mips64:Linux) + # If we got here on MIPS GNU/Linux, output extra information. + cat >&2 <<EOF + +NOTE: MIPS GNU/Linux systems require a C compiler to fully recognize +the system type. Please install a C compiler and try again. +EOF + ;; esac cat >&2 <<EOF -$0: unable to guess system type This script (version $timestamp), has failed to recognize the -operating system you are using. If your script is old, overwrite -config.guess and config.sub with the latest versions from: +operating system you are using. If your script is old, overwrite *all* +copies of config.guess and config.sub with the latest versions from: - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess + https://git.savannah.gnu.org/cgit/config.git/plain/config.guess and - http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub + https://git.savannah.gnu.org/cgit/config.git/plain/config.sub +EOF + +our_year=`echo $timestamp | sed 's,-.*,,'` +thisyear=`date +%Y` +# shellcheck disable=SC2003 +script_age=`expr "$thisyear" - "$our_year"` +if test "$script_age" -lt 3 ; then + cat >&2 <<EOF If $0 has already been updated, send the following data and any information you think might be pertinent to config-patches@gnu.org to @@ -1440,16 +1737,17 @@ /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` -UNAME_MACHINE = ${UNAME_MACHINE} -UNAME_RELEASE = ${UNAME_RELEASE} -UNAME_SYSTEM = ${UNAME_SYSTEM} -UNAME_VERSION = ${UNAME_VERSION} +UNAME_MACHINE = "$UNAME_MACHINE" +UNAME_RELEASE = "$UNAME_RELEASE" +UNAME_SYSTEM = "$UNAME_SYSTEM" +UNAME_VERSION = "$UNAME_VERSION" EOF +fi exit 1 # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/build-aux/config.sub -> _service:tar_scm:gpgme-1.21.0.tar.bz2/build-aux/config.sub
Changed
@@ -1,12 +1,14 @@ #! /bin/sh # Configuration validation subroutine script. -# Copyright 1992-2016 Free Software Foundation, Inc. +# Copyright 1992-2022 Free Software Foundation, Inc. -timestamp='2016-06-20' +# shellcheck disable=SC2006,SC2268 # see below for rationale + +timestamp='2022-01-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 3 of the License, or +# the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but @@ -33,7 +35,7 @@ # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub +# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases @@ -50,6 +52,13 @@ # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. +# The "shellcheck disable" line above the timestamp inhibits complaints +# about features and limitations of the classic Bourne shell that were +# superseded or lifted in POSIX. However, this script identifies a wide +# variety of pre-POSIX systems that do not have POSIX shells at all, and +# even some reasonably current systems (Solaris 10 as case-in-point) still +# have a pre-POSIX /bin/sh. + me=`echo "$0" | sed -e 's,.*/,,'` usage="\ @@ -57,7 +66,7 @@ Canonicalize a configuration name. -Operation modes: +Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit @@ -67,7 +76,7 @@ version="\ GNU config.sub ($timestamp) -Copyright 1992-2016 Free Software Foundation, Inc. +Copyright 1992-2022 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -89,12 +98,12 @@ - ) # Use stdin as input. break ;; -* ) - echo "$me: invalid option $1$help" + echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. - echo $1 + echo "$1" exit ;; * ) @@ -110,1242 +119,1186 @@ exit 1;; esac -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'` - ;; - android-linux) - os=-linux-android - basic_machine=`echo $1 | sed 's/^\(.*\)-\(^-*-^-*\)$/\1/'`-unknown - ;; - *) - basic_machine=`echo $1 | sed 's/-^-*$//'` - if $basic_machine != $1 - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac +# Split fields of configuration type +# shellcheck disable=SC2162 +saved_IFS=$IFS +IFS="-" read field1 field2 field3 field4 <<EOF +$1 +EOF +IFS=$saved_IFS -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun234* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c123* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze*) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.4-9*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v4-9*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*178) - os=-lynxos178 - ;; - -lynx*5) - os=-lynxos5 - ;; - -lynx*) - os=-lynxos +# Separate into logical components for further validation +case $1 in + *-*-*-*-*) + echo Invalid configuration \`"$1"\': more than four components >&2 + exit 1 ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + *-*-*-*) + basic_machine=$field1-$field2 + basic_os=$field3-$field4 ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` + *-*-*) + # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two + # parts + maybe_os=$field2-$field3 + case $maybe_os in + nto-qnx* | linux-* | uclinux-uclibc* \ + | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ + | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ + | storm-chaos* | os2-emx* | rtmk-nova*) + basic_machine=$field1 + basic_os=$maybe_os + ;; + android-linux) + basic_machine=$field1-unknown + basic_os=linux-android + ;; + *) + basic_machine=$field1-$field2 + basic_os=$field3 + ;; + esac ;; - -psos*) - os=-psos + *-*) + # A lone config we happen to match not fitting any pattern + case $field1-$field2 in + decstation-3100) + basic_machine=mips-dec + basic_os= + ;; + *-*) + # Second component is usually, but not always the OS + case $field2 in + # Prevent following clause from handling this valid os + sun*os*) + basic_machine=$field1 + basic_os=$field2 + ;; + zephyr*) + basic_machine=$field1-unknown + basic_os=$field2 + ;; + # Manufacturers + dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ + | att* | 7300* | 3300* | delta* | motorola* | sun234* \ + | unicom* | ibm* | next | hp | isi* | apollo | altos* \ + | convergent* | ncr* | news | 32* | 3600* | 3100* \ + | hitachi* | c123* | convex* | sun | crds | omron* | dg \ + | ultra | tti* | harris | dolphin | highlevel | gould \ + | cbm | ns | masscomp | apple | axis | knuth | cray \ + | microblaze* | sim | cisco \ + | oki | wec | wrs | winbond) + basic_machine=$field1-$field2 + basic_os= + ;; + *) + basic_machine=$field1 + basic_os=$field2 + ;; + esac + ;; + esac ;; - -mint | -mint0-9*) - basic_machine=m68k-atari - os=-mint + *) + # Convert single-component short-hands not valid as part of + # multi-component configurations. + case $field1 in + 386bsd) + basic_machine=i386-pc + basic_os=bsd + ;; + a29khif) + basic_machine=a29k-amd + basic_os=udi + ;; + adobe68k) + basic_machine=m68010-adobe + basic_os=scout + ;; + alliant) + basic_machine=fx80-alliant + basic_os= + ;; + altos | altos3068) + basic_machine=m68k-altos + basic_os= + ;; + am29k) + basic_machine=a29k-none + basic_os=bsd + ;; + amdahl) + basic_machine=580-amdahl + basic_os=sysv + ;; + amiga) + basic_machine=m68k-unknown + basic_os= + ;; + amigaos | amigados) + basic_machine=m68k-unknown + basic_os=amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + basic_os=sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + basic_os=sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + basic_os=bsd + ;; + aros) + basic_machine=i386-pc + basic_os=aros + ;; + aux) + basic_machine=m68k-apple + basic_os=aux + ;; + balance) + basic_machine=ns32k-sequent + basic_os=dynix + ;; + blackfin) + basic_machine=bfin-unknown + basic_os=linux + ;; + cegcc) + basic_machine=arm-unknown + basic_os=cegcc + ;; + convex-c1) + basic_machine=c1-convex + basic_os=bsd + ;; + convex-c2) + basic_machine=c2-convex + basic_os=bsd + ;; + convex-c32) + basic_machine=c32-convex + basic_os=bsd + ;; + convex-c34) + basic_machine=c34-convex + basic_os=bsd + ;; + convex-c38) + basic_machine=c38-convex + basic_os=bsd + ;; + cray) + basic_machine=j90-cray + basic_os=unicos + ;; + crds | unos) + basic_machine=m68k-crds + basic_os= + ;; + da30) + basic_machine=m68k-da30 + basic_os= + ;; + decstation | pmax | pmin | dec3100 | decstatn) + basic_machine=mips-dec + basic_os= + ;; + delta88) + basic_machine=m88k-motorola + basic_os=sysv3 + ;; + dicos) + basic_machine=i686-pc + basic_os=dicos + ;; + djgpp) + basic_machine=i586-pc + basic_os=msdosdjgpp + ;; + ebmon29k) + basic_machine=a29k-amd + basic_os=ebmon + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + basic_os=ose + ;; + gmicro) + basic_machine=tron-gmicro + basic_os=sysv + ;; + go32) + basic_machine=i386-pc + basic_os=go32 + ;; + h8300hms) + basic_machine=h8300-hitachi + basic_os=hms + ;; + h8300xray) + basic_machine=h8300-hitachi + basic_os=xray + ;; + h8500hms) + basic_machine=h8500-hitachi + basic_os=hms + ;; + harris) + basic_machine=m88k-harris + basic_os=sysv3 + ;; + hp300 | hp300hpux) + basic_machine=m68k-hp + basic_os=hpux + ;; + hp300bsd) + basic_machine=m68k-hp + basic_os=bsd + ;; + hppaosf) + basic_machine=hppa1.1-hp + basic_os=osf + ;; + hppro) + basic_machine=hppa1.1-hp + basic_os=proelf + ;; + i386mach) + basic_machine=i386-mach + basic_os=mach + ;; + isi68 | isi) + basic_machine=m68k-isi + basic_os=sysv + ;; + m68knommu) + basic_machine=m68k-unknown + basic_os=linux + ;; + magnum | m3230) + basic_machine=mips-mips + basic_os=sysv + ;; + merlin) + basic_machine=ns32k-utek + basic_os=sysv + ;; + mingw64) + basic_machine=x86_64-pc + basic_os=mingw64 + ;; + mingw32) + basic_machine=i686-pc + basic_os=mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + basic_os=mingw32ce + ;; + monitor) + basic_machine=m68k-rom68k + basic_os=coff + ;; + morphos) + basic_machine=powerpc-unknown + basic_os=morphos + ;; + moxiebox) + basic_machine=moxie-unknown + basic_os=moxiebox + ;; + msdos) + basic_machine=i386-pc + basic_os=msdos + ;; + msys) + basic_machine=i686-pc + basic_os=msys + ;; + mvs) + basic_machine=i370-ibm + basic_os=mvs + ;; + nacl) + basic_machine=le32-unknown + basic_os=nacl + ;; + ncr3000) + basic_machine=i486-ncr + basic_os=sysv4 + ;; + netbsd386) + basic_machine=i386-pc + basic_os=netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + basic_os=linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + basic_os=newsos + ;; + news1000) + basic_machine=m68030-sony + basic_os=newsos + ;; + necv70) + basic_machine=v70-nec + basic_os=sysv + ;; + nh3000) + basic_machine=m68k-harris + basic_os=cxux + ;; + nh45000) + basic_machine=m88k-harris + basic_os=cxux + ;; + nindy960) + basic_machine=i960-intel + basic_os=nindy + ;; + mon960) + basic_machine=i960-intel + basic_os=mon960 + ;; + nonstopux) + basic_machine=mips-compaq + basic_os=nonstopux + ;; + os400) + basic_machine=powerpc-ibm + basic_os=os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + basic_os=ose + ;; + os68k) + basic_machine=m68k-none + basic_os=os68k + ;; + paragon) + basic_machine=i860-intel + basic_os=osf + ;; + parisc) + basic_machine=hppa-unknown + basic_os=linux + ;; + psp) + basic_machine=mipsallegrexel-sony + basic_os=psp + ;; + pw32) + basic_machine=i586-unknown + basic_os=pw32 + ;; + rdos | rdos64) + basic_machine=x86_64-pc + basic_os=rdos + ;; + rdos32) + basic_machine=i386-pc + basic_os=rdos + ;; + rom68k) + basic_machine=m68k-rom68k + basic_os=coff + ;; + sa29200) + basic_machine=a29k-amd + basic_os=udi + ;; + sei) + basic_machine=mips-sei + basic_os=seiux + ;; + sequent) + basic_machine=i386-sequent + basic_os= + ;; + sps7) + basic_machine=m68k-bull + basic_os=sysv2 + ;; + st2000) + basic_machine=m68k-tandem + basic_os= + ;; + stratus) + basic_machine=i860-stratus + basic_os=sysv4 + ;; + sun2) + basic_machine=m68000-sun + basic_os= + ;; + sun2os3) + basic_machine=m68000-sun + basic_os=sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + basic_os=sunos4 + ;; + sun3) + basic_machine=m68k-sun + basic_os= + ;; + sun3os3) + basic_machine=m68k-sun + basic_os=sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + basic_os=sunos4 + ;; + sun4) + basic_machine=sparc-sun + basic_os= + ;; + sun4os3) + basic_machine=sparc-sun + basic_os=sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + basic_os=sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + basic_os=solaris2 + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + basic_os= + ;; + sv1) + basic_machine=sv1-cray + basic_os=unicos + ;; + symmetry) + basic_machine=i386-sequent + basic_os=dynix + ;; + t3e) + basic_machine=alphaev5-cray + basic_os=unicos + ;; + t90) + basic_machine=t90-cray + basic_os=unicos + ;; + toad1) + basic_machine=pdp10-xkl + basic_os=tops20 + ;; + tpf) + basic_machine=s390x-ibm + basic_os=tpf + ;; + udi29k) + basic_machine=a29k-amd + basic_os=udi + ;; + ultra3) + basic_machine=a29k-nyu + basic_os=sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + basic_os=none + ;; + vaxv) + basic_machine=vax-dec + basic_os=sysv + ;; + vms) + basic_machine=vax-dec + basic_os=vms + ;; + vsta) + basic_machine=i386-pc + basic_os=vsta + ;; + vxworks960) + basic_machine=i960-wrs + basic_os=vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + basic_os=vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + basic_os=vxworks + ;; + xbox) + basic_machine=i686-pc + basic_os=mingw32 + ;; + ymp) + basic_machine=ymp-cray + basic_os=unicos + ;; + *) + basic_machine=$1 + basic_os= + ;; + esac ;; esac -# Decode aliases for certain CPU-COMPANY combinations. +# Decode 1-component or ad-hoc basic machines case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | aarch64 | aarch64_be \ - | alpha | alphaev4-8 | alphaev56 | alphaev678 | alphapca567 \ - | alpha64 | alpha64ev4-8 | alpha64ev56 | alpha64ev678 | alpha64pca567 \ - | am33_2.0 \ - | arc | arceb \ - | arm | armble | armelb | armv2-8 | armv3-8lb | armv7arm \ - | avr | avr32 \ - | ba \ - | be32 | be64 \ - | bfin \ - | c4x | c8051 | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | e2k | epiphany \ - | fido | fr30 | frv | ft32 \ - | h8300 | h8500 | hppa | hppa1.01 | hppa2.0 | hppa2.0nw | hppa64 \ - | hexagon \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | k1om \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa32r6 | mipsisa32r6el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64r6 | mipsisa64r6el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipsr5900 | mipsr5900el \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 | nios2eb | nios2el \ - | ns16k | ns32k \ - | open8 | or1k | or1knd | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | riscv32 | riscv64 \ - | rl78 | rx \ - | score \ - | sh | sh1234 | sh24a | sh24aeb | sh23e | sh234eb | sheb | shbe | shle | sh1234le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | visium \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - leon|leon3-9) - basic_machine=sparc-$basic_machine - ;; - m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) - basic_machine=$basic_machine-unknown - os=-none + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. + w89k) + cpu=hppa1.1 + vendor=winbond ;; - m88110 | m680123460 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + op50n) + cpu=hppa1.1 + vendor=oki ;; - ms1) - basic_machine=mt-unknown + op60c) + cpu=hppa1.1 + vendor=oki ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown + ibm*) + cpu=i370 + vendor=ibm ;; - xgate) - basic_machine=$basic_machine-unknown - os=-none + orion105) + cpu=clipper + vendor=highlevel ;; - xscaleeb) - basic_machine=armeb-unknown + mac | mpw | mac-mpw) + cpu=m68k + vendor=apple ;; - - xscaleel) - basic_machine=armel-unknown + pmac | pmac-mpw) + cpu=powerpc + vendor=apple ;; - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | aarch64-* | aarch64_be-* \ - | alpha-* | alphaev4-8-* | alphaev56-* | alphaev678-* \ - | alpha64-* | alpha64ev4-8-* | alpha64ev56-* | alpha64ev678-* \ - | alphapca567-* | alpha64pca567-* | arc-* | arceb-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | avr-* | avr32-* \ - | ba-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c123* | c30-* | cjt90-* | c4x-* \ - | c8051-* | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | e2k-* | elxsi-* \ - | f3001-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hppa-* | hppa1.01-* | hppa2.0-* | hppa2.0nw-* | hppa64-* \ - | hexagon-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | k1om-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m6800123460-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ - | microblaze-* | microblazeel-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa32r6-* | mipsisa32r6el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64r6-* | mipsisa64r6el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipsr5900-* | mipsr5900el-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* | nios2eb-* | nios2el-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | or1k*-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | riscv32-* | riscv64-* \ - | rl78-* | romp-* | rs6000-* | rx-* \ - | sh-* | sh1234-* | sh24a-* | sh24aeb-* | sh23e-* | sh34eb-* | sheb-* | shbe-* \ - | shle-* | sh1234le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | visium-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att + cpu=m68000 + vendor=att ;; 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^^-*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - asmjs) - basic_machine=asmjs-unknown - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^^-*-//'` - os=-linux + cpu=we32k + vendor=att ;; bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^^-*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^^-*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^^-*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec + cpu=powerpc + vendor=ibm + basic_os=cnk ;; decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 + cpu=pdp10 + vendor=dec + basic_os=tops10 ;; decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 + cpu=pdp10 + vendor=dec + basic_os=tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos + cpu=m68k + vendor=motorola ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - e500v12) - basic_machine=powerpc-unknown - os=$os"spe" - ;; - e500v12-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^^-*-//'` - os=$os"spe" - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd + dpx2*) + cpu=m68k + vendor=bull + basic_os=sysv3 ;; encore | umax | mmax) - basic_machine=ns32k-encore + cpu=ns32k + vendor=encore ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose + elxsi) + cpu=elxsi + vendor=elxsi + basic_os=${basic_os:-bsd} ;; fx2800) - basic_machine=i860-alliant + cpu=i860 + vendor=alliant ;; genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 + cpu=ns32k + vendor=ns ;; h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; hp3k90-90-9 | hp90-90-9) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k20-90-9 | hp9k310-9) - basic_machine=m68000-hp + cpu=m68000 + vendor=hp ;; hp9k32-90-9) - basic_machine=m68k-hp + cpu=m68k + vendor=hp ;; hp9k60-90-9 | hp60-90-9) - basic_machine=hppa1.0-hp + cpu=hppa1.0 + vendor=hp ;; hp9k70-790-9 | hp70-790-9) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k780-9 | hp780-9) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k8671 | hp8671 | hp9k8024 | hp8024 | hp9k8789 | hp8789 | hp9k893 | hp893) # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k80-913679 | hp80-913679) - basic_machine=hppa1.1-hp + cpu=hppa1.1 + vendor=hp ;; hp9k80-90-9 | hp80-90-9) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm + cpu=hppa1.0 + vendor=hp ;; i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv32 ;; i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv4 ;; i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=sysv ;; i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 + cpu=`echo "$1" | sed -e 's/86.*/86/'` + vendor=pc + basic_os=solaris2 ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta + j90 | j90-cray) + cpu=j90 + vendor=cray + basic_os=${basic_os:-unicos} ;; iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) + cpu=mips + vendor=sgi + case $basic_os in + irix*) ;; *) - os=-irix4 + basic_os=irix4 ;; esac ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - leon-*|leon3-9-*) - basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'` - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^^-*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze*) - basic_machine=microblaze-xilinx - ;; - mingw64) - basic_machine=x86_64-pc - os=-mingw64 - ;; - mingw32) - basic_machine=i686-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint0-9* | *MiNT | *MiNT0-9*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - moxiebox) - basic_machine=moxie-unknown - os=-moxiebox - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - msys) - basic_machine=i686-pc - os=-msys - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl + cpu=m68000 + vendor=convergent ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos + *mint | mint0-9* | *MiNT | *MiNT0-9*) + cpu=m68k + vendor=atari + basic_os=mint ;; news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) + cpu=mips + vendor=sony + basic_os=newsos + ;; + next | m*-next) + cpu=m68k + vendor=next + case $basic_os in + openstep*) + ;; + nextstep*) ;; - -ns2*) - os=-nextstep2 + ns2*) + basic_os=nextstep2 ;; *) - os=-nextstep3 + basic_os=nextstep3 ;; esac ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh45000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem + cpu=np1 + vendor=gould ;; op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k + cpu=hppa1.1 + vendor=oki + basic_os=proelf ;; pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^^-*-//'` - os=-linux + cpu=hppa1.1 + vendor=hitachi + basic_os=hiuxwe2 ;; pbd) - basic_machine=sparc-tti + cpu=sparc + vendor=tti ;; pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc + cpu=m68k + vendor=tti ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^^-*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^^-*-//'` + pc532) + cpu=ns32k + vendor=pc532 ;; pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown + cpu=pn + vendor=gould ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^^-*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^^-*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^^-*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^^-*-//'` + power) + cpu=power + vendor=ibm ;; ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos | rdos64) - basic_machine=x86_64-pc - os=-rdos - ;; - rdos32) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff + cpu=i386 + vendor=ibm ;; rm4600) - basic_machine=mips-siemens + cpu=mips + vendor=siemens ;; rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm + cpu=romp + vendor=ibm ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi + sde) + cpu=mipsisa32 + vendor=sde + basic_os=${basic_os:-elf} ;; - sb1) - basic_machine=mipsisa64sb1-unknown + simso-wrs) + cpu=sparclite + vendor=wrs + basic_os=vxworks ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown + tower | tower-32) + cpu=m68k + vendor=ncr ;; - sde) - basic_machine=mipsisa32-sde - os=-elf + vpp*|vx|vx-*) + cpu=f301 + vendor=fujitsu ;; - sei) - basic_machine=mips-sei - os=-seiux + w65) + cpu=w65 + vendor=wdc ;; - sequent) - basic_machine=i386-sequent + w89k-*) + cpu=hppa1.1 + vendor=winbond + basic_os=proelf ;; - sh) - basic_machine=sh-hitachi - os=-hms + none) + cpu=none + vendor=none ;; - sh5el) - basic_machine=sh5le-unknown + leon|leon3-9) + cpu=sparc + vendor=$basic_machine ;; - sh64) - basic_machine=sh64-unknown + leon-*|leon3-9-*) + cpu=sparc + vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks + + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read cpu vendor <<EOF +$basic_machine +EOF + IFS=$saved_IFS ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + cpu=$basic_machine + vendor=pc ;; - spur) - basic_machine=spur-unknown + # These rules are duplicated from below for sake of the special case above; + # i.e. things that normalized to x86 arches should also default to "pc" + pc98) + cpu=i386 + vendor=pc ;; - st2000) - basic_machine=m68k-tandem + x64 | amd64) + cpu=x86_64 + vendor=pc ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 + # Recognize the basic CPU types without company name. + *) + cpu=$basic_machine + vendor=unknown ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^^-*-//'` +esac + +unset -v basic_machine + +# Decode basic machines in the full and proper CPU-Company form. +case $cpu-$vendor in + # Here we handle the default manufacturer of certain CPU types in canonical form. It is in + # some cases the only manufacturer, in others, it is the most popular. + craynv-unknown) + vendor=cray + basic_os=${basic_os:-unicosmp} ;; - sun2) - basic_machine=m68000-sun + c90-unknown | c90-cray) + vendor=cray + basic_os=${Basic_os:-unicos} ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 + fx80-unknown) + vendor=alliant ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 + romp-unknown) + vendor=ibm ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 + mmix-unknown) + vendor=knuth ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 + microblaze-unknown | microblazeel-unknown) + vendor=xilinx ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 + rs6000-unknown) + vendor=ibm ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 + vax-unknown) + vendor=dec ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 + pdp11-unknown) + vendor=dec ;; - sun3 | sun3-*) - basic_machine=m68k-sun + we32k-unknown) + vendor=att ;; - sun4) - basic_machine=sparc-sun + cydra-unknown) + vendor=cydrome ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun + i370-ibm*) + vendor=ibm ;; - sv1) - basic_machine=sv1-cray - os=-unicos + orion-unknown) + vendor=highlevel ;; - symmetry) - basic_machine=i386-sequent - os=-dynix + xps-unknown | xps100-unknown) + cpu=xps100 + vendor=honeywell ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos + + # Here we normalize CPU types with a missing or matching vendor + armh-unknown | armh-alt) + cpu=armv7l + vendor=alt + basic_os=${basic_os:-linux-gnueabihf} ;; - t90) - basic_machine=t90-cray - os=-unicos + dpx20-unknown | dpx20-bull) + cpu=rs6000 + vendor=bull + basic_os=${basic_os:-bosx} ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu + + # Here we normalize CPU types irrespective of the vendor + amd64-*) + cpu=x86_64 ;; - tx39) - basic_machine=mipstx39-unknown + blackfin-*) + cpu=bfin + basic_os=linux ;; - tx39el) - basic_machine=mipstx39el-unknown + c54x-*) + cpu=tic54x ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 + c55x-*) + cpu=tic55x ;; - tower | tower-32) - basic_machine=m68k-ncr + c6x-*) + cpu=tic6x ;; - tpf) - basic_machine=s390x-ibm - os=-tpf + e500v12-*) + cpu=powerpc + basic_os=${basic_os}"spe" ;; - udi29k) - basic_machine=a29k-amd - os=-udi + mips3*-*) + cpu=mips64 ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 + ms1-*) + cpu=mt ;; - v810 | necv810) - basic_machine=v810-nec - os=-none + m68knommu-*) + cpu=m68k + basic_os=linux ;; - vaxv) - basic_machine=vax-dec - os=-sysv + m9s12z-* | m68hcs12z-* | hcs12z-* | s12z-*) + cpu=s12z ;; - vms) - basic_machine=vax-dec - os=-vms + openrisc-*) + cpu=or32 ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu + parisc-*) + cpu=hppa + basic_os=linux ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + cpu=i586 ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks + pentiumpro-* | p6-* | 6x86-* | athlon-* | athalon_*-*) + cpu=i686 ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + cpu=i686 ;; - w65*) - basic_machine=w65-wdc - os=-none + pentium4-*) + cpu=i786 ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf + pc98-*) + cpu=i386 ;; - xbox) - basic_machine=i686-pc - os=-mingw32 + ppc-* | ppcbe-*) + cpu=powerpc ;; - xps | xps100) - basic_machine=xps100-honeywell + ppcle-* | powerpclittle-*) + cpu=powerpcle ;; - xscale-* | xscaleebl-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` + ppc64-*) + cpu=powerpc64 ;; - ymp) - basic_machine=ymp-cray - os=-unicos + ppc64le-* | powerpc64little-*) + cpu=powerpc64le ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim + sb1-*) + cpu=mipsisa64sb1 ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim + sb1el-*) + cpu=mipsisa64sb1el ;; - none) - basic_machine=none-none - os=-none + sh5elb-*) + cpu=`echo "$cpu" | sed 's/^\(sh.\)e\(.\)$/\1\2e/'` ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond + spur-*) + cpu=spur ;; - op50n) - basic_machine=hppa1.1-oki + strongarm-* | thumb-*) + cpu=arm ;; - op60c) - basic_machine=hppa1.1-oki + tx39-*) + cpu=mipstx39 ;; - romp) - basic_machine=romp-ibm + tx39el-*) + cpu=mipstx39el ;; - mmix) - basic_machine=mmix-knuth + x64-*) + cpu=x86_64 ;; - rs6000) - basic_machine=rs6000-ibm + xscale-* | xscaleebl-*) + cpu=`echo "$cpu" | sed 's/^xscale/arm/'` ;; - vax) - basic_machine=vax-dec + arm64-* | aarch64le-*) + cpu=aarch64 ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown + + # Recognize the canonical CPU Types that limit and/or modify the + # company names they are paired with. + cr16-*) + basic_os=${basic_os:-elf} ;; - pdp11) - basic_machine=pdp11-dec + crisv32-* | etraxfs*-*) + cpu=crisv32 + vendor=axis ;; - we32k) - basic_machine=we32k-att + cris-* | etrax*-*) + cpu=cris + vendor=axis ;; - sh1234 | sh24a | sh24aeb | sh34eb | sh1234le | sh23ele) - basic_machine=sh-unknown + crx-*) + basic_os=${basic_os:-elf} ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun + neo-tandem) + cpu=neo + vendor=tandem ;; - cydra) - basic_machine=cydra-cydrome + nse-tandem) + cpu=nse + vendor=tandem ;; - orion) - basic_machine=orion-highlevel + nsr-tandem) + cpu=nsr + vendor=tandem ;; - orion105) - basic_machine=clipper-highlevel + nsv-tandem) + cpu=nsv + vendor=tandem ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple + nsx-tandem) + cpu=nsx + vendor=tandem ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple + mipsallegrexel-sony) + cpu=mipsallegrexel + vendor=sony ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. + tile*-*) + basic_os=${basic_os:-linux-gnu} ;; + *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 + # Recognize the canonical CPU types that are allowed with any + # company name. + case $cpu in + 1750a | 580 \ + | a29k \ + | aarch64 | aarch64_be \ + | abacus \ + | alpha | alphaev4-8 | alphaev56 | alphaev678 \ + | alpha64 | alpha64ev4-8 | alpha64ev56 | alpha64ev678 \ + | alphapca567 | alpha64pca567 \ + | am33_2.0 \ + | amdgcn \ + | arc | arceb | arc32 | arc64 \ + | arm | armlbe | armelb | armv* \ + | avr | avr32 \ + | asmjs \ + | ba \ + | be32 | be64 \ + | bfin | bpf | bs2000 \ + | c123* | c30 | cjt90 | c4x \ + | c8051 | clipper | craynv | csky | cydra \ + | d10v | d30v | dlx | dsp16xx \ + | e2k | elxsi | epiphany \ + | f3001 | f700 | fido | fr30 | frv | ft32 | fx80 \ + | h8300 | h8500 \ + | hppa | hppa1.01 | hppa2.0 | hppa2.0nw | hppa64 \ + | hexagon \ + | i370 | i*86 | i860 | i960 | ia16 | ia64 \ + | ip2k | iq2000 \ + | k1om \ + | le32 | le64 \ + | lm32 \ + | loongarch32 | loongarch64 | loongarchx32 \ + | m32c | m32r | m32rle \ + | m5200 | m68000 | m6800123460 | m68360 | m683?2 | m68k \ + | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \ + | m88110 | m88k | maxq | mb | mcore | mep | metag \ + | microblaze | microblazeel \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64eb | mips64el \ + | mips64octeon | mips64octeonel \ + | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa32r3 | mipsisa32r3el \ + | mipsisa32r5 | mipsisa32r5el \ + | mipsisa32r6 | mipsisa32r6el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64r3 | mipsisa64r3el \ + | mipsisa64r5 | mipsisa64r5el \ + | mipsisa64r6 | mipsisa64r6el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipsr5900 | mipsr5900el \ + | mipstx39 | mipstx39el \ + | mmix \ + | mn10200 | mn10300 \ + | moxie \ + | mt \ + | msp430 \ + | nds32 | nds32le | nds32be \ + | nfp \ + | nios | nios2 | nios2eb | nios2el \ + | none | np1 | ns16k | ns32k | nvptx \ + | open8 \ + | or1k* \ + | or32 \ + | orion \ + | picochip \ + | pdp10 | pdp11 | pj | pjl | pn | power \ + | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \ + | pru \ + | pyramid \ + | riscv | riscv32 | riscv32be | riscv64 | riscv64be \ + | rl78 | romp | rs6000 | rx \ + | s390 | s390x \ + | score \ + | sh | shl \ + | sh1234 | sh24a | sh24aelb | sh23e | shelb | shlbe \ + | sh1234elb | sh12345lbe | sh23ele | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \ + | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \ + | spu \ + | tahoe \ + | thumbv7* \ + | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \ + | tron \ + | ubicom32 \ + | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \ + | vax \ + | visium \ + | w65 \ + | wasm32 | wasm64 \ + | we32k \ + | x86 | x86_64 | xc16x | xgate | xps100 \ + | xstormy16 | xtensa* \ + | ymp \ + | z8k | z80) + ;; + + *) + echo Invalid configuration \`"$1"\': machine \`"$cpu-$vendor"\' not recognized 1>&2 + exit 1 + ;; + esac ;; esac # Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` +case $vendor in + digital*) + vendor=dec ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + commodore*) + vendor=cbm ;; *) ;; @@ -1353,203 +1306,215 @@ # Decode manufacturer-specific aliases for certain operating systems. -if x"$os" != x"" +if test x$basic_os != x then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux + +# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just +# set os. +case $basic_os in + gnu/linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` + ;; + os2-emx) + kernel=os2 + os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` + ;; + nto-qnx*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` + ;; + *-*) + # shellcheck disable=SC2162 + saved_IFS=$IFS + IFS="-" read kernel os <<EOF +$basic_os +EOF + IFS=$saved_IFS + ;; + # Default OS when just kernel was specified + nto*) + kernel=nto + os=`echo "$basic_os" | sed -e 's|nto|qnx|'` + ;; + linux*) + kernel=linux + os=`echo "$basic_os" | sed -e 's|linux|gnu|'` ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` + *) + kernel= + os=$basic_os + ;; +esac + +# Now, normalize the OS (knowing we just have one component, it's not a kernel, +# etc.) +case $os in + # First match some system type aliases that might get confused + # with valid system types. + # solaris* is a basic system type, with this one exception. + auroraux) + os=auroraux ;; - -solaris) - os=-solaris2 + bluegene*) + os=cnk ;; - -svr4*) - os=-sysv4 + solaris1 | solaris1.*) + os=`echo "$os" | sed -e 's|solaris1|sunos4|'` ;; - -unixware*) - os=-sysv4.2uw + solaris) + os=solaris2 ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + unixware*) + os=sysv4.2uw ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos34*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* | -plan9* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* | -cloudabi* | -sortix* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-musl* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \ - | -onefs* | -tirtos* | -phoenix*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac + # es1800 is here to avoid being matched by es* (a different OS) + es1800*) + os=ose ;; - -nto-qnx*) + # Some version numbers need modification + chorusos*) + os=chorusos ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` + isc) + os=isc2.2 ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + sco6) + os=sco5v6 ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` + sco5) + os=sco3.2v5 ;; - -linux-dietlibc) - os=-linux-dietlibc + sco4) + os=sco3.2v4 ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` + sco3.2.4-9*) + os=`echo "$os" | sed -e 's/sco3.2./sco3.2v/'` ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` + sco*v* | scout) + # Don't match below ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` + sco*) + os=sco3.2v2 ;; - -opened*) - os=-openedition + psos*) + os=psos ;; - -os400*) - os=-os400 + qnx*) + os=qnx ;; - -wince*) - os=-wince + hiux*) + os=hiuxwe2 ;; - -osfrose*) - os=-osfrose + lynx*178) + os=lynxos178 ;; - -osf*) - os=-osf + lynx*5) + os=lynxos5 ;; - -utek*) - os=-bsd + lynxos*) + # don't get caught up in next wildcard ;; - -dynix*) - os=-bsd + lynx*) + os=lynxos ;; - -acis*) - os=-aos + mac0-9*) + os=`echo "$os" | sed -e 's|mac|macos|'` ;; - -atheos*) - os=-atheos + opened*) + os=openedition ;; - -syllable*) - os=-syllable + os400*) + os=os400 ;; - -386bsd) - os=-bsd + sunos5*) + os=`echo "$os" | sed -e 's|sunos5|solaris2|'` ;; - -ctix* | -uts*) - os=-sysv + sunos6*) + os=`echo "$os" | sed -e 's|sunos6|solaris3|'` ;; - -nova*) - os=-rtmk-nova + wince*) + os=wince ;; - -ns2 ) - os=-nextstep2 + utek*) + os=bsd ;; - -nsk*) - os=-nsk + dynix*) + os=bsd ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` + acis*) + os=aos ;; - -sinix*) - os=-sysv4 + atheos*) + os=atheos ;; - -tpf*) - os=-tpf + syllable*) + os=syllable ;; - -triton*) - os=-sysv3 + 386bsd) + os=bsd ;; - -oss*) - os=-sysv3 + ctix* | uts*) + os=sysv ;; - -svr4) - os=-sysv4 + nova*) + os=rtmk-nova ;; - -svr3) - os=-sysv3 + ns2) + os=nextstep2 ;; - -sysvr4) - os=-sysv4 + # Preserve the version number of sinix5. + sinix5.*) + os=`echo "$os" | sed -e 's|sinix|sysv|'` ;; - # This must come after -sysvr4. - -sysv*) + sinix*) + os=sysv4 ;; - -ose*) - os=-ose + tpf*) + os=tpf ;; - -es1800*) - os=-ose + triton*) + os=sysv3 ;; - -xenix) - os=-xenix + oss*) + os=sysv3 ;; - -*mint | -mint0-9* | -*MiNT | -MiNT0-9*) - os=-mint + svr4*) + os=sysv4 ;; - -aros*) - os=-aros + svr3) + os=sysv3 ;; - -zvmoe) - os=-zvmoe + sysvr4) + os=sysv4 ;; - -dicos*) - os=-dicos + ose*) + os=ose ;; - -nacl*) + *mint | mint0-9* | *MiNT | MiNT0-9*) + os=mint ;; - -ios) + dicos*) + os=dicos ;; - -none) + pikeos*) + # Until real need of OS specific support for + # particular features comes up, bare metal + # configurations are quite functional. + case $cpu in + arm*) + os=eabi + ;; + *) + os=elf + ;; + esac ;; *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/^-*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 + # No normalization, but not necessarily accepted, that comes below. ;; esac + else # Here we handle the default operating systems that come with various machines. @@ -1562,261 +1527,363 @@ # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. -case $basic_machine in +kernel= +case $cpu-$vendor in score-*) - os=-elf + os=elf ;; spu-*) - os=-elf + os=elf ;; *-acorn) - os=-riscix1.2 + os=riscix1.2 ;; arm*-rebel) - os=-linux + kernel=linux + os=gnu ;; arm*-semi) - os=-aout + os=aout ;; c4x-* | tic4x-*) - os=-coff + os=coff ;; c8051-*) - os=-elf + os=elf + ;; + clipper-intergraph) + os=clix ;; hexagon-*) - os=-elf + os=elf ;; tic54x-*) - os=-coff + os=coff ;; tic55x-*) - os=-coff + os=coff ;; tic6x-*) - os=-coff + os=coff ;; # This must come before the *-dec entry. pdp10-*) - os=-tops20 + os=tops20 ;; pdp11-*) - os=-none + os=none ;; *-dec | vax-*) - os=-ultrix4.2 + os=ultrix4.2 ;; m68*-apollo) - os=-domain + os=domain ;; i386-sun) - os=-sunos4.0.2 + os=sunos4.0.2 ;; m68000-sun) - os=-sunos3 + os=sunos3 ;; m68*-cisco) - os=-aout + os=aout ;; mep-*) - os=-elf + os=elf ;; mips*-cisco) - os=-elf + os=elf ;; mips*-*) - os=-elf + os=elf ;; or32-*) - os=-coff + os=coff ;; *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 + os=sysv3 ;; sparc-* | *-sun) - os=-sunos4.1.1 + os=sunos4.1.1 ;; - *-be) - os=-beos + pru-*) + os=elf ;; - *-haiku) - os=-haiku + *-be) + os=beos ;; *-ibm) - os=-aix + os=aix ;; *-knuth) - os=-mmixware + os=mmixware ;; *-wec) - os=-proelf + os=proelf ;; *-winbond) - os=-proelf + os=proelf ;; *-oki) - os=-proelf + os=proelf ;; *-hp) - os=-hpux + os=hpux ;; *-hitachi) - os=-hiux + os=hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv + os=sysv ;; *-cbm) - os=-amigaos + os=amigaos ;; *-dg) - os=-dgux + os=dgux ;; *-dolphin) - os=-sysv3 + os=sysv3 ;; m68k-ccur) - os=-rtu + os=rtu ;; m88k-omron*) - os=-luna + os=luna ;; - *-next ) - os=-nextstep + *-next) + os=nextstep ;; *-sequent) - os=-ptx + os=ptx ;; *-crds) - os=-unos + os=unos ;; *-ns) - os=-genix + os=genix ;; i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 + os=mvs ;; *-gould) - os=-sysv + os=sysv ;; *-highlevel) - os=-bsd + os=bsd ;; *-encore) - os=-bsd + os=bsd ;; *-sgi) - os=-irix + os=irix ;; *-siemens) - os=-sysv4 + os=sysv4 ;; *-masscomp) - os=-rtu + os=rtu ;; f3001-fujitsu | f700-fujitsu) - os=-uxpv + os=uxpv ;; *-rom68k) - os=-coff + os=coff ;; *-*bug) - os=-coff + os=coff ;; *-apple) - os=-macos + os=macos ;; *-atari*) - os=-mint + os=mint + ;; + *-wrs) + os=vxworks ;; *) - os=-none + os=none ;; esac + fi +# Now, validate our (potentially fixed-up) OS. +case $os in + # Sometimes we do "kernel-libc", so those need to count as OSes. + musl* | newlib* | relibc* | uclibc*) + ;; + # Likewise for "kernel-abi" + eabi* | gnueabi*) + ;; + # VxWorks passes extra cpu info in the 4th filed. + simlinux | simwindows | spe) + ;; + # Now accept the basic system types. + # The portable systems comes first. + # Each alternative MUST end in a * to match a version number. + gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \ + | *vms* | esix* | aix* | cnk* | sunos | sunos34* \ + | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \ + | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \ + | hiux* | abug | nacl* | netware* | windows* \ + | os9* | macos* | osx* | ios* \ + | mpw* | magic* | mmixware* | mon960* | lnews* \ + | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \ + | aos* | aros* | cloudabi* | sortix* | twizzler* \ + | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \ + | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \ + | mirbsd* | netbsd* | dicos* | openedition* | ose* \ + | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \ + | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \ + | bosx* | nextstep* | cxux* | aout* | elf* | oabi* \ + | ptx* | coff* | ecoff* | winnt* | domain* | vsta* \ + | udi* | lites* | ieee* | go32* | aux* | hcos* \ + | chorusrdb* | cegcc* | glidix* | serenity* \ + | cygwin* | msys* | pe* | moss* | proelf* | rtems* \ + | midipix* | mingw32* | mingw64* | mint* \ + | uxpv* | beos* | mpeix* | udk* | moxiebox* \ + | interix* | uwin* | mks* | rhapsody* | darwin* \ + | openstep* | oskit* | conix* | pw32* | nonstopux* \ + | storm-chaos* | tops10* | tenex* | tops20* | its* \ + | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \ + | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \ + | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \ + | skyos* | haiku* | rdos* | toppers* | drops* | es* \ + | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \ + | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \ + | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \ + | fiwix* ) + ;; + # This one is extra strict with allowed versions + sco3.2v2 | sco3.2v4-9* | sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + ;; + none) + ;; + *) + echo Invalid configuration \`"$1"\': OS \`"$os"\' not recognized 1>&2 + exit 1 + ;; +esac + +# As a final step for OS-related things, validate the OS-kernel combination +# (given a valid OS), if there is a kernel. +case $kernel-$os in + linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ + | linux-musl* | linux-relibc* | linux-uclibc* ) + ;; + uclinux-uclibc* ) + ;; + -dietlibc* | -newlib* | -musl* | -relibc* | -uclibc* ) + # These are just libc implementations, not actual OSes, and thus + # require a kernel. + echo "Invalid configuration \`$1': libc \`$os' needs explicit kernel." 1>&2 + exit 1 + ;; + kfreebsd*-gnu* | kopensolaris*-gnu*) + ;; + vxworks-simlinux | vxworks-simwindows | vxworks-spe) + ;; + nto-qnx*) + ;; + os2-emx) + ;; + *-eabi* | *-gnueabi*) + ;; + -*) + # Blank kernel with real OS is always fine. + ;; + *-*) + echo "Invalid configuration \`$1': Kernel \`$kernel' not known to work with OS \`$os'." 1>&2 + exit 1 + ;; +esac + # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) +case $vendor in + unknown) + case $cpu-$os in + *-riscix*) vendor=acorn ;; - -sunos*) + *-sunos*) vendor=sun ;; - -cnk*|-aix*) + *-cnk* | *-aix*) vendor=ibm ;; - -beos*) + *-beos*) vendor=be ;; - -hpux*) + *-hpux*) vendor=hp ;; - -mpeix*) + *-mpeix*) vendor=hp ;; - -hiux*) + *-hiux*) vendor=hitachi ;; - -unos*) + *-unos*) vendor=crds ;; - -dgux*) + *-dgux*) vendor=dg ;; - -luna*) + *-luna*) vendor=omron ;; - -genix*) + *-genix*) vendor=ns ;; - -mvs* | -opened*) + *-clix*) + vendor=intergraph + ;; + *-mvs* | *-opened*) + vendor=ibm + ;; + *-os400*) vendor=ibm ;; - -os400*) + s390-* | s390x-*) vendor=ibm ;; - -ptx*) + *-ptx*) vendor=sequent ;; - -tpf*) + *-tpf*) vendor=ibm ;; - -vxsim* | -vxworks* | -windiss*) + *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; - -aux*) + *-aux*) vendor=apple ;; - -hms*) + *-hms*) vendor=hitachi ;; - -mpw* | -macos*) + *-mpw* | *-macos*) vendor=apple ;; - -*mint | -mint0-9* | -*MiNT | -MiNT0-9*) + *-*mint | *-mint0-9* | *-*MiNT | *-MiNT0-9*) vendor=atari ;; - -vos*) + *-vos*) vendor=stratus ;; esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac -echo $basic_machine$os +echo "$cpu-$vendor-${kernel:+$kernel-}$os" exit # Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) +# eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/build-aux/ltmain.sh -> _service:tar_scm:gpgme-1.21.0.tar.bz2/build-aux/ltmain.sh
Changed
@@ -6766,6 +6766,11 @@ elif test -n "$soname_spec"; then # bleh windows case $host in + x86_64-*mingw32*) + func_arith $current - $age + major=$func_arith_result + versuffix="6-$major" + ;; *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result @@ -7499,6 +7504,14 @@ func_arith $current - $age major=$func_arith_result versuffix="-$major" + case $host in + x86_64-*mingw32*) + versuffix="6-$major" + ;; + *) + versuffix="-$major" + ;; + esac ;; *)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/conf/config.h.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/conf/config.h.in
Changed
@@ -42,6 +42,9 @@ /* define if the compiler supports basic C++11 syntax */ #undef HAVE_CXX11 +/* define if the compiler supports basic C++17 syntax */ +#undef HAVE_CXX17 + /* Define to 1 if you have the declaration of `ttyname_r', and to 0 if you don't. */ #undef HAVE_DECL_TTYNAME_R @@ -59,6 +62,9 @@ /* Define to 1 if fseeko (and presumably ftello) exists and is declared. */ #undef HAVE_FSEEKO +/* Define to 1 if the system has the `visibility' function attribute */ +#undef HAVE_FUNC_ATTRIBUTE_VISIBILITY + /* Define to 1 if you have the `getegid' function. */ #undef HAVE_GETEGID @@ -80,6 +86,9 @@ /* Define to 1 if you have the <memory.h> header file. */ #undef HAVE_MEMORY_H +/* Define to 1 if you have the `nanosleep' function. */ +#undef HAVE_NANOSLEEP + /* Define to 1 if you have the <poll.h> header file. */ #undef HAVE_POLL_H @@ -286,6 +295,9 @@ # define GPGME_GCC_A_PURE #endif +/* Under Windows we use the gettext code from gpgrt. */ +#define GPG_ERR_ENABLE_GETTEXT_MACROS 1 + /* Under WindowsCE we need gpg-error's strerror macro. */ #define GPG_ERR_ENABLE_ERRNO_MACROS 1
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/configure -> _service:tar_scm:gpgme-1.21.0.tar.bz2/configure
Changed
@@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for gpgme 1.17.0. +# Generated by GNU Autoconf 2.69 for gpgme 1.21.0. # # Report bugs to <https://bugs.gnupg.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='gpgme' PACKAGE_TARNAME='gpgme' -PACKAGE_VERSION='1.17.0' -PACKAGE_STRING='gpgme 1.17.0' +PACKAGE_VERSION='1.21.0' +PACKAGE_STRING='gpgme 1.21.0' PACKAGE_BUGREPORT='https://bugs.gnupg.org' PACKAGE_URL='' @@ -651,6 +651,8 @@ LIBASSUAN_LIBS LIBASSUAN_CFLAGS LIBASSUAN_CONFIG +USE_GPGRT_CONFIG_FALSE +USE_GPGRT_CONFIG_TRUE GPG_ERROR_MT_LIBS GPG_ERROR_MT_CFLAGS GPG_ERROR_LIBS @@ -686,9 +688,9 @@ pyexecdir pkgpythondir pythondir -PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX +PYTHON_PLATFORM PYTHON_VERSION PYTHON SWIG_LIB @@ -698,14 +700,24 @@ HAVE_DOXYGEN_TRUE GRAPHVIZ DOXYGEN +WANT_QT6_FALSE +WANT_QT6_TRUE +WANT_QT5_FALSE +WANT_QT5_TRUE +GPGME_CPP_CFLAGS +HAVE_CXX11 +HAVE_CXX17 +GPGME_QT6TEST_LIBS +GPGME_QT6TEST_CFLAGS +GPGME_QT6_LIBS +GPGME_QT6_CFLAGS QTCHOOSER MOC2 MOC -GPGME_QTTEST_LIBS -GPGME_QTTEST_CFLAGS -GPGME_QT_LIBS -GPGME_QT_CFLAGS -HAVE_CXX11 +GPGME_QT5TEST_LIBS +GPGME_QT5TEST_CFLAGS +GPGME_QT5_LIBS +GPGME_QT5_CFLAGS BUILD_W32_GLIB_FALSE BUILD_W32_GLIB_TRUE HAVE_MACOS_SYSTEM_FALSE @@ -885,6 +897,9 @@ enable_w32_glib enable_fixed_path enable_languages +with_python_sys_prefix +with_python_prefix +with_python_exec_prefix enable_build_timestamp enable_gpgconf_test enable_gpg_test @@ -913,10 +928,14 @@ CC_FOR_BUILD CXXCPP PKG_CONFIG -GPGME_QT_CFLAGS -GPGME_QT_LIBS -GPGME_QTTEST_CFLAGS -GPGME_QTTEST_LIBS +GPGME_QT5_CFLAGS +GPGME_QT5_LIBS +GPGME_QT5TEST_CFLAGS +GPGME_QT5TEST_LIBS +GPGME_QT6_CFLAGS +GPGME_QT6_LIBS +GPGME_QT6TEST_CFLAGS +GPGME_QT6TEST_LIBS PYTHON PYTHON_VERSION' @@ -1469,7 +1488,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures gpgme 1.17.0 to adapt to many kinds of systems. +\`configure' configures gpgme 1.21.0 to adapt to many kinds of systems. Usage: $0 OPTION... VAR=VALUE... @@ -1540,7 +1559,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of gpgme 1.17.0:";; + short | recursive ) echo "Configuration of gpgme 1.21.0:";; esac cat <<\_ACEOF @@ -1567,7 +1586,9 @@ --enable-fixed-path=PATH locate binaries only via this PATH --enable-languages=languages - enable only specific language bindings + enable only specific language bindings: cl cpp + python qt qt5 qt6 (qt selects qt5 or qt6, and qt5 + and qt6 exclude each other) --enable-build-timestamp set an explicit build timestamp for reproducibility. (default is the current time in ISO-8601 format) @@ -1588,6 +1609,11 @@ --with-gnu-ld assume the C compiler uses GNU ld default=no --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). + --with-python-sys-prefix + use Python's sys.prefix and sys.exec_prefix values + --with-python_prefix override the default PYTHON_PREFIX + --with-python_exec_prefix + override the default PYTHON_EXEC_PREFIX --with-libgpg-error-prefix=PFX prefix where GPG Error is installed (optional) @@ -1610,14 +1636,22 @@ build system C compiler CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility - GPGME_QT_CFLAGS - C compiler flags for GPGME_QT, overriding pkg-config - GPGME_QT_LIBS - linker flags for GPGME_QT, overriding pkg-config - GPGME_QTTEST_CFLAGS - C compiler flags for GPGME_QTTEST, overriding pkg-config - GPGME_QTTEST_LIBS - linker flags for GPGME_QTTEST, overriding pkg-config + GPGME_QT5_CFLAGS + C compiler flags for GPGME_QT5, overriding pkg-config + GPGME_QT5_LIBS + linker flags for GPGME_QT5, overriding pkg-config + GPGME_QT5TEST_CFLAGS + C compiler flags for GPGME_QT5TEST, overriding pkg-config + GPGME_QT5TEST_LIBS + linker flags for GPGME_QT5TEST, overriding pkg-config + GPGME_QT6_CFLAGS + C compiler flags for GPGME_QT6, overriding pkg-config + GPGME_QT6_LIBS + linker flags for GPGME_QT6, overriding pkg-config + GPGME_QT6TEST_CFLAGS + C compiler flags for GPGME_QT6TEST, overriding pkg-config + GPGME_QT6TEST_LIBS + linker flags for GPGME_QT6TEST, overriding pkg-config PYTHON the Python interpreter PYTHON_VERSION The installed Python version to use, for example '2.3'. This @@ -1690,7 +1724,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -gpgme configure 1.17.0 +gpgme configure 1.21.0 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2520,7 +2554,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by gpgme $as_me 1.17.0, which was +It was created by gpgme $as_me 1.21.0, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2885,19 +2919,19 @@ # (Interfaces added: AGE++) # (Interfaces removed: AGE=0) # -LIBGPGME_LT_CURRENT=37 -LIBGPGME_LT_AGE=26 +LIBGPGME_LT_CURRENT=41 +LIBGPGME_LT_AGE=30 LIBGPGME_LT_REVISION=0 # If there is an ABI break in gpgmepp or qgpgme also bump the # version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in -LIBGPGMEPP_LT_CURRENT=20 -LIBGPGMEPP_LT_AGE=14 +LIBGPGMEPP_LT_CURRENT=24 +LIBGPGMEPP_LT_AGE=18 LIBGPGMEPP_LT_REVISION=0 -LIBQGPGME_LT_CURRENT=14 -LIBQGPGME_LT_AGE=7 +LIBQGPGME_LT_CURRENT=18 +LIBQGPGME_LT_AGE=3 LIBQGPGME_LT_REVISION=0 ################################################ @@ -2923,7 +2957,7 @@ VERSION_MAJOR=1 -VERSION_MINOR=17 +VERSION_MINOR=21 VERSION_MICRO=0 ac_aux_dir= @@ -3440,7 +3474,7 @@ # Define the identity of the package. PACKAGE='gpgme' - VERSION='1.17.0' + VERSION='1.21.0' cat >>confdefs.h <<_ACEOF @@ -6500,7 +6534,7 @@ -VERSION_NUMBER=0x011100 +VERSION_NUMBER=0x011500 # We need to compile and run a program on the build machine. A @@ -17417,7 +17451,7 @@ have_macos_system=no build_w32_glib=no build_w32_qt=no -available_languages="cl cpp python qt" +available_languages="cl cpp python qt qt5 qt6" default_languages="cl cpp python qt" case "${host}" in x86_64-*mingw32*) @@ -17672,7 +17706,6 @@ LIBS="$LIBS $GLIB_LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ - #include <glib.h> #include <stdio.h> @@ -17872,11 +17905,169 @@ fi done +# Check whether Qt5 and/or Qt6 are enabled explicitly +want_qt5="no"; + +name="qt5" +list=$enabled_languages +found=0 + +for n in $list; do + if test "x$name" = "x$n"; then + found=1 + fi +done +if test "$found" = "1"; then + want_qt5="yes"; + # Remove qt5; further down qt will be added + enabled_languages=$(echo $enabled_languages | sed 's/qt5//') +fi +want_qt6="no"; -# Enable C++ 11 if cpp language is requested +name="qt6" +list=$enabled_languages +found=0 -name="cpp" +for n in $list; do + if test "x$name" = "x$n"; then + found=1 + fi +done + +if test "$found" = "1"; then + want_qt6="yes"; + # Remove qt6; further down qt will be added + enabled_languages=$(echo $enabled_languages | sed 's/qt6//') +fi +if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then + as_fn_error $? " +*** +*** The bindings for Qt5 and Qt6 cannot be built simultaneously. +***" "$LINENO" 5 +fi + +# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6 + + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PKG_CONFIG in + \\/* | ?:\\/*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG +if test -n "$PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 +$as_echo "$PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_PKG_CONFIG in + \\/* | ?:\\/*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG +if test -n "$ac_pt_PKG_CONFIG"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 +$as_echo "$ac_pt_PKG_CONFIG" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_PKG_CONFIG" = x; then + PKG_CONFIG="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + PKG_CONFIG=$ac_pt_PKG_CONFIG + fi +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=0.9.0 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 +$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + PKG_CONFIG="" + fi + +fi + +# If the generic qt is enabled, then check for Qt5 or Qt6 (in this order) + +name="qt" list=$enabled_languages found=0 @@ -17887,19 +18078,1766 @@ done if test "$found" = "1"; then - ax_cxx_compile_cxx11_required=false + # Remove the generic qt (qt5 and qt6 have already been removed) + enabled_languages=$(echo $enabled_languages | sed 's/qt//') + + have_qt5_libs="no"; + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT5" >&5 +$as_echo_n "checking for GPGME_QT5... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5_CFLAGS"; then + pkg_cv_GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5_CFLAGS=`$PKG_CONFIG --cflags "Qt5Core >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5_LIBS"; then + pkg_cv_GPGME_QT5_LIBS="$GPGME_QT5_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5_LIBS=`$PKG_CONFIG --libs "Qt5Core >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT5_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Core >= 5.0.0"` + else + GPGME_QT5_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Core >= 5.0.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT5_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt5_libs="no" +elif test $pkg_failed = untried; then + have_qt5_libs="no" +else + GPGME_QT5_CFLAGS=$pkg_cv_GPGME_QT5_CFLAGS + GPGME_QT5_LIBS=$pkg_cv_GPGME_QT5_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt5_libs="yes" +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT5TEST" >&5 +$as_echo_n "checking for GPGME_QT5TEST... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5TEST_CFLAGS"; then + pkg_cv_GPGME_QT5TEST_CFLAGS="$GPGME_QT5TEST_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Test >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Test >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5TEST_CFLAGS=`$PKG_CONFIG --cflags "Qt5Test >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5TEST_LIBS"; then + pkg_cv_GPGME_QT5TEST_LIBS="$GPGME_QT5TEST_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Test >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Test >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5TEST_LIBS=`$PKG_CONFIG --libs "Qt5Test >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT5TEST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Test >= 5.0.0"` + else + GPGME_QT5TEST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Test >= 5.0.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT5TEST_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt5test_libs="no" +elif test $pkg_failed = untried; then + have_qt5test_libs="no" +else + GPGME_QT5TEST_CFLAGS=$pkg_cv_GPGME_QT5TEST_CFLAGS + GPGME_QT5TEST_LIBS=$pkg_cv_GPGME_QT5TEST_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt5test_libs="yes" +fi + + if ! test "$have_w32_system" = yes; then + if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fpic" + fi + fi + if test "$have_qt5_libs" = "yes"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args. +set dummy ${ac_tool_prefix}moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MOC"; then + ac_cv_prog_MOC="$MOC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MOC="${ac_tool_prefix}moc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MOC=$ac_cv_prog_MOC +if test -n "$MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 +$as_echo "$MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MOC"; then + ac_ct_MOC=$MOC + # Extract the first word of "moc", so it can be a program name with args. +set dummy moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MOC"; then + ac_cv_prog_ac_ct_MOC="$ac_ct_MOC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MOC="moc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MOC=$ac_cv_prog_ac_ct_MOC +if test -n "$ac_ct_MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MOC" >&5 +$as_echo "$ac_ct_MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MOC" = x; then + MOC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MOC=$ac_ct_MOC + fi +else + MOC="$ac_cv_prog_MOC" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking moc version" >&5 +$as_echo_n "checking moc version... " >&6; } + mocversion=`$MOC -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + # moc was not the qt5 one, try with moc-qt5 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}moc-qt5", so it can be a program name with args. +set dummy ${ac_tool_prefix}moc-qt5; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MOC2+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MOC2"; then + ac_cv_prog_MOC2="$MOC2" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MOC2="${ac_tool_prefix}moc-qt5" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MOC2=$ac_cv_prog_MOC2 +if test -n "$MOC2"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC2" >&5 +$as_echo "$MOC2" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MOC2"; then + ac_ct_MOC2=$MOC2 + # Extract the first word of "moc-qt5", so it can be a program name with args. +set dummy moc-qt5; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MOC2+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MOC2"; then + ac_cv_prog_ac_ct_MOC2="$ac_ct_MOC2" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MOC2="moc-qt5" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MOC2=$ac_cv_prog_ac_ct_MOC2 +if test -n "$ac_ct_MOC2"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MOC2" >&5 +$as_echo "$ac_ct_MOC2" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MOC2" = x; then + MOC2="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MOC2=$ac_ct_MOC2 + fi +else + MOC2="$ac_cv_prog_MOC2" +fi + + mocversion=`$MOC2 -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}qtchooser", so it can be a program name with args. +set dummy ${ac_tool_prefix}qtchooser; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_QTCHOOSER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$QTCHOOSER"; then + ac_cv_prog_QTCHOOSER="$QTCHOOSER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_QTCHOOSER="${ac_tool_prefix}qtchooser" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +QTCHOOSER=$ac_cv_prog_QTCHOOSER +if test -n "$QTCHOOSER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QTCHOOSER" >&5 +$as_echo "$QTCHOOSER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_QTCHOOSER"; then + ac_ct_QTCHOOSER=$QTCHOOSER + # Extract the first word of "qtchooser", so it can be a program name with args. +set dummy qtchooser; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_QTCHOOSER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_QTCHOOSER"; then + ac_cv_prog_ac_ct_QTCHOOSER="$ac_ct_QTCHOOSER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_QTCHOOSER="qtchooser" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_QTCHOOSER=$ac_cv_prog_ac_ct_QTCHOOSER +if test -n "$ac_ct_QTCHOOSER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_QTCHOOSER" >&5 +$as_echo "$ac_ct_QTCHOOSER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_QTCHOOSER" = x; then + QTCHOOSER="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + QTCHOOSER=$ac_ct_QTCHOOSER + fi +else + QTCHOOSER="$ac_cv_prog_QTCHOOSER" +fi + + qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` + mocversion=`$qt5tooldir/moc -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + # no valid moc found + have_qt5_libs="no"; + else + MOC=$qt5tooldir/moc + fi + else + MOC=$MOC2 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mocversion" >&5 +$as_echo "$mocversion" >&6; } + fi + if test "$have_qt5_libs" = "yes"; then + OLDCPPFLAGS=$CPPFLAGS + CPPFLAGS=$GPGME_QT5_CFLAGS + OLDLIBS=$LIBS + LIBS=$GPGME_QT5_LIBS + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built" >&5 +$as_echo_n "checking whether a simple qt program can be built... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_qt5_libs='yes' +else + have_qt5_libs='no' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt5_libs" >&5 +$as_echo "$have_qt5_libs" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi + + if test "$have_qt5_libs" = "yes"; then + want_qt5="yes"; + else + + have_qt6_libs="no"; + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT6" >&5 +$as_echo_n "checking for GPGME_QT6... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6_CFLAGS"; then + pkg_cv_GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Core >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Core >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6_CFLAGS=`$PKG_CONFIG --cflags "Qt6Core >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6_LIBS"; then + pkg_cv_GPGME_QT6_LIBS="$GPGME_QT6_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Core >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Core >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6_LIBS=`$PKG_CONFIG --libs "Qt6Core >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT6_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt6Core >= 6.4.0"` + else + GPGME_QT6_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt6Core >= 6.4.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT6_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt6_libs="no" +elif test $pkg_failed = untried; then + have_qt6_libs="no" +else + GPGME_QT6_CFLAGS=$pkg_cv_GPGME_QT6_CFLAGS + GPGME_QT6_LIBS=$pkg_cv_GPGME_QT6_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt6_libs="yes" +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT6TEST" >&5 +$as_echo_n "checking for GPGME_QT6TEST... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6TEST_CFLAGS"; then + pkg_cv_GPGME_QT6TEST_CFLAGS="$GPGME_QT6TEST_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Test >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Test >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6TEST_CFLAGS=`$PKG_CONFIG --cflags "Qt6Test >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6TEST_LIBS"; then + pkg_cv_GPGME_QT6TEST_LIBS="$GPGME_QT6TEST_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Test >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Test >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6TEST_LIBS=`$PKG_CONFIG --libs "Qt6Test >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT6TEST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt6Test >= 6.4.0"` + else + GPGME_QT6TEST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt6Test >= 6.4.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT6TEST_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt6test_libs="no" +elif test $pkg_failed = untried; then + have_qt6test_libs="no" +else + GPGME_QT6TEST_CFLAGS=$pkg_cv_GPGME_QT6TEST_CFLAGS + GPGME_QT6TEST_LIBS=$pkg_cv_GPGME_QT6TEST_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt6test_libs="yes" +fi + + if test "$have_qt6_libs" = "yes"; then + # Qt6 moved moc to libexec + qt6libexecdir=$($PKG_CONFIG --variable=libexecdir 'Qt6Core >= 6.4.0') + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args. +set dummy ${ac_tool_prefix}moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MOC in + \\/* | ?:\\/*) + ac_cv_path_MOC="$MOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $qt6libexecdir +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MOC=$ac_cv_path_MOC +if test -n "$MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 +$as_echo "$MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_MOC"; then + ac_pt_MOC=$MOC + # Extract the first word of "moc", so it can be a program name with args. +set dummy moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_MOC in + \\/* | ?:\\/*) + ac_cv_path_ac_pt_MOC="$ac_pt_MOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $qt6libexecdir +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_MOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_MOC=$ac_cv_path_ac_pt_MOC +if test -n "$ac_pt_MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_MOC" >&5 +$as_echo "$ac_pt_MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_MOC" = x; then + MOC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MOC=$ac_pt_MOC + fi +else + MOC="$ac_cv_path_MOC" +fi + + if test -z "$MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: moc not found - Qt 6 binding will not be built." >&5 +$as_echo "$as_me: WARNING: moc not found - Qt 6 binding will not be built." >&2;} + have_qt6_libs="no"; + fi + fi + if test "$have_qt6_libs" = "yes"; then + OLDCPPFLAGS=$CPPFLAGS + OLDLIBS=$LIBS + + # try building without -fPIC + CPPFLAGS=$GPGME_QT6_CFLAGS + LIBS=$GPGME_QT6_LIBS + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built without -fPIC" >&5 +$as_echo_n "checking whether a simple qt program can be built without -fPIC... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_qt6_libs='yes' +else + have_qt6_libs='no' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt6_libs" >&5 +$as_echo "$have_qt6_libs" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + if test "$have_qt6_libs" = "no" -a "$have_w32_system" != yes; then + # try building with -fPIC + CPPFLAGS="$GPGME_QT6_CFLAGS -fPIC" + LIBS=$GPGME_QT6_LIBS + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built with -fPIC" >&5 +$as_echo_n "checking whether a simple qt program can be built with -fPIC... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + have_qt6_libs='yes' + GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fPIC" + +else + have_qt6_libs='no' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt6_libs" >&5 +$as_echo "$have_qt6_libs" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi + + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi + + if test "$have_qt6_libs" = "yes"; then + want_qt6="yes"; + else + if test "$explicit_languages" = "1"; then + as_fn_error $? " +*** +*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt binding. +***" "$LINENO" 5 + else + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +*** +*** Qt5 (Qt5Core) and Qt6 (Qt6Core) not found. Qt Binding will be disabled. +***" >&5 +$as_echo "$as_me: WARNING: +*** +*** Qt5 (Qt5Core) and Qt6 (Qt6Core) not found. Qt Binding will be disabled. +***" >&2;} + fi + fi + fi +elif test "$want_qt5" = "yes"; then + + have_qt5_libs="no"; + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT5" >&5 +$as_echo_n "checking for GPGME_QT5... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5_CFLAGS"; then + pkg_cv_GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5_CFLAGS=`$PKG_CONFIG --cflags "Qt5Core >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5_LIBS"; then + pkg_cv_GPGME_QT5_LIBS="$GPGME_QT5_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5_LIBS=`$PKG_CONFIG --libs "Qt5Core >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT5_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Core >= 5.0.0"` + else + GPGME_QT5_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Core >= 5.0.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT5_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt5_libs="no" +elif test $pkg_failed = untried; then + have_qt5_libs="no" +else + GPGME_QT5_CFLAGS=$pkg_cv_GPGME_QT5_CFLAGS + GPGME_QT5_LIBS=$pkg_cv_GPGME_QT5_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt5_libs="yes" +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT5TEST" >&5 +$as_echo_n "checking for GPGME_QT5TEST... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5TEST_CFLAGS"; then + pkg_cv_GPGME_QT5TEST_CFLAGS="$GPGME_QT5TEST_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Test >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Test >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5TEST_CFLAGS=`$PKG_CONFIG --cflags "Qt5Test >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT5TEST_LIBS"; then + pkg_cv_GPGME_QT5TEST_LIBS="$GPGME_QT5TEST_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Test >= 5.0.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt5Test >= 5.0.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT5TEST_LIBS=`$PKG_CONFIG --libs "Qt5Test >= 5.0.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT5TEST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Test >= 5.0.0"` + else + GPGME_QT5TEST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Test >= 5.0.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT5TEST_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt5test_libs="no" +elif test $pkg_failed = untried; then + have_qt5test_libs="no" +else + GPGME_QT5TEST_CFLAGS=$pkg_cv_GPGME_QT5TEST_CFLAGS + GPGME_QT5TEST_LIBS=$pkg_cv_GPGME_QT5TEST_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt5test_libs="yes" +fi + + if ! test "$have_w32_system" = yes; then + if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fpic" + fi + fi + if test "$have_qt5_libs" = "yes"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args. +set dummy ${ac_tool_prefix}moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MOC"; then + ac_cv_prog_MOC="$MOC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MOC="${ac_tool_prefix}moc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MOC=$ac_cv_prog_MOC +if test -n "$MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 +$as_echo "$MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MOC"; then + ac_ct_MOC=$MOC + # Extract the first word of "moc", so it can be a program name with args. +set dummy moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MOC"; then + ac_cv_prog_ac_ct_MOC="$ac_ct_MOC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MOC="moc" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MOC=$ac_cv_prog_ac_ct_MOC +if test -n "$ac_ct_MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MOC" >&5 +$as_echo "$ac_ct_MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MOC" = x; then + MOC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MOC=$ac_ct_MOC + fi +else + MOC="$ac_cv_prog_MOC" +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking moc version" >&5 +$as_echo_n "checking moc version... " >&6; } + mocversion=`$MOC -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + # moc was not the qt5 one, try with moc-qt5 + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}moc-qt5", so it can be a program name with args. +set dummy ${ac_tool_prefix}moc-qt5; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_MOC2+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$MOC2"; then + ac_cv_prog_MOC2="$MOC2" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_MOC2="${ac_tool_prefix}moc-qt5" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +MOC2=$ac_cv_prog_MOC2 +if test -n "$MOC2"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC2" >&5 +$as_echo "$MOC2" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_MOC2"; then + ac_ct_MOC2=$MOC2 + # Extract the first word of "moc-qt5", so it can be a program name with args. +set dummy moc-qt5; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_MOC2+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_MOC2"; then + ac_cv_prog_ac_ct_MOC2="$ac_ct_MOC2" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_MOC2="moc-qt5" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_MOC2=$ac_cv_prog_ac_ct_MOC2 +if test -n "$ac_ct_MOC2"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MOC2" >&5 +$as_echo "$ac_ct_MOC2" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_MOC2" = x; then + MOC2="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MOC2=$ac_ct_MOC2 + fi +else + MOC2="$ac_cv_prog_MOC2" +fi + + mocversion=`$MOC2 -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}qtchooser", so it can be a program name with args. +set dummy ${ac_tool_prefix}qtchooser; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_QTCHOOSER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$QTCHOOSER"; then + ac_cv_prog_QTCHOOSER="$QTCHOOSER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_QTCHOOSER="${ac_tool_prefix}qtchooser" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +QTCHOOSER=$ac_cv_prog_QTCHOOSER +if test -n "$QTCHOOSER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QTCHOOSER" >&5 +$as_echo "$QTCHOOSER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_QTCHOOSER"; then + ac_ct_QTCHOOSER=$QTCHOOSER + # Extract the first word of "qtchooser", so it can be a program name with args. +set dummy qtchooser; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_ac_ct_QTCHOOSER+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$ac_ct_QTCHOOSER"; then + ac_cv_prog_ac_ct_QTCHOOSER="$ac_ct_QTCHOOSER" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_QTCHOOSER="qtchooser" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +ac_ct_QTCHOOSER=$ac_cv_prog_ac_ct_QTCHOOSER +if test -n "$ac_ct_QTCHOOSER"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_QTCHOOSER" >&5 +$as_echo "$ac_ct_QTCHOOSER" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_ct_QTCHOOSER" = x; then + QTCHOOSER="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + QTCHOOSER=$ac_ct_QTCHOOSER + fi +else + QTCHOOSER="$ac_cv_prog_QTCHOOSER" +fi + + qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` + mocversion=`$qt5tooldir/moc -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + # no valid moc found + have_qt5_libs="no"; + else + MOC=$qt5tooldir/moc + fi + else + MOC=$MOC2 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mocversion" >&5 +$as_echo "$mocversion" >&6; } + fi + if test "$have_qt5_libs" = "yes"; then + OLDCPPFLAGS=$CPPFLAGS + CPPFLAGS=$GPGME_QT5_CFLAGS + OLDLIBS=$LIBS + LIBS=$GPGME_QT5_LIBS + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built" >&5 +$as_echo_n "checking whether a simple qt program can be built... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_qt5_libs='yes' +else + have_qt5_libs='no' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt5_libs" >&5 +$as_echo "$have_qt5_libs" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi + + if test "$have_qt5_libs" != "yes"; then + as_fn_error $? " +*** +*** Qt5 (Qt5Core) is required for the Qt 5 binding. +***" "$LINENO" 5 + fi +elif test "$want_qt6" = "yes"; then + + have_qt6_libs="no"; + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT6" >&5 +$as_echo_n "checking for GPGME_QT6... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6_CFLAGS"; then + pkg_cv_GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Core >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Core >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6_CFLAGS=`$PKG_CONFIG --cflags "Qt6Core >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6_LIBS"; then + pkg_cv_GPGME_QT6_LIBS="$GPGME_QT6_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Core >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Core >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6_LIBS=`$PKG_CONFIG --libs "Qt6Core >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT6_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt6Core >= 6.4.0"` + else + GPGME_QT6_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt6Core >= 6.4.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT6_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt6_libs="no" +elif test $pkg_failed = untried; then + have_qt6_libs="no" +else + GPGME_QT6_CFLAGS=$pkg_cv_GPGME_QT6_CFLAGS + GPGME_QT6_LIBS=$pkg_cv_GPGME_QT6_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt6_libs="yes" +fi + + +pkg_failed=no +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT6TEST" >&5 +$as_echo_n "checking for GPGME_QT6TEST... " >&6; } + +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6TEST_CFLAGS"; then + pkg_cv_GPGME_QT6TEST_CFLAGS="$GPGME_QT6TEST_CFLAGS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Test >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Test >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6TEST_CFLAGS=`$PKG_CONFIG --cflags "Qt6Test >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi +if test -n "$PKG_CONFIG"; then + if test -n "$GPGME_QT6TEST_LIBS"; then + pkg_cv_GPGME_QT6TEST_LIBS="$GPGME_QT6TEST_LIBS" + else + if test -n "$PKG_CONFIG" && \ + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt6Test >= 6.4.0\""; } >&5 + ($PKG_CONFIG --exists --print-errors "Qt6Test >= 6.4.0") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_GPGME_QT6TEST_LIBS=`$PKG_CONFIG --libs "Qt6Test >= 6.4.0" 2>/dev/null` +else + pkg_failed=yes +fi + fi +else + pkg_failed=untried +fi + + + +if test $pkg_failed = yes; then + +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then + GPGME_QT6TEST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt6Test >= 6.4.0"` + else + GPGME_QT6TEST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt6Test >= 6.4.0"` + fi + # Put the nasty error message in config.log where it belongs + echo "$GPGME_QT6TEST_PKG_ERRORS" >&5 + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + have_qt6test_libs="no" +elif test $pkg_failed = untried; then + have_qt6test_libs="no" +else + GPGME_QT6TEST_CFLAGS=$pkg_cv_GPGME_QT6TEST_CFLAGS + GPGME_QT6TEST_LIBS=$pkg_cv_GPGME_QT6TEST_LIBS + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + have_qt6test_libs="yes" +fi + + if test "$have_qt6_libs" = "yes"; then + # Qt6 moved moc to libexec + qt6libexecdir=$($PKG_CONFIG --variable=libexecdir 'Qt6Core >= 6.4.0') + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args. +set dummy ${ac_tool_prefix}moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $MOC in + \\/* | ?:\\/*) + ac_cv_path_MOC="$MOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $qt6libexecdir +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_MOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +MOC=$ac_cv_path_MOC +if test -n "$MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 +$as_echo "$MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + +fi +if test -z "$ac_cv_path_MOC"; then + ac_pt_MOC=$MOC + # Extract the first word of "moc", so it can be a program name with args. +set dummy moc; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_ac_pt_MOC+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $ac_pt_MOC in + \\/* | ?:\\/*) + ac_cv_path_ac_pt_MOC="$ac_pt_MOC" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $qt6libexecdir +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_ac_pt_MOC="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +ac_pt_MOC=$ac_cv_path_ac_pt_MOC +if test -n "$ac_pt_MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_MOC" >&5 +$as_echo "$ac_pt_MOC" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + if test "x$ac_pt_MOC" = x; then + MOC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +ac_tool_warned=yes ;; +esac + MOC=$ac_pt_MOC + fi +else + MOC="$ac_cv_path_MOC" +fi + + if test -z "$MOC"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: moc not found - Qt 6 binding will not be built." >&5 +$as_echo "$as_me: WARNING: moc not found - Qt 6 binding will not be built." >&2;} + have_qt6_libs="no"; + fi + fi + if test "$have_qt6_libs" = "yes"; then + OLDCPPFLAGS=$CPPFLAGS + OLDLIBS=$LIBS + + # try building without -fPIC + CPPFLAGS=$GPGME_QT6_CFLAGS + LIBS=$GPGME_QT6_LIBS + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built without -fPIC" >&5 +$as_echo_n "checking whether a simple qt program can be built without -fPIC... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + have_qt6_libs='yes' +else + have_qt6_libs='no' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt6_libs" >&5 +$as_echo "$have_qt6_libs" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + if test "$have_qt6_libs" = "no" -a "$have_w32_system" != yes; then + # try building with -fPIC + CPPFLAGS="$GPGME_QT6_CFLAGS -fPIC" + LIBS=$GPGME_QT6_LIBS + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built with -fPIC" >&5 +$as_echo_n "checking whether a simple qt program can be built with -fPIC... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + } +_ACEOF +if ac_fn_cxx_try_link "$LINENO"; then : + + have_qt6_libs='yes' + GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fPIC" + +else + have_qt6_libs='no' +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt6_libs" >&5 +$as_echo "$have_qt6_libs" >&6; } + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + fi + + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi + + if test "$have_qt6_libs" != "yes"; then + as_fn_error $? " +*** +*** Qt6 (Qt6Core) is required for the Qt 6 binding. +***" "$LINENO" 5 + fi +fi + +# Check that cpp is enabled if qt5 or qt6 is enabled +if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then + +name="cpp" +list=$enabled_languages +found=0 + +for n in $list; do + if test "x$name" = "x$n"; then + found=1 + fi +done + + if test "$found" = "0"; then + as_fn_error $? " +*** +*** The Qt bindings depend on the C++ binding. +***" "$LINENO" 5 + fi +fi + +# Enable C++ 17 if qt6 is requested +if test "$want_qt6" = "yes"; then + ax_cxx_compile_alternatives="17 1z" ax_cxx_compile_cxx17_required=false ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_success=no - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features by default" >&5 -$as_echo_n "checking whether $CXX supports C++11 features by default... " >&6; } -if ${ax_cv_cxx_compile_cxx11+:} false; then : + + + + + + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx17_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++17 features with $switch" >&5 +$as_echo_n "checking whether $CXX supports C++17 features with $switch... " >&6; } +if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + ac_save_CXX="$CXX" + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -17910,7 +19848,11 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -17935,11 +19877,13 @@ struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -18187,33 +20131,610 @@ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L && !defined _MSC_VER + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = (auto&&... args){ + const auto istiny = (auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny = { istiny(args)... }; + return aretiny0; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = a = x(int b){ return a + b; }; + const auto lambda2 = a = lambda1(x)(){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same<T, T> + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same<int, decltype(f(x))>::value, ""); + static_assert(is_same<int&, decltype(g(x))>::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + + + + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include <initializer_list> +#include <utility> +#include <type_traits> + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = (){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template<typename... Args> + int multiply(Args... args) + { + return (args * ... * 1); + } + + template<typename... Args> + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); + static_assert(std::is_same<int, decltype(bar)>::value); + } + + namespace test_typename_in_template_template_parameter + { + + template<template<typename> typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + nodiscard int f2() + { + maybe_unused auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + fallthrough; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + maybe_unused auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return *this() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template <bool cond> + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template <typename T1, typename T2> + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + maybe_unused auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template <auto n> + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr2 = { 1, 2 }; + std::pair<int, int> pr = { 1, 2 }; + + auto f1() -> int(&)2 + { + return arr; + } + + auto f2() -> std::pair<int, int>& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto x1, y1 = f1(); + auto& xr1, yr1 = f1(); + auto x2, y2 = f2(); + auto& xr2, yr2 = f2(); + const auto x3, y3 = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template<typename T> + Bad + f(T*, T*); + + template<typename T1, typename T2> + Good + f(T1*, T2*); + + static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); + + } + + namespace test_inline_variables + { + + template<class T> void f(T) + {} + + template<class T> inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + + + _ACEOF if ac_fn_cxx_try_compile "$LINENO"; then : - ax_cv_cxx_compile_cxx11=yes + eval $cachevar=yes else - ax_cv_cxx_compile_cxx11=no + eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + CXX="$ac_save_CXX" fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_cxx_compile_cxx11" >&5 -$as_echo "$ax_cv_cxx_compile_cxx11" >&6; } - if test x$ax_cv_cxx_compile_cxx11 = xyes; then - ac_success=yes +eval ac_res=\$$cachevar + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + if test x$ax_cxx_compile_cxx17_required = xtrue; then + if test x$ac_success = xno; then + as_fn_error $? "*** A compiler with support for C++17 language features is required." "$LINENO" 5 + fi + fi + if test x$ac_success = xno; then + HAVE_CXX17=0 + { $as_echo "$as_me:${as_lineno-$LINENO}: No compiler with C++17 support was found" >&5 +$as_echo "$as_me: No compiler with C++17 support was found" >&6;} + else + HAVE_CXX17=1 + +$as_echo "#define HAVE_CXX17 1" >>confdefs.h + + fi + + + if test "$HAVE_CXX17" != "1"; then + if test "$explicit_languages" = "1"; then + as_fn_error $? " +*** +*** A compiler with c++17 support is required for the Qt 6 binding. +***" "$LINENO" 5 + else + want_qt6="no" + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: +*** +*** No c++17 support detected. Qt 6 binding will be disabled. +***" >&5 +$as_echo "$as_me: WARNING: +*** +*** No c++17 support detected. Qt 6 binding will be disabled. +***" >&2;} + fi + fi +fi + +# Enable C++ 11 if cpp is requested (unless C++ 17 was already enabled) + +name="cpp" +list=$enabled_languages +found=0 + +for n in $list; do + if test "x$name" = "x$n"; then + found=1 fi +done + +if test "$found" = "1" -a "$HAVE_CXX17" != "1"; then + ax_cxx_compile_alternatives="11 0x" ax_cxx_compile_cxx11_required=false + ac_ext=cpp +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu + ac_success=no + + if test x$ac_success = xno; then - for switch in -std=c++11 -std=c++0x +std=c++11 "-h std=c++11"; do - cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=`$as_echo "ax_cv_cxx_compile_cxx11_$switch" | $as_tr_sh` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX supports C++11 features with $switch" >&5 $as_echo_n "checking whether $CXX supports C++11 features with $switch... " >&6; } if eval \${$cachevar+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_CXX="$CXX" - CXX="$CXX $switch" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext + CXX="$CXX $switch" + cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -18224,7 +20745,11 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -18249,11 +20774,13 @@ struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -18508,15 +21035,21 @@ eval $cachevar=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - CXX="$ac_save_CXX" + CXX="$ac_save_CXX" fi eval ac_res=\$$cachevar { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - CXXCPP="$CXXCPP $switch" - ac_success=yes + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done @@ -18548,39 +21081,29 @@ if test "$explicit_languages" = "1"; then as_fn_error $? " *** -*** A compiler with c++11 support is required for the c++ binding. +*** A compiler with c++11 support is required for the C++ binding. ***" "$LINENO" 5 else enabled_languages=$(echo $enabled_languages | sed 's/cpp//') - enabled_languages=$(echo $enabled_languages | sed 's/qt//') + want_qt5="no" { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: *** -*** No c++11 support detected. C++ and Qt bindings will be disabled. +*** No c++11 support detected. C++ and Qt 5 bindings will be disabled. ***" >&5 $as_echo "$as_me: WARNING: *** -*** No c++11 support detected. C++ and Qt bindings will be disabled. +*** No c++11 support detected. C++ and Qt 5 bindings will be disabled. ***" >&2;} fi fi fi -# Check that if qt is enabled cpp also is enabled - -name="qt" -list=$enabled_languages -found=0 - -for n in $list; do - if test "x$name" = "x$n"; then - found=1 - fi -done +# Now append qt to the list of language bindings +if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then + enabled_languages=$(echo $enabled_languages qt) +fi -if test "$found" = "1"; then - # We need to ensure that in the language order qt comes after cpp - # so we remove qt first and explicitly add it as last list member. - enabled_languages=$(echo $enabled_languages | sed 's/qt//') +# Check whether compiler supports visibility attribute (if cpp language is enabled) name="cpp" list=$enabled_languages @@ -18592,643 +21115,92 @@ fi done - if test "$found" = "0"; then - as_fn_error $? " -*** -*** Qt language binding depends on cpp binding. -***" "$LINENO" 5 - fi - - -if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. -set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_PKG_CONFIG+:} false; then : - $as_echo_n "(cached) " >&6 -else - case $PKG_CONFIG in - \\/* | ?:\\/*) - ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS +if test "$found" = "1"; then - ;; -esac -fi -PKG_CONFIG=$ac_cv_path_PKG_CONFIG -if test -n "$PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5 -$as_echo "$PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi -fi -if test -z "$ac_cv_path_PKG_CONFIG"; then - ac_pt_PKG_CONFIG=$PKG_CONFIG - # Extract the first word of "pkg-config", so it can be a program name with args. -set dummy pkg-config; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_path_ac_pt_PKG_CONFIG+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for __attribute__((visibility))" >&5 +$as_echo_n "checking for __attribute__((visibility))... " >&6; } +if ${ax_cv_have_func_attribute_visibility+:} false; then : $as_echo_n "(cached) " >&6 else - case $ac_pt_PKG_CONFIG in - \\/* | ?:\\/*) - ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - - ;; -esac -fi -ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG -if test -n "$ac_pt_PKG_CONFIG"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_pt_PKG_CONFIG" >&5 -$as_echo "$ac_pt_PKG_CONFIG" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_pt_PKG_CONFIG" = x; then - PKG_CONFIG="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - PKG_CONFIG=$ac_pt_PKG_CONFIG - fi -else - PKG_CONFIG="$ac_cv_path_PKG_CONFIG" -fi - -fi -if test -n "$PKG_CONFIG"; then - _pkg_min_version=0.9.0 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking pkg-config is at least version $_pkg_min_version" >&5 -$as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } - if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - PKG_CONFIG="" - fi + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ -fi - have_qt5_libs="no"; + int foo_def( void ) __attribute__((visibility("default"))); + int foo_hid( void ) __attribute__((visibility("hidden"))); + int foo_int( void ) __attribute__((visibility("internal"))); + int foo_pro( void ) __attribute__((visibility("protected"))); +int +main () +{ -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QT" >&5 -$as_echo_n "checking for GPGME_QT... " >&6; } + ; + return 0; +} -if test -n "$PKG_CONFIG"; then - if test -n "$GPGME_QT_CFLAGS"; then - pkg_cv_GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GPGME_QT_CFLAGS=`$PKG_CONFIG --cflags "Qt5Core >= 5.0.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$GPGME_QT_LIBS"; then - pkg_cv_GPGME_QT_LIBS="$GPGME_QT_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Core >= 5.0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Core >= 5.0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GPGME_QT_LIBS=`$PKG_CONFIG --libs "Qt5Core >= 5.0.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + if grep -- -Wattributes conftest.err; then : + ax_cv_have_func_attribute_visibility=no else - pkg_failed=untried + ax_cv_have_func_attribute_visibility=yes fi - - - -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes else - _pkg_short_errors_supported=no + ax_cv_have_func_attribute_visibility=no fi - if test $_pkg_short_errors_supported = yes; then - GPGME_QT_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Core >= 5.0.0"` - else - GPGME_QT_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Core >= 5.0.0"` - fi - # Put the nasty error message in config.log where it belongs - echo "$GPGME_QT_PKG_ERRORS" >&5 +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_qt5_libs="no" -elif test $pkg_failed = untried; then - have_qt5_libs="no" -else - GPGME_QT_CFLAGS=$pkg_cv_GPGME_QT_CFLAGS - GPGME_QT_LIBS=$pkg_cv_GPGME_QT_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_qt5_libs="yes" fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_cv_have_func_attribute_visibility" >&5 +$as_echo "$ax_cv_have_func_attribute_visibility" >&6; } + if test yes = $ax_cv_have_func_attribute_visibility; then : -pkg_failed=no -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GPGME_QTTEST" >&5 -$as_echo_n "checking for GPGME_QTTEST... " >&6; } +cat >>confdefs.h <<_ACEOF +#define HAVE_FUNC_ATTRIBUTE_VISIBILITY 1 +_ACEOF -if test -n "$PKG_CONFIG"; then - if test -n "$GPGME_QTTEST_CFLAGS"; then - pkg_cv_GPGME_QTTEST_CFLAGS="$GPGME_QTTEST_CFLAGS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Test >= 5.0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Test >= 5.0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GPGME_QTTEST_CFLAGS=`$PKG_CONFIG --cflags "Qt5Test >= 5.0.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried -fi -if test -n "$PKG_CONFIG"; then - if test -n "$GPGME_QTTEST_LIBS"; then - pkg_cv_GPGME_QTTEST_LIBS="$GPGME_QTTEST_LIBS" - else - if test -n "$PKG_CONFIG" && \ - { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"Qt5Test >= 5.0.0\""; } >&5 - ($PKG_CONFIG --exists --print-errors "Qt5Test >= 5.0.0") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; then - pkg_cv_GPGME_QTTEST_LIBS=`$PKG_CONFIG --libs "Qt5Test >= 5.0.0" 2>/dev/null` -else - pkg_failed=yes -fi - fi -else - pkg_failed=untried fi -if test $pkg_failed = yes; then - -if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then - _pkg_short_errors_supported=yes -else - _pkg_short_errors_supported=no -fi - if test $_pkg_short_errors_supported = yes; then - GPGME_QTTEST_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "Qt5Test >= 5.0.0"` - else - GPGME_QTTEST_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "Qt5Test >= 5.0.0"` + if test "$ax_cv_have_func_attribute_visibility" = "yes"; then + GPGME_CPP_CFLAGS="$GPGME_CPP_CFLAGS -fvisibility=hidden" + if test "$want_qt5" = "yes"; then + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fvisibility=hidden" + fi + if test "$want_qt6" = "yes"; then + GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fvisibility=hidden" fi - # Put the nasty error message in config.log where it belongs - echo "$GPGME_QTTEST_PKG_ERRORS" >&5 - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - have_qt5test_libs="no" -elif test $pkg_failed = untried; then - have_qt5test_libs="no" -else - GPGME_QTTEST_CFLAGS=$pkg_cv_GPGME_QTTEST_CFLAGS - GPGME_QTTEST_LIBS=$pkg_cv_GPGME_QTTEST_LIBS - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } - have_qt5test_libs="yes" -fi - - if ! test "$have_w32_system" = yes; then - if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then - GPGME_QT_CFLAGS="$GPGME_QT_CFLAGS -fpic" fi - fi - if test "$have_qt5_libs" = "yes"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}moc", so it can be a program name with args. -set dummy ${ac_tool_prefix}moc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MOC"; then - ac_cv_prog_MOC="$MOC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MOC="${ac_tool_prefix}moc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - fi -fi -MOC=$ac_cv_prog_MOC -if test -n "$MOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC" >&5 -$as_echo "$MOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_MOC"; then - ac_ct_MOC=$MOC - # Extract the first word of "moc", so it can be a program name with args. -set dummy moc; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MOC+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MOC"; then - ac_cv_prog_ac_ct_MOC="$ac_ct_MOC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MOC="moc" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS -fi -fi -ac_ct_MOC=$ac_cv_prog_ac_ct_MOC -if test -n "$ac_ct_MOC"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MOC" >&5 -$as_echo "$ac_ct_MOC" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - if test "x$ac_ct_MOC" = x; then - MOC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MOC=$ac_ct_MOC - fi + if test "$want_qt5" = yes; then + WANT_QT5_TRUE= + WANT_QT5_FALSE='#' else - MOC="$ac_cv_prog_MOC" + WANT_QT5_TRUE='#' + WANT_QT5_FALSE= fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking moc version" >&5 -$as_echo_n "checking moc version... " >&6; } - mocversion=`$MOC -v 2>&1` - mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` - if test x"$mocversiongrep" != x"$mocversion"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } - # moc was not the qt5 one, try with moc-qt5 - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}moc-qt5", so it can be a program name with args. -set dummy ${ac_tool_prefix}moc-qt5; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_MOC2+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$MOC2"; then - ac_cv_prog_MOC2="$MOC2" # Let the user override the test. + if test "$want_qt6" = yes; then + WANT_QT6_TRUE= + WANT_QT6_FALSE='#' else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_MOC2="${ac_tool_prefix}moc-qt5" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -MOC2=$ac_cv_prog_MOC2 -if test -n "$MOC2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MOC2" >&5 -$as_echo "$MOC2" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } + WANT_QT6_TRUE='#' + WANT_QT6_FALSE= fi -fi -if test -z "$ac_cv_prog_MOC2"; then - ac_ct_MOC2=$MOC2 - # Extract the first word of "moc-qt5", so it can be a program name with args. -set dummy moc-qt5; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_MOC2+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_MOC2"; then - ac_cv_prog_ac_ct_MOC2="$ac_ct_MOC2" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_MOC2="moc-qt5" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_MOC2=$ac_cv_prog_ac_ct_MOC2 -if test -n "$ac_ct_MOC2"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MOC2" >&5 -$as_echo "$ac_ct_MOC2" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_MOC2" = x; then - MOC2="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - MOC2=$ac_ct_MOC2 - fi -else - MOC2="$ac_cv_prog_MOC2" -fi - - mocversion=`$MOC2 -v 2>&1` - mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"` - if test x"$mocversiongrep" != x"$mocversion"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}qtchooser", so it can be a program name with args. -set dummy ${ac_tool_prefix}qtchooser; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_QTCHOOSER+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$QTCHOOSER"; then - ac_cv_prog_QTCHOOSER="$QTCHOOSER" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_QTCHOOSER="${ac_tool_prefix}qtchooser" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -QTCHOOSER=$ac_cv_prog_QTCHOOSER -if test -n "$QTCHOOSER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $QTCHOOSER" >&5 -$as_echo "$QTCHOOSER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_QTCHOOSER"; then - ac_ct_QTCHOOSER=$QTCHOOSER - # Extract the first word of "qtchooser", so it can be a program name with args. -set dummy qtchooser; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_QTCHOOSER+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_QTCHOOSER"; then - ac_cv_prog_ac_ct_QTCHOOSER="$ac_ct_QTCHOOSER" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_QTCHOOSER="qtchooser" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_QTCHOOSER=$ac_cv_prog_ac_ct_QTCHOOSER -if test -n "$ac_ct_QTCHOOSER"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_QTCHOOSER" >&5 -$as_echo "$ac_ct_QTCHOOSER" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_QTCHOOSER" = x; then - QTCHOOSER="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - QTCHOOSER=$ac_ct_QTCHOOSER - fi -else - QTCHOOSER="$ac_cv_prog_QTCHOOSER" -fi - - qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` - mocversion=`$qt5tooldir/moc -v 2>&1` - mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` - if test x"$mocversiongrep" != x"$mocversion"; then - # no valid moc found - have_qt5_libs="no"; - else - MOC=$qt5tooldir/moc - fi - else - MOC=$MOC2 - fi - fi - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $mocversion" >&5 -$as_echo "$mocversion" >&6; } - OLDCPPFLAGS=$CPPFLAGS - CPPFLAGS=$GPGME_QT_CFLAGS - OLDLIBS=$LIBS - LIBS=$GPGME_QT_LIBS - ac_ext=cpp -ac_cpp='$CXXCPP $CPPFLAGS' -ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a simple qt program can be built" >&5 -$as_echo_n "checking whether a simple qt program can be built... " >&6; } - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - - #include <QCoreApplication> - int main (int argc, char **argv) { - QCoreApplication app(argc, argv); - app.exec(); - } -_ACEOF -if ac_fn_cxx_try_link "$LINENO"; then : - have_qt5_libs='yes' -else - have_qt5_libs='no' -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_qt5_libs" >&5 -$as_echo "$have_qt5_libs" >&6; } - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - CPPFLAGS=$OLDCPPFLAGS - LIBS=$OLDLIBS - fi - - if test "$have_qt5_libs" != "yes"; then - if test "$explicit_languages" = "1"; then - as_fn_error $? " -*** -*** Qt5 (Qt5Core) is required for Qt binding. -***" "$LINENO" 5 - else - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: -*** -*** Qt5 (Qt5Core) not found Qt Binding will be disabled. -***" >&5 -$as_echo "$as_me: WARNING: -*** -*** Qt5 (Qt5Core) not found Qt Binding will be disabled. -***" >&2;} - fi - else - enabled_languages=`echo $enabled_languages qt` - - for ac_prog in doxygen +# Check for tools for building the Qt binding docs +if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then + for ac_prog in doxygen do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -19270,12 +21242,12 @@ test -n "$DOXYGEN" && break done - if test -z "$DOXYGEN"; - # This is not highlighted because it's not really important. - then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Doxygen not found - Qt binding doc will not be built." >&5 + if test -z "$DOXYGEN"; then + # This is not highlighted because it's not really important. + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Doxygen not found - Qt binding doc will not be built." >&5 $as_echo "$as_me: WARNING: Doxygen not found - Qt binding doc will not be built." >&2;} - fi - for ac_prog in dot + fi + for ac_prog in dot do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -19317,12 +21289,12 @@ test -n "$GRAPHVIZ" && break done - if test -z "$GRAPHVIZ"; - then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Graphviz not found - Qt binding doc will not have diagrams." >&5 + if test -z "$GRAPHVIZ"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Graphviz not found - Qt binding doc will not have diagrams." >&5 $as_echo "$as_me: WARNING: Graphviz not found - Qt binding doc will not have diagrams." >&2;} - fi fi fi + if test -n "$DOXYGEN"; then HAVE_DOXYGEN_TRUE= HAVE_DOXYGEN_FALSE='#' @@ -19490,6 +21462,7 @@ unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -19612,30 +21585,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -19647,7 +21612,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -19668,39 +21763,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -19708,43 +21802,41 @@ pythondir=$am_cv_python_pythondir - - pkgpythondir=\${pythondir}/$PACKAGE + pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -19752,8 +21844,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -20115,11 +22206,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -20242,30 +22333,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -20277,7 +22360,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -20298,39 +22511,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -20338,43 +22550,41 @@ pythondir=$am_cv_python_pythondir + pkgpythondir=\${pythondir}/$PACKAGE - pkgpythondir=\${pythondir}/$PACKAGE - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -20382,8 +22592,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -20745,11 +22954,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -20872,30 +23081,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -20907,7 +23108,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -20928,39 +23259,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -20968,43 +23298,41 @@ pythondir=$am_cv_python_pythondir - - pkgpythondir=\${pythondir}/$PACKAGE + pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -21012,8 +23340,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -21375,11 +23702,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -21502,30 +23829,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -21537,7 +23856,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -21558,39 +24007,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -21598,43 +24046,41 @@ pythondir=$am_cv_python_pythondir - - pkgpythondir=\${pythondir}/$PACKAGE + pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -21642,8 +24088,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -22005,11 +24450,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -22132,30 +24577,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -22167,7 +24604,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -22188,39 +24755,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -22228,43 +24794,41 @@ pythondir=$am_cv_python_pythondir + pkgpythondir=\${pythondir}/$PACKAGE - pkgpythondir=\${pythondir}/$PACKAGE - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -22272,8 +24836,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -22635,11 +25198,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -22762,30 +25325,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -22797,7 +25352,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -22818,39 +25503,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -22858,43 +25542,41 @@ pythondir=$am_cv_python_pythondir + pkgpythondir=\${pythondir}/$PACKAGE - pkgpythondir=\${pythondir}/$PACKAGE - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -22902,8 +25584,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -23265,11 +25946,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -23392,30 +26073,770 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } +if ${am_cv_python_platform+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } + PYTHON_PLATFORM=$am_cv_python_platform + + + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# <https://github.com/pypa/virtualenv/issues/118> +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version:3 == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } +if ${am_cv_python_pythondir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } + pythondir=$am_cv_python_pythondir + + + pkgpythondir=\${pythondir}/$PACKAGE + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } +if ${am_cv_python_pyexecdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') +sys.stdout.write(sitedir)"` + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } + pyexecdir=$am_cv_python_pyexecdir + + + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + + + + # + # Allow the use of a (user set) custom python version + # + + + # Extract the first word of "python$PYTHON_VERSION", so it can be a program name with args. +set dummy python$PYTHON_VERSION; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + \\/* | ?:\\/*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test -z "$PYTHON"; then + as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5 + PYTHON_VERSION="" + fi + + # + # Check for a version of Python >= 2.1.0 + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5 +$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; } + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()0; \ + print (ver >= '2.1.0')"` + if test "$ac_supports_python_ver" != "True"; then + if test -z "$PYTHON_NOVERSIONCHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? " +This version of the AC_PYTHON_DEVEL macro +doesn't work properly with versions of Python before +2.1.0. You may need to re-run configure, setting the +variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, +PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. +Moreover, to disable this check, set PYTHON_NOVERSIONCHECK +to something else than an empty string. + +See \`config.log' for more details" "$LINENO" 5; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5 +$as_echo "skip at user request" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + + # + # if the macro parameter ``version'' is set, honour it + # + if test -n ""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python " >&5 +$as_echo_n "checking for a version of Python ... " >&6; } + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()0; \ + print (ver )"` + if test "$ac_supports_python_ver" = "True"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "this package requires Python . +If you have it installed, but it isn't the default Python +interpreter in your system path, please pass the PYTHON_VERSION +variable to configure. See \`\`configure --help'' for reference. +" "$LINENO" 5 + PYTHON_VERSION="" + fi + fi + + # + # Check if you have distutils, else fail + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 +$as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` + if test -z "$ac_distutils_result"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "cannot import Python module \"distutils\". +Please check your Python installation. The error was: +$ac_distutils_result" "$LINENO" 5 + PYTHON_VERSION="" + fi + + # + # Check for Python include path + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5 +$as_echo_n "checking for Python include path... " >&6; } + if test -z "$PYTHON_CPPFLAGS"; then + python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc ());"` + plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc (plat_specific=1));"` + if test -n "${python_path}"; then + if test "${plat_python_path}" != "${python_path}"; then + python_path="-I$python_path -I$plat_python_path" + else + python_path="-I$python_path" + fi + fi + PYTHON_CPPFLAGS=$python_path + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5 +$as_echo "$PYTHON_CPPFLAGS" >&6; } + + + # + # Check for Python library path + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5 +$as_echo_n "checking for Python library path... " >&6; } + if test -z "$PYTHON_LDFLAGS"; then + # (makes two attempts to ensure we've got a version number + # from the interpreter) + ac_python_version=`cat<<EOD | $PYTHON - + +# join all versioning strings, on some systems +# major/minor numbers could be in different list elements +from distutils.sysconfig import * +e = get_config_var('VERSION') +if e is not None: + print(e) +EOD` + + if test -z "$ac_python_version"; then + if test -n "$PYTHON_VERSION"; then + ac_python_version=$PYTHON_VERSION + else + ac_python_version=`$PYTHON -c "import sys; \ + print (sys.version:3)"` + fi + fi + + # Make the versioning information available to the compiler + + # JW: We don't need it and it interferes with the hack + # to detect multiple Pyhton versions + #AC_DEFINE_UNQUOTED(HAVE_PYTHON, "$ac_python_version", + # If available, contains the Python version number currently in use.) + + # First, the library directory: + ac_python_libdir=`cat<<EOD | $PYTHON - + +# There should be only one +import distutils.sysconfig +e = distutils.sysconfig.get_config_var('LIBDIR') +if e is not None: + print (e) +EOD` + + # Now, for the library: + ac_python_library=`cat<<EOD | $PYTHON - + +import distutils.sysconfig +c = distutils.sysconfig.get_config_vars() +if 'LDVERSION' in c: + print ('python'+c'LDVERSION') +else: + print ('python'+c'VERSION') +EOD` + + # This small piece shamelessly adapted from PostgreSQL python macro; + # credits goes to momjian, I think. I'd like to put the right name + # in the credits, if someone can point me in the right direction... ? + # + if test -n "$ac_python_libdir" -a -n "$ac_python_library" + then + # use the official shared library + ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` + PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" + else + # old way: use libpython from python_configdir + ac_python_libdir=`$PYTHON -c \ + "from distutils.sysconfig import get_python_lib as f; \ + import os; \ + print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` + PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" + fi + + if test -z "PYTHON_LDFLAGS"; then + as_fn_error $? " + Cannot determine location of your Python DSO. Please check it was installed with + dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. + " "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 +$as_echo "$PYTHON_LDFLAGS" >&6; } + + + # + # Check for site packages + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5 +$as_echo_n "checking for Python site-packages path... " >&6; } + if test -z "$PYTHON_SITE_PKG"; then + PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_lib(0,0));"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5 +$as_echo "$PYTHON_SITE_PKG" >&6; } + + + # + # libraries which must be linked in when embedding + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5 +$as_echo_n "checking python extra libraries... " >&6; } + if test -z "$PYTHON_EXTRA_LIBS"; then + PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LIBS') + ' ' + conf('SYSLIBS'))"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5 +$as_echo "$PYTHON_EXTRA_LIBS" >&6; } + + + # + # linking flags needed when embedding + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5 +$as_echo_n "checking python extra linking flags... " >&6; } + if test -z "$PYTHON_EXTRA_LDFLAGS"; then + PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LINKFORSHARED'))"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5 +$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; } + + + # + # final check to see if everything compiles alright + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5 +$as_echo_n "checking consistency of all components of python development environment... " >&6; } + # save current global flags + ac_save_LIBS="$LIBS" + ac_save_CPPFLAGS="$CPPFLAGS" + LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" + CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <Python.h> +int +main () +{ +Py_Initialize(); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + pythonexists=yes +else + pythonexists=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # turn back to default flags + CPPFLAGS="$ac_save_CPPFLAGS" + LIBS="$ac_save_LIBS" - PYTHON_PREFIX='${prefix}' + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5 +$as_echo "$pythonexists" >&6; } - PYTHON_EXEC_PREFIX='${exec_prefix}' + if test ! "x$pythonexists" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" + ============================================================================ + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + " >&5 +$as_echo "$as_me: WARNING: + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" + ============================================================================ + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + " >&2;} + PYTHON_VERSION="" + fi + + # + # all done! + # + + if test "$PYTHON_VERSION"; then + PYTHONS="$(echo $PYTHONS $PYTHON)" + PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)" + fi + + fi + unset PYTHON + unset PYTHON_VERSION + unset PYTHON_CPPFLAGS + unset PYTHON_LDFLAGS + unset PYTHON_LIBS + unset PYTHON_SITE_PKG + unset PYTHON_EXTRA_LIBS + unset PYTHON_EXTRA_LDFLAGS + unset ac_cv_path_PYTHON + unset am_cv_pathless_PYTHON + unset am_cv_python_version + unset am_cv_python_platform + unset am_cv_python_pythondir + unset am_cv_python_pyexecdir + + + + + + + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.10" >&5 +$as_echo_n "checking whether $PYTHON version is >= 3.10... " >&6; } + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.10'.split('.'))) + 0, 0, 0 +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Python interpreter is too old" "$LINENO" 5 +fi + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.10" >&5 +$as_echo_n "checking for a Python interpreter with version >= 3.10... " >&6; } +if ${am_cv_pathless_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + for am_cv_pathless_PYTHON in python3.10 none; do + test "$am_cv_pathless_PYTHON" = none && break + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.10'.split('.'))) + 0, 0, 0 +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 + ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + break +fi + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 +$as_echo "$am_cv_pathless_PYTHON" >&6; } + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. +set dummy $am_cv_pathless_PYTHON; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + \\/* | ?:\\/*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + + + if test "$PYTHON" = :; then + : + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } +if ${am_cv_python_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } + PYTHON_VERSION=$am_cv_python_version + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -23427,7 +26848,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -23448,39 +26999,786 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } + pythondir=$am_cv_python_pythondir + + + pkgpythondir=\${pythondir}/$PACKAGE + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } +if ${am_cv_python_pyexecdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') +sys.stdout.write(sitedir)"` + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } + pyexecdir=$am_cv_python_pyexecdir + + + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + + + + # + # Allow the use of a (user set) custom python version + # + + + # Extract the first word of "python$PYTHON_VERSION", so it can be a program name with args. +set dummy python$PYTHON_VERSION; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + \\/* | ?:\\/*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test -z "$PYTHON"; then + as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5 + PYTHON_VERSION="" + fi + + # + # Check for a version of Python >= 2.1.0 + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5 +$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; } + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()0; \ + print (ver >= '2.1.0')"` + if test "$ac_supports_python_ver" != "True"; then + if test -z "$PYTHON_NOVERSIONCHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? " +This version of the AC_PYTHON_DEVEL macro +doesn't work properly with versions of Python before +2.1.0. You may need to re-run configure, setting the +variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, +PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. +Moreover, to disable this check, set PYTHON_NOVERSIONCHECK +to something else than an empty string. + +See \`config.log' for more details" "$LINENO" 5; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5 +$as_echo "skip at user request" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + + # + # if the macro parameter ``version'' is set, honour it + # + if test -n ""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python " >&5 +$as_echo_n "checking for a version of Python ... " >&6; } + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()0; \ + print (ver )"` + if test "$ac_supports_python_ver" = "True"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "this package requires Python . +If you have it installed, but it isn't the default Python +interpreter in your system path, please pass the PYTHON_VERSION +variable to configure. See \`\`configure --help'' for reference. +" "$LINENO" 5 + PYTHON_VERSION="" + fi + fi + + # + # Check if you have distutils, else fail + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 +$as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` + if test -z "$ac_distutils_result"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "cannot import Python module \"distutils\". +Please check your Python installation. The error was: +$ac_distutils_result" "$LINENO" 5 + PYTHON_VERSION="" + fi + + # + # Check for Python include path + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5 +$as_echo_n "checking for Python include path... " >&6; } + if test -z "$PYTHON_CPPFLAGS"; then + python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc ());"` + plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc (plat_specific=1));"` + if test -n "${python_path}"; then + if test "${plat_python_path}" != "${python_path}"; then + python_path="-I$python_path -I$plat_python_path" + else + python_path="-I$python_path" + fi + fi + PYTHON_CPPFLAGS=$python_path + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5 +$as_echo "$PYTHON_CPPFLAGS" >&6; } + + + # + # Check for Python library path + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5 +$as_echo_n "checking for Python library path... " >&6; } + if test -z "$PYTHON_LDFLAGS"; then + # (makes two attempts to ensure we've got a version number + # from the interpreter) + ac_python_version=`cat<<EOD | $PYTHON - + +# join all versioning strings, on some systems +# major/minor numbers could be in different list elements +from distutils.sysconfig import * +e = get_config_var('VERSION') +if e is not None: + print(e) +EOD` + + if test -z "$ac_python_version"; then + if test -n "$PYTHON_VERSION"; then + ac_python_version=$PYTHON_VERSION + else + ac_python_version=`$PYTHON -c "import sys; \ + print (sys.version:3)"` + fi + fi + + # Make the versioning information available to the compiler + + # JW: We don't need it and it interferes with the hack + # to detect multiple Pyhton versions + #AC_DEFINE_UNQUOTED(HAVE_PYTHON, "$ac_python_version", + # If available, contains the Python version number currently in use.) + + # First, the library directory: + ac_python_libdir=`cat<<EOD | $PYTHON - + +# There should be only one +import distutils.sysconfig +e = distutils.sysconfig.get_config_var('LIBDIR') +if e is not None: + print (e) +EOD` + + # Now, for the library: + ac_python_library=`cat<<EOD | $PYTHON - + +import distutils.sysconfig +c = distutils.sysconfig.get_config_vars() +if 'LDVERSION' in c: + print ('python'+c'LDVERSION') +else: + print ('python'+c'VERSION') +EOD` + + # This small piece shamelessly adapted from PostgreSQL python macro; + # credits goes to momjian, I think. I'd like to put the right name + # in the credits, if someone can point me in the right direction... ? + # + if test -n "$ac_python_libdir" -a -n "$ac_python_library" + then + # use the official shared library + ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` + PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" + else + # old way: use libpython from python_configdir + ac_python_libdir=`$PYTHON -c \ + "from distutils.sysconfig import get_python_lib as f; \ + import os; \ + print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` + PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" + fi + + if test -z "PYTHON_LDFLAGS"; then + as_fn_error $? " + Cannot determine location of your Python DSO. Please check it was installed with + dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. + " "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 +$as_echo "$PYTHON_LDFLAGS" >&6; } + + + # + # Check for site packages + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5 +$as_echo_n "checking for Python site-packages path... " >&6; } + if test -z "$PYTHON_SITE_PKG"; then + PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_lib(0,0));"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5 +$as_echo "$PYTHON_SITE_PKG" >&6; } + + + # + # libraries which must be linked in when embedding + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5 +$as_echo_n "checking python extra libraries... " >&6; } + if test -z "$PYTHON_EXTRA_LIBS"; then + PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LIBS') + ' ' + conf('SYSLIBS'))"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5 +$as_echo "$PYTHON_EXTRA_LIBS" >&6; } + + + # + # linking flags needed when embedding + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5 +$as_echo_n "checking python extra linking flags... " >&6; } + if test -z "$PYTHON_EXTRA_LDFLAGS"; then + PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LINKFORSHARED'))"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5 +$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; } + + + # + # final check to see if everything compiles alright + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5 +$as_echo_n "checking consistency of all components of python development environment... " >&6; } + # save current global flags + ac_save_LIBS="$LIBS" + ac_save_CPPFLAGS="$CPPFLAGS" + LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" + CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <Python.h> +int +main () +{ +Py_Initialize(); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + pythonexists=yes +else + pythonexists=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # turn back to default flags + CPPFLAGS="$ac_save_CPPFLAGS" + LIBS="$ac_save_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5 +$as_echo "$pythonexists" >&6; } + + if test ! "x$pythonexists" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" + ============================================================================ + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + " >&5 +$as_echo "$as_me: WARNING: + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" + ============================================================================ + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + " >&2;} + PYTHON_VERSION="" + fi + + # + # all done! + # + + if test "$PYTHON_VERSION"; then + PYTHONS="$(echo $PYTHONS $PYTHON)" + PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)" + fi + + fi + + unset PYTHON + unset PYTHON_VERSION + unset PYTHON_CPPFLAGS + unset PYTHON_LDFLAGS + unset PYTHON_LIBS + unset PYTHON_SITE_PKG + unset PYTHON_EXTRA_LIBS + unset PYTHON_EXTRA_LDFLAGS + unset ac_cv_path_PYTHON + unset am_cv_pathless_PYTHON + unset am_cv_python_version + unset am_cv_python_platform + unset am_cv_python_pythondir + unset am_cv_python_pyexecdir + + + + + + + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.11" >&5 +$as_echo_n "checking whether $PYTHON version is >= 3.11... " >&6; } + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.11'.split('.'))) + 0, 0, 0 +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Python interpreter is too old" "$LINENO" 5 +fi + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.11" >&5 +$as_echo_n "checking for a Python interpreter with version >= 3.11... " >&6; } +if ${am_cv_pathless_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + + for am_cv_pathless_PYTHON in python3.11 none; do + test "$am_cv_pathless_PYTHON" = none && break + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.11'.split('.'))) + 0, 0, 0 +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 + ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + break +fi + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 +$as_echo "$am_cv_pathless_PYTHON" >&6; } + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. +set dummy $am_cv_pathless_PYTHON; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + \\/* | ?:\\/*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + + + if test "$PYTHON" = :; then + : + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } +if ${am_cv_python_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } + PYTHON_VERSION=$am_cv_python_version + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } +if ${am_cv_python_platform+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } + PYTHON_PLATFORM=$am_cv_python_platform + + + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` ;; *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac + am_python_prefix_subst=$am_cv_python_prefix ;; esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# <https://github.com/pypa/virtualenv/issues/118> +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version:3 == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } +if ${am_cv_python_pythondir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -23488,43 +27786,789 @@ pythondir=$am_cv_python_pythondir + pkgpythondir=\${pythondir}/$PACKAGE - pkgpythondir=\${pythondir}/$PACKAGE - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 +$as_echo "$am_cv_python_pyexecdir" >&6; } + pyexecdir=$am_cv_python_pyexecdir + + + pkgpyexecdir=\${pyexecdir}/$PACKAGE + + + + + # + # Allow the use of a (user set) custom python version + # + + + # Extract the first word of "python$PYTHON_VERSION", so it can be a program name with args. +set dummy python$PYTHON_VERSION; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + \\/* | ?:\\/*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + if test -z "$PYTHON"; then + as_fn_error $? "Cannot find python$PYTHON_VERSION in your system path" "$LINENO" 5 + PYTHON_VERSION="" + fi + + # + # Check for a version of Python >= 2.1.0 + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python >= '2.1.0'" >&5 +$as_echo_n "checking for a version of Python >= '2.1.0'... " >&6; } + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()0; \ + print (ver >= '2.1.0')"` + if test "$ac_supports_python_ver" != "True"; then + if test -z "$PYTHON_NOVERSIONCHECK"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? " +This version of the AC_PYTHON_DEVEL macro +doesn't work properly with versions of Python before +2.1.0. You may need to re-run configure, setting the +variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, +PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. +Moreover, to disable this check, set PYTHON_NOVERSIONCHECK +to something else than an empty string. + +See \`config.log' for more details" "$LINENO" 5; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: skip at user request" >&5 +$as_echo "skip at user request" >&6; } + fi + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + fi + + # + # if the macro parameter ``version'' is set, honour it + # + if test -n ""; then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a version of Python " >&5 +$as_echo_n "checking for a version of Python ... " >&6; } + ac_supports_python_ver=`$PYTHON -c "import sys; \ + ver = sys.version.split ()0; \ + print (ver )"` + if test "$ac_supports_python_ver" = "True"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "this package requires Python . +If you have it installed, but it isn't the default Python +interpreter in your system path, please pass the PYTHON_VERSION +variable to configure. See \`\`configure --help'' for reference. +" "$LINENO" 5 + PYTHON_VERSION="" + fi + fi + + # + # Check if you have distutils, else fail + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 +$as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` + if test -z "$ac_distutils_result"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "cannot import Python module \"distutils\". +Please check your Python installation. The error was: +$ac_distutils_result" "$LINENO" 5 + PYTHON_VERSION="" + fi + + # + # Check for Python include path + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python include path" >&5 +$as_echo_n "checking for Python include path... " >&6; } + if test -z "$PYTHON_CPPFLAGS"; then + python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc ());"` + plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_inc (plat_specific=1));"` + if test -n "${python_path}"; then + if test "${plat_python_path}" != "${python_path}"; then + python_path="-I$python_path -I$plat_python_path" + else + python_path="-I$python_path" + fi + fi + PYTHON_CPPFLAGS=$python_path + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_CPPFLAGS" >&5 +$as_echo "$PYTHON_CPPFLAGS" >&6; } + + + # + # Check for Python library path + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python library path" >&5 +$as_echo_n "checking for Python library path... " >&6; } + if test -z "$PYTHON_LDFLAGS"; then + # (makes two attempts to ensure we've got a version number + # from the interpreter) + ac_python_version=`cat<<EOD | $PYTHON - + +# join all versioning strings, on some systems +# major/minor numbers could be in different list elements +from distutils.sysconfig import * +e = get_config_var('VERSION') +if e is not None: + print(e) +EOD` + + if test -z "$ac_python_version"; then + if test -n "$PYTHON_VERSION"; then + ac_python_version=$PYTHON_VERSION + else + ac_python_version=`$PYTHON -c "import sys; \ + print (sys.version:3)"` + fi + fi + + # Make the versioning information available to the compiler + + # JW: We don't need it and it interferes with the hack + # to detect multiple Pyhton versions + #AC_DEFINE_UNQUOTED(HAVE_PYTHON, "$ac_python_version", + # If available, contains the Python version number currently in use.) + + # First, the library directory: + ac_python_libdir=`cat<<EOD | $PYTHON - + +# There should be only one +import distutils.sysconfig +e = distutils.sysconfig.get_config_var('LIBDIR') +if e is not None: + print (e) +EOD` + + # Now, for the library: + ac_python_library=`cat<<EOD | $PYTHON - + +import distutils.sysconfig +c = distutils.sysconfig.get_config_vars() +if 'LDVERSION' in c: + print ('python'+c'LDVERSION') +else: + print ('python'+c'VERSION') +EOD` + + # This small piece shamelessly adapted from PostgreSQL python macro; + # credits goes to momjian, I think. I'd like to put the right name + # in the credits, if someone can point me in the right direction... ? + # + if test -n "$ac_python_libdir" -a -n "$ac_python_library" + then + # use the official shared library + ac_python_library=`echo "$ac_python_library" | sed "s/^lib//"` + PYTHON_LDFLAGS="-L$ac_python_libdir -l$ac_python_library" + else + # old way: use libpython from python_configdir + ac_python_libdir=`$PYTHON -c \ + "from distutils.sysconfig import get_python_lib as f; \ + import os; \ + print (os.path.join(f(plat_specific=1, standard_lib=1), 'config'));"` + PYTHON_LDFLAGS="-L$ac_python_libdir -lpython$ac_python_version" + fi + + if test -z "PYTHON_LDFLAGS"; then + as_fn_error $? " + Cannot determine location of your Python DSO. Please check it was installed with + dynamic libraries enabled, or try setting PYTHON_LDFLAGS by hand. + " "$LINENO" 5 + fi + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_LDFLAGS" >&5 +$as_echo "$PYTHON_LDFLAGS" >&6; } + + + # + # Check for site packages + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Python site-packages path" >&5 +$as_echo_n "checking for Python site-packages path... " >&6; } + if test -z "$PYTHON_SITE_PKG"; then + PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ + print (distutils.sysconfig.get_python_lib(0,0));"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_SITE_PKG" >&5 +$as_echo "$PYTHON_SITE_PKG" >&6; } + + + # + # libraries which must be linked in when embedding + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra libraries" >&5 +$as_echo_n "checking python extra libraries... " >&6; } + if test -z "$PYTHON_EXTRA_LIBS"; then + PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LIBS') + ' ' + conf('SYSLIBS'))"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LIBS" >&5 +$as_echo "$PYTHON_EXTRA_LIBS" >&6; } + + + # + # linking flags needed when embedding + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking python extra linking flags" >&5 +$as_echo_n "checking python extra linking flags... " >&6; } + if test -z "$PYTHON_EXTRA_LDFLAGS"; then + PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ + conf = distutils.sysconfig.get_config_var; \ + print (conf('LINKFORSHARED'))"` + fi + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON_EXTRA_LDFLAGS" >&5 +$as_echo "$PYTHON_EXTRA_LDFLAGS" >&6; } + + + # + # final check to see if everything compiles alright + # + { $as_echo "$as_me:${as_lineno-$LINENO}: checking consistency of all components of python development environment" >&5 +$as_echo_n "checking consistency of all components of python development environment... " >&6; } + # save current global flags + ac_save_LIBS="$LIBS" + ac_save_CPPFLAGS="$CPPFLAGS" + LIBS="$ac_save_LIBS $PYTHON_LDFLAGS $PYTHON_EXTRA_LDFLAGS $PYTHON_EXTRA_LIBS" + CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include <Python.h> +int +main () +{ +Py_Initialize(); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + pythonexists=yes +else + pythonexists=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext + ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + # turn back to default flags + CPPFLAGS="$ac_save_CPPFLAGS" + LIBS="$ac_save_LIBS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $pythonexists" >&5 +$as_echo "$pythonexists" >&6; } + + if test ! "x$pythonexists" = "xyes"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" + ============================================================================ + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + " >&5 +$as_echo "$as_me: WARNING: + Could not link test program to Python. Maybe the main Python library has been + installed in some non-standard library path. If so, pass it to configure, + via the LDFLAGS environment variable. + Example: ./configure LDFLAGS=\"-L/usr/non-standard-path/python/lib\" + ============================================================================ + You probably have to install the development version of the Python package + for your distribution. The exact name of this package varies among them. + ============================================================================ + " >&2;} + PYTHON_VERSION="" + fi + + # + # all done! + # + + if test "$PYTHON_VERSION"; then + PYTHONS="$(echo $PYTHONS $PYTHON)" + PYTHON_VERSIONS="$(echo $PYTHON_VERSIONS $PYTHON_VERSION)" + fi + + fi + + unset PYTHON + unset PYTHON_VERSION + unset PYTHON_CPPFLAGS + unset PYTHON_LDFLAGS + unset PYTHON_LIBS + unset PYTHON_SITE_PKG + unset PYTHON_EXTRA_LIBS + unset PYTHON_EXTRA_LDFLAGS + unset ac_cv_path_PYTHON + unset am_cv_pathless_PYTHON + unset am_cv_python_version + unset am_cv_python_platform + unset am_cv_python_pythondir + unset am_cv_python_pyexecdir + + + + + + + if test -n "$PYTHON"; then + # If the user set $PYTHON, use it and don't search something else. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $PYTHON version is >= 3.12" >&5 +$as_echo_n "checking whether $PYTHON version is >= 3.12... " >&6; } + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.12'.split('.'))) + 0, 0, 0 +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 + ($PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + as_fn_error $? "Python interpreter is too old" "$LINENO" 5 +fi + am_display_PYTHON=$PYTHON + else + # Otherwise, try each interpreter until we find one that satisfies + # VERSION. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a Python interpreter with version >= 3.12" >&5 +$as_echo_n "checking for a Python interpreter with version >= 3.12... " >&6; } +if ${am_cv_pathless_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + + for am_cv_pathless_PYTHON in python3.12 none; do + test "$am_cv_pathless_PYTHON" = none && break + prog="import sys +# split strings by '.' and convert to numeric. Append some zeros +# because we need at least 4 digits for the hex conversion. +# map returns an iterator in Python 3.0 and a list in 2.x +minver = list(map(int, '3.12'.split('.'))) + 0, 0, 0 +minverhex = 0 +# xrange is not present in Python 3.0 and range returns an iterator +for i in list(range(0, 4)): minverhex = (minverhex << 8) + minveri +sys.exit(sys.hexversion < minverhex)" + if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 + ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then : + break +fi + done +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_pathless_PYTHON" >&5 +$as_echo "$am_cv_pathless_PYTHON" >&6; } + # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. + if test "$am_cv_pathless_PYTHON" = none; then + PYTHON=: + else + # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. +set dummy $am_cv_pathless_PYTHON; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_path_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + case $PYTHON in + \\/* | ?:\\/*) + ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +PYTHON=$ac_cv_path_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + fi + am_display_PYTHON=$am_cv_pathless_PYTHON + fi + + + if test "$PYTHON" = :; then + : + else + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 +$as_echo_n "checking for $am_display_PYTHON version... " >&6; } +if ${am_cv_python_version+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 +$as_echo "$am_cv_python_version" >&6; } + PYTHON_VERSION=$am_cv_python_version + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 +$as_echo_n "checking for $am_display_PYTHON platform... " >&6; } +if ${am_cv_python_platform+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_platform" >&5 +$as_echo "$am_cv_python_platform" >&6; } + PYTHON_PLATFORM=$am_cv_python_platform + + + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` ;; *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac + am_python_prefix_subst=$am_cv_python_prefix ;; esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. + am_python_setup_sysconfig="\ +import sys +# Prefer sysconfig over distutils.sysconfig, for better compatibility +# with python 3.x. See automake bug#10227. +try: + import sysconfig +except ImportError: + can_use_sysconfig = 0 +else: + can_use_sysconfig = 1 +# Can't use sysconfig in CPython 2.7, since it's broken in virtualenvs: +# <https://github.com/pypa/virtualenv/issues/118> +try: + from platform import python_implementation + if python_implementation() == 'CPython' and sys.version:3 == '2.7': + can_use_sysconfig = 0 +except ImportError: + pass" + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } +if ${am_cv_python_pythondir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') +sys.stdout.write(sitedir)"` + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 +$as_echo "$am_cv_python_pythondir" >&6; } + pythondir=$am_cv_python_pythondir + + + pkgpythondir=\${pythondir}/$PACKAGE + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } +if ${am_cv_python_pyexecdir+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " +$am_python_setup_sysconfig +if can_use_sysconfig: + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) +else: + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') +sys.stdout.write(sitedir)"` + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; + esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -23532,8 +28576,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -23895,11 +28938,11 @@ fi - unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -24022,30 +29065,22 @@ if test "$PYTHON" = :; then - : + : else - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if ${am_cv_python_version+:} false; then : $as_echo_n "(cached) " >&6 else - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"` + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"` fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version - - PYTHON_PREFIX='${prefix}' - - PYTHON_EXEC_PREFIX='${exec_prefix}' - - - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if ${am_cv_python_platform+:} false; then : $as_echo_n "(cached) " >&6 @@ -24057,7 +29092,137 @@ PYTHON_PLATFORM=$am_cv_python_platform - # Just factor out some code duplication. + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + +# Check whether --with-python-sys-prefix was given. +if test "${with_python_sys_prefix+set}" = set; then : + withval=$with_python_sys_prefix; am_use_python_sys=: +else + am_use_python_sys=false +fi + + + # Allow user to override whatever the default Python prefix is. + +# Check whether --with-python_prefix was given. +if test "${with_python_prefix+set}" = set; then : + withval=$with_python_prefix; am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } +else + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON prefix... " >&6; } +if ${am_cv_python_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_prefix" >&5 +$as_echo "$am_cv_python_prefix" >&6; } + + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_prefix" >&5 +$as_echo "$am_python_prefix" >&6; } + fi +fi + + # Substituting python_prefix_subst value. + PYTHON_PREFIX=$am_python_prefix_subst + + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + +# Check whether --with-python_exec_prefix was given. +if test "${with_python_exec_prefix+set}" = set; then : + withval=$with_python_exec_prefix; am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for explicit $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for explicit $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + if test -n "$with_python_prefix"; then : + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python_prefix-given $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python_prefix-given $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } +else + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for python default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for python default $am_display_PYTHON exec_prefix... " >&6; } +if ${am_cv_python_exec_prefix+:} false; then : + $as_echo_n "(cached) " >&6 +else + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"` +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_exec_prefix" >&5 +$as_echo "$am_cv_python_exec_prefix" >&6; } + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU default $am_display_PYTHON exec_prefix" >&5 +$as_echo_n "checking for GNU default $am_display_PYTHON exec_prefix... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_python_exec_prefix" >&5 +$as_echo "$am_python_exec_prefix" >&6; } + fi +fi +fi + + # Substituting python_exec_prefix_subst. + PYTHON_EXEC_PREFIX=$am_python_exec_prefix_subst + + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -24078,39 +29243,38 @@ pass" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory" >&5 -$as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON script directory (pythondir)" >&5 +$as_echo_n "checking for $am_display_PYTHON script directory (pythondir)... " >&6; } if ${am_cv_python_pythondir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pythondir" >&5 @@ -24118,43 +29282,41 @@ pythondir=$am_cv_python_pythondir - - pkgpythondir=\${pythondir}/$PACKAGE + pkgpythondir=\${pythondir}/$PACKAGE - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory" >&5 -$as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $am_display_PYTHON extension module directory (pyexecdir)" >&5 +$as_echo_n "checking for $am_display_PYTHON extension module directory (pyexecdir)... " >&6; } if ${am_cv_python_pyexecdir+:} false; then : $as_echo_n "(cached) " >&6 else - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac + ;; + esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_python_pyexecdir" >&5 @@ -24162,8 +29324,7 @@ pyexecdir=$am_cv_python_pyexecdir - - pkgpyexecdir=\${pyexecdir}/$PACKAGE + pkgpyexecdir=\${pyexecdir}/$PACKAGE @@ -24526,7 +29687,6 @@ fi - fi # Recover some values lost in the second attempt to find Python. @@ -24562,7 +29722,7 @@ # # Provide information about the build. # -BUILD_REVISION="72bb46b3" +BUILD_REVISION="5bf3e6d0" cat >>confdefs.h <<_ACEOF @@ -24571,7 +29731,7 @@ BUILD_VERSION=`echo "$PACKAGE_VERSION" | sed 's/\(0-9.*\).*/\1./'` -BUILD_VERSION="${BUILD_VERSION}29371" +BUILD_VERSION="${BUILD_VERSION}23539" BUILD_FILEVERSION=`echo "${BUILD_VERSION}" | tr . ,` @@ -25604,7 +30764,6 @@ # Checking for libgpg-error. have_gpg_error=no - gpg_error_config_prefix="" # Check whether --with-libgpg-error-prefix was given. @@ -25681,8 +30840,6 @@ fi - min_gpg_error_version="$NEED_GPG_ERROR_VERSION" - ok=no # Extract the first word of "gpgrt-config", so it can be a program name with args. set dummy gpgrt-config; ac_word=$2 @@ -25780,8 +30937,9 @@ fi if test -n "$gpgrt_libdir"; then break; fi done - else - # When we cannot determine system libdir-format, use this: + fi + if test -z "$gpgrt_libdir"; then + # No valid pkgconfig dir in any of the system directories, fallback gpgrt_libdir=${possible_libdir1} fi else @@ -25796,11 +30954,16 @@ $as_echo "$as_me: Use gpgrt-config with $gpgrt_libdir as gpg-error-config" >&6;} gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion` else + gpg_error_config_version=`$GPG_ERROR_CONFIG --version` unset GPGRT_CONFIG fi elif test "$GPG_ERROR_CONFIG" != "no"; then gpg_error_config_version=`$GPG_ERROR_CONFIG --version` + unset GPGRT_CONFIG fi + + min_gpg_error_version="$NEED_GPG_ERROR_VERSION" + ok=no if test "$GPG_ERROR_CONFIG" != "no"; then req_major=`echo $min_gpg_error_version | \ sed 's/\(0-9*\)\.\(0-9*\)/\1/'` @@ -25881,6 +31044,16 @@ $as_echo "#define GPG_ERR_SOURCE_DEFAULT GPG_ERR_SOURCE_GPGME" >>confdefs.h + if test -n "$GPGRT_CONFIG" \ + -a "$ac_cv_path_GPG_ERROR_CONFIG" = no; then + USE_GPGRT_CONFIG_TRUE= + USE_GPGRT_CONFIG_FALSE='#' +else + USE_GPGRT_CONFIG_TRUE='#' + USE_GPGRT_CONFIG_FALSE= +fi + + # And for libassuan. have_libassuan=no @@ -25899,7 +31072,7 @@ fi use_gpgrt_config="" - if test x"${LIBASSUAN_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then + if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then if $GPGRT_CONFIG libassuan --exists; then LIBASSUAN_CONFIG="$GPGRT_CONFIG libassuan" { $as_echo "$as_me:${as_lineno-$LINENO}: Use gpgrt-config as libassuan-config" >&5 @@ -26086,7 +31259,7 @@ # # Check for getgid etc -for ac_func in getgid getegid closefrom +for ac_func in getgid getegid closefrom nanosleep do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" @@ -26236,12 +31409,46 @@ -# Substitution used for gpgme-config +# Substitution used for gpgme-config and gpgme.pc GPGME_CONFIG_LIBS="-lgpgme" GPGME_CONFIG_CFLAGS="" GPGME_CONFIG_HOST="$host" GPGME_CONFIG_AVAIL_LANG="$enabled_languages" +case "$includedir" in + /usr/include|/include) ;; + '${prefix}/include') + if test "$prefix" != / -a "$prefix" != /usr; then + if test -z "$GPGME_CONFIG_CFLAGS"; then + GPGME_CONFIG_CFLAGS="-I\${includedir}" + else + GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS" + fi + fi + ;; + *) + if test -z "$GPGME_CONFIG_CFLAGS"; then + GPGME_CONFIG_CFLAGS="-I\${includedir}" + else + GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS" + fi + ;; +esac +case "$libdir" in + /usr/lib|/usr/lib64|/lib|/lib64) ;; + '${exec_prefix}/lib'|'${exec_prefix}/lib64') + if test "$exec_prefix" = "NONE"; then + if test "$prefix" != / -a "$prefix" != /usr; then + GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" + fi + elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then + GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" + fi + ;; + *) GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" ;; +esac + + @@ -26346,12 +31553,22 @@ ac_config_files="$ac_config_files lang/qt/Makefile lang/qt/src/Makefile" -ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfig-w32.cmake.in" +if test "$want_qt5" = "yes"; then + ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfig-w32.cmake.in" + + ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfig.cmake.in" + + ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfigVersion.cmake" + +fi +if test "$want_qt6" = "yes"; then + ac_config_files="$ac_config_files lang/qt/src/QGpgmeQt6Config-w32.cmake.in" -ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfig.cmake.in" + ac_config_files="$ac_config_files lang/qt/src/QGpgmeQt6Config.cmake.in" -ac_config_files="$ac_config_files lang/qt/src/QGpgmeConfigVersion.cmake" + ac_config_files="$ac_config_files lang/qt/src/QGpgmeQt6ConfigVersion.cmake" +fi ac_config_files="$ac_config_files lang/qt/tests/Makefile" ac_config_files="$ac_config_files lang/qt/src/qgpgme_version.h" @@ -26543,6 +31760,14 @@ as_fn_error $? "conditional \"BUILD_W32_GLIB\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${WANT_QT5_TRUE}" && test -z "${WANT_QT5_FALSE}"; then + as_fn_error $? "conditional \"WANT_QT5\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi +if test -z "${WANT_QT6_TRUE}" && test -z "${WANT_QT6_FALSE}"; then + as_fn_error $? "conditional \"WANT_QT6\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${HAVE_DOXYGEN_TRUE}" && test -z "${HAVE_DOXYGEN_FALSE}"; then as_fn_error $? "conditional \"HAVE_DOXYGEN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -26563,6 +31788,10 @@ as_fn_error $? "conditional \"RUN_G13_TESTS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${USE_GPGRT_CONFIG_TRUE}" && test -z "${USE_GPGRT_CONFIG_FALSE}"; then + as_fn_error $? "conditional \"USE_GPGRT_CONFIG\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${USE_DESCRIPTOR_PASSING_TRUE}" && test -z "${USE_DESCRIPTOR_PASSING_FALSE}"; then as_fn_error $? "conditional \"USE_DESCRIPTOR_PASSING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -26968,7 +32197,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by gpgme $as_me 1.17.0, which was +This file was extended by gpgme $as_me 1.21.0, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -27034,7 +32263,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/\\""\`\$/\\\\&/g'`" ac_cs_version="\\ -gpgme config.status 1.17.0 +gpgme config.status 1.21.0 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" @@ -27654,6 +32883,9 @@ "lang/qt/src/QGpgmeConfig-w32.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeConfig-w32.cmake.in" ;; "lang/qt/src/QGpgmeConfig.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeConfig.cmake.in" ;; "lang/qt/src/QGpgmeConfigVersion.cmake") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeConfigVersion.cmake" ;; + "lang/qt/src/QGpgmeQt6Config-w32.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeQt6Config-w32.cmake.in" ;; + "lang/qt/src/QGpgmeQt6Config.cmake.in") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeQt6Config.cmake.in" ;; + "lang/qt/src/QGpgmeQt6ConfigVersion.cmake") CONFIG_FILES="$CONFIG_FILES lang/qt/src/QGpgmeQt6ConfigVersion.cmake" ;; "lang/qt/tests/Makefile") CONFIG_FILES="$CONFIG_FILES lang/qt/tests/Makefile" ;; "lang/qt/src/qgpgme_version.h") CONFIG_FILES="$CONFIG_FILES lang/qt/src/qgpgme_version.h" ;; "lang/Makefile") CONFIG_FILES="$CONFIG_FILES lang/Makefile" ;; @@ -29357,10 +34589,16 @@ fi +if test "$want_qt5" = "yes"; then + enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/") +elif test "$want_qt6" = "yes"; then + enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/") +fi + echo " GPGME v${VERSION} has been configured as follows: - Revision: 72bb46b3 (29371) + Revision: 5bf3e6d0 (23539) Platform: $host UI Server: $uiserver
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/configure.ac -> _service:tar_scm:gpgme-1.21.0.tar.bz2/configure.ac
Changed
@@ -31,7 +31,7 @@ # for the LT versions. m4_define(mym4_package,gpgme) m4_define(mym4_major, 1) -m4_define(mym4_minor, 17) +m4_define(mym4_minor, 21) m4_define(mym4_micro, 0) # Below is m4 magic to extract and compute the git revision number, @@ -53,19 +53,19 @@ # (Interfaces added: AGE++) # (Interfaces removed: AGE=0) # -LIBGPGME_LT_CURRENT=37 -LIBGPGME_LT_AGE=26 +LIBGPGME_LT_CURRENT=41 +LIBGPGME_LT_AGE=30 LIBGPGME_LT_REVISION=0 # If there is an ABI break in gpgmepp or qgpgme also bump the # version in IMPORTED_LOCATION in the GpgmeppConfig-w32.cmake.in.in -LIBGPGMEPP_LT_CURRENT=20 -LIBGPGMEPP_LT_AGE=14 +LIBGPGMEPP_LT_CURRENT=24 +LIBGPGMEPP_LT_AGE=18 LIBGPGMEPP_LT_REVISION=0 -LIBQGPGME_LT_CURRENT=14 -LIBQGPGME_LT_AGE=7 +LIBQGPGME_LT_CURRENT=18 +LIBQGPGME_LT_AGE=3 LIBQGPGME_LT_REVISION=0 ################################################ @@ -218,7 +218,7 @@ have_macos_system=no build_w32_glib=no build_w32_qt=no -available_languages="cl cpp python qt" +available_languages="cl cpp python qt qt5 qt6" default_languages="cl cpp python qt" case "${host}" in x86_64-*mingw32*) @@ -305,7 +305,9 @@ # lang/Makefile.am's DIST_SUBDIRS. AC_ARG_ENABLE(languages, AS_HELP_STRING(--enable-languages=languages, - enable only specific language bindings), + enable only specific language bindings: + cl cpp python qt qt5 qt6 (qt selects qt5 or qt6, + and qt5 and qt6 exclude each other)), enabled_languages=`echo $enableval | \ tr ',:' ' ' | tr 'A-Z' 'a-z' | \ sed 's/c++/cpp/'`, @@ -331,69 +333,163 @@ fi done +# Check whether Qt5 and/or Qt6 are enabled explicitly +want_qt5="no"; +LIST_MEMBER("qt5", $enabled_languages) +if test "$found" = "1"; then + want_qt5="yes"; + # Remove qt5; further down qt will be added + enabled_languages=$(echo $enabled_languages | sed 's/qt5//') +fi +want_qt6="no"; +LIST_MEMBER("qt6", $enabled_languages) +if test "$found" = "1"; then + want_qt6="yes"; + # Remove qt6; further down qt will be added + enabled_languages=$(echo $enabled_languages | sed 's/qt6//') +fi +if test "$want_qt5" = "yes" -a "$want_qt6" = "yes"; then + AC_MSG_ERROR( +*** +*** The bindings for Qt5 and Qt6 cannot be built simultaneously. +***) +fi +# Ensure that pkg-config is available for all calls of FIND_QT5/FIND_QT6 +PKG_PROG_PKG_CONFIG -# Enable C++ 11 if cpp language is requested -LIST_MEMBER("cpp", $enabled_languages) +# If the generic qt is enabled, then check for Qt5 or Qt6 (in this order) +LIST_MEMBER("qt", $enabled_languages) if test "$found" = "1"; then - AX_CXX_COMPILE_STDCXX(11, noext, optional) - if test "$HAVE_CXX11" != "1"; then - if test "$explicit_languages" = "1"; then - AC_MSG_ERROR( + # Remove the generic qt (qt5 and qt6 have already been removed) + enabled_languages=$(echo $enabled_languages | sed 's/qt//') + FIND_QT5 + if test "$have_qt5_libs" = "yes"; then + want_qt5="yes"; + else + FIND_QT6 + if test "$have_qt6_libs" = "yes"; then + want_qt6="yes"; + else + if test "$explicit_languages" = "1"; then + AC_MSG_ERROR( *** -*** A compiler with c++11 support is required for the c++ binding. +*** Qt5 (Qt5Core) or Qt6 (Qt6Core) is required for the Qt binding. ***) - else - enabled_languages=$(echo $enabled_languages | sed 's/cpp//') - enabled_languages=$(echo $enabled_languages | sed 's/qt//') - AC_MSG_WARN( + else + AC_MSG_WARN( *** -*** No c++11 support detected. C++ and Qt bindings will be disabled. +*** Qt5 (Qt5Core) and Qt6 (Qt6Core) not found. Qt Binding will be disabled. ***) + fi fi fi +elif test "$want_qt5" = "yes"; then + FIND_QT5 + if test "$have_qt5_libs" != "yes"; then + AC_MSG_ERROR( +*** +*** Qt5 (Qt5Core) is required for the Qt 5 binding. +***) + fi +elif test "$want_qt6" = "yes"; then + FIND_QT6 + if test "$have_qt6_libs" != "yes"; then + AC_MSG_ERROR( +*** +*** Qt6 (Qt6Core) is required for the Qt 6 binding. +***) + fi fi -# Check that if qt is enabled cpp also is enabled -LIST_MEMBER("qt", $enabled_languages) -if test "$found" = "1"; then - # We need to ensure that in the language order qt comes after cpp - # so we remove qt first and explicitly add it as last list member. - enabled_languages=$(echo $enabled_languages | sed 's/qt//') +# Check that cpp is enabled if qt5 or qt6 is enabled +if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then LIST_MEMBER("cpp", $enabled_languages) if test "$found" = "0"; then AC_MSG_ERROR( *** -*** Qt language binding depends on cpp binding. +*** The Qt bindings depend on the C++ binding. ***) fi - FIND_QT - if test "$have_qt5_libs" != "yes"; then +fi + +# Enable C++ 17 if qt6 is requested +if test "$want_qt6" = "yes"; then + AX_CXX_COMPILE_STDCXX(17, noext, optional) + if test "$HAVE_CXX17" != "1"; then if test "$explicit_languages" = "1"; then - AC_MSG_ERROR( + AC_MSG_ERROR( *** -*** Qt5 (Qt5Core) is required for Qt binding. +*** A compiler with c++17 support is required for the Qt 6 binding. ***) else - AC_MSG_WARN( + want_qt6="no" + AC_MSG_WARN( *** -*** Qt5 (Qt5Core) not found Qt Binding will be disabled. +*** No c++17 support detected. Qt 6 binding will be disabled. ***) fi - else - enabled_languages=`echo $enabled_languages qt` + fi +fi - AC_CHECK_PROGS(DOXYGEN, doxygen) - if test -z "$DOXYGEN"; - # This is not highlighted because it's not really important. - then AC_MSG_WARN(Doxygen not found - Qt binding doc will not be built.) +# Enable C++ 11 if cpp is requested (unless C++ 17 was already enabled) +LIST_MEMBER("cpp", $enabled_languages) +if test "$found" = "1" -a "$HAVE_CXX17" != "1"; then + AX_CXX_COMPILE_STDCXX(11, noext, optional) + if test "$HAVE_CXX11" != "1"; then + if test "$explicit_languages" = "1"; then + AC_MSG_ERROR( +*** +*** A compiler with c++11 support is required for the C++ binding. +***) + else + enabled_languages=$(echo $enabled_languages | sed 's/cpp//') + want_qt5="no" + AC_MSG_WARN( +*** +*** No c++11 support detected. C++ and Qt 5 bindings will be disabled. +***) fi - AC_CHECK_PROGS(GRAPHVIZ, dot) - if test -z "$GRAPHVIZ"; - then AC_MSG_WARN(Graphviz not found - Qt binding doc will not have diagrams.) + fi +fi + +# Now append qt to the list of language bindings +if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then + enabled_languages=$(echo $enabled_languages qt) +fi + +# Check whether compiler supports visibility attribute (if cpp language is enabled) +LIST_MEMBER("cpp", $enabled_languages) +if test "$found" = "1"; then + AX_GCC_FUNC_ATTRIBUTE(visibility) + if test "$ax_cv_have_func_attribute_visibility" = "yes"; then + GPGME_CPP_CFLAGS="$GPGME_CPP_CFLAGS -fvisibility=hidden" + if test "$want_qt5" = "yes"; then + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fvisibility=hidden" + fi + if test "$want_qt6" = "yes"; then + GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fvisibility=hidden" fi fi fi +AC_SUBST(GPGME_CPP_CFLAGS) + +AM_CONDITIONAL(WANT_QT5, test "$want_qt5" = yes) +AM_CONDITIONAL(WANT_QT6, test "$want_qt6" = yes) + +# Check for tools for building the Qt binding docs +if test "$want_qt5" = "yes" -o "$want_qt6" = "yes"; then + AC_CHECK_PROGS(DOXYGEN, doxygen) + if test -z "$DOXYGEN"; then + # This is not highlighted because it's not really important. + AC_MSG_WARN(Doxygen not found - Qt binding doc will not be built.) + fi + AC_CHECK_PROGS(GRAPHVIZ, dot) + if test -z "$GRAPHVIZ"; then + AC_MSG_WARN(Graphviz not found - Qt binding doc will not have diagrams.) + fi +fi + AM_CONDITIONAL(HAVE_DOXYGEN, test -n "$DOXYGEN") if test -n "$GRAPHVIZ"; then @@ -425,11 +521,13 @@ if test "$found_py" = "1" -o "$found_py3" = "1"; then # Reset everything, so that we can look for another Python. m4_foreach(mym4pythonver, - 2.7,3.4,3.5,3.6,3.7,3.8,3.9,all, + 2.7,3.4,3.5,3.6,3.7,3.8,3.9,3.10, + 3.11,3.12,all, unset PYTHON unset PYTHON_VERSION unset PYTHON_CPPFLAGS unset PYTHON_LDFLAGS + unset PYTHON_LIBS unset PYTHON_SITE_PKG unset PYTHON_EXTRA_LIBS unset PYTHON_EXTRA_LDFLAGS @@ -706,6 +804,9 @@ AC_DEFINE(GPG_ERR_SOURCE_DEFAULT, GPG_ERR_SOURCE_GPGME, The default error source for GPGME.) +AM_CONDITIONAL(USE_GPGRT_CONFIG, test -n "$GPGRT_CONFIG" \ + -a "$ac_cv_path_GPG_ERROR_CONFIG" = no) + # And for libassuan. have_libassuan=no AM_PATH_LIBASSUAN("$NEED_LIBASSUAN_API:$NEED_LIBASSUAN_VERSION", @@ -721,7 +822,7 @@ # # Check for getgid etc -AC_CHECK_FUNCS(getgid getegid closefrom) +AC_CHECK_FUNCS(getgid getegid closefrom nanosleep) # Replacement functions. @@ -821,6 +922,9 @@ # define GPGME_GCC_A_PURE #endif +/* Under Windows we use the gettext code from gpgrt. */ +#define GPG_ERR_ENABLE_GETTEXT_MACROS 1 + /* Under WindowsCE we need gpg-error's strerror macro. */ #define GPG_ERR_ENABLE_ERRNO_MACROS 1 @@ -829,11 +933,45 @@ ) -# Substitution used for gpgme-config +# Substitution used for gpgme-config and gpgme.pc GPGME_CONFIG_LIBS="-lgpgme" GPGME_CONFIG_CFLAGS="" GPGME_CONFIG_HOST="$host" GPGME_CONFIG_AVAIL_LANG="$enabled_languages" + +case "$includedir" in + /usr/include|/include) ;; + '${prefix}/include') + if test "$prefix" != / -a "$prefix" != /usr; then + if test -z "$GPGME_CONFIG_CFLAGS"; then + GPGME_CONFIG_CFLAGS="-I\${includedir}" + else + GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS" + fi + fi + ;; + *) + if test -z "$GPGME_CONFIG_CFLAGS"; then + GPGME_CONFIG_CFLAGS="-I\${includedir}" + else + GPGME_CONFIG_CFLAGS="-I\${includedir} $GPGME_CONFIG_CFLAGS" + fi + ;; +esac +case "$libdir" in + /usr/lib|/usr/lib64|/lib|/lib64) ;; + '${exec_prefix}/lib'|'${exec_prefix}/lib64') + if test "$exec_prefix" = "NONE"; then + if test "$prefix" != / -a "$prefix" != /usr; then + GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" + fi + elif test "$exec_prefix" != / -a "$exec_prefix" != /usr; then + GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" + fi + ;; + *) GPGME_CONFIG_LIBS="-L\${libdir} $GPGME_CONFIG_LIBS" ;; +esac + AC_SUBST(GPGME_CONFIG_API_VERSION) AC_SUBST(GPGME_CONFIG_LIBS) AC_SUBST(GPGME_CONFIG_CFLAGS) @@ -912,9 +1050,16 @@ AC_CONFIG_FILES(lang/cpp/src/GpgmeppConfigVersion.cmake) AC_CONFIG_FILES(lang/cpp/src/gpgmepp_version.h) AC_CONFIG_FILES(lang/qt/Makefile lang/qt/src/Makefile) -AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in) -AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in) -AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake) +if test "$want_qt5" = "yes"; then + AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig-w32.cmake.in) + AC_CONFIG_FILES(lang/qt/src/QGpgmeConfig.cmake.in) + AC_CONFIG_FILES(lang/qt/src/QGpgmeConfigVersion.cmake) +fi +if test "$want_qt6" = "yes"; then + AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6Config-w32.cmake.in) + AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6Config.cmake.in) + AC_CONFIG_FILES(lang/qt/src/QGpgmeQt6ConfigVersion.cmake) +fi AC_CONFIG_FILES(lang/qt/tests/Makefile) AC_CONFIG_FILES(lang/qt/src/qgpgme_version.h) AC_CONFIG_FILES(lang/Makefile lang/cl/Makefile lang/cl/gpgme.asd) @@ -932,6 +1077,12 @@ AC_CONFIG_FILES(lang/python/setup.py, chmod a+x lang/python/setup.py) AC_OUTPUT +if test "$want_qt5" = "yes"; then + enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 5)/") +elif test "$want_qt6" = "yes"; then + enabled_languages_v=$(echo ${enabled_languages_v:-$enabled_languages} | sed "s/qt/qt (Qt 6)/") +fi + echo " GPGME v${VERSION} has been configured as follows:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/doc/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/doc/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -268,10 +270,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -281,6 +288,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/doc/defsincdate -> _service:tar_scm:gpgme-1.21.0.tar.bz2/doc/defsincdate
Changed
@@ -1,1 +1,1 @@ -1643900190 +1687351130
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/doc/gpgme.info -> _service:tar_scm:gpgme-1.21.0.tar.bz2/doc/gpgme.info
Changed
@@ -19,8 +19,8 @@ This file documents the GPGME library. - This is Edition 1.17.0, last updated 3 February 2022, of ‘The ‘GnuPG -Made Easy’ Reference Manual’, for Version 1.17.0. + This is Edition 1.21.0, last updated 21 June 2023, of ‘The ‘GnuPG +Made Easy’ Reference Manual’, for Version 1.21.0. Copyright © 2002–2008, 2010, 2012–2018 g10 Code GmbH. @@ -37,129 +37,129 @@  Indirect: -gpgme.info-1: 1673 -gpgme.info-2: 303842 +gpgme.info-1: 1670 +gpgme.info-2: 302724  Tag Table: (Indirect) -Node: Top1673 -Node: Introduction9037 -Node: Getting Started9827 -Node: Features11288 -Node: Overview12600 -Node: Preparation13709 -Node: Header14706 -Node: Building the Source15453 -Node: Largefile Support (LFS)17597 -Node: Using Automake23013 -Node: Using Libtool25566 -Node: Library Version Check25928 -Node: Signal Handling31988 -Node: Multi-Threading33258 -Ref: Multi-Threading-Footnote-134674 -Node: Protocols and Engines35097 -Node: Engine Version Check37848 -Node: Engine Information40731 -Node: Engine Configuration44591 -Node: OpenPGP45895 -Node: Cryptographic Message Syntax46235 -Node: Assuan46548 -Node: Algorithms46922 -Ref: Algorithms-Footnote-147401 -Node: Public Key Algorithms47529 -Node: Hash Algorithms50131 -Node: Error Handling51345 -Node: Error Values53219 -Node: Error Sources58422 -Node: Error Codes60862 -Node: Error Strings65655 -Node: Exchanging Data67462 -Node: Creating Data Buffers69347 -Node: Memory Based Data Buffers69863 -Node: File Based Data Buffers73296 -Node: Callback Based Data Buffers76409 -Node: Destroying Data Buffers80600 -Node: Manipulating Data Buffers82107 -Node: Data Buffer I/O Operations82599 -Node: Data Buffer Meta-Data84972 -Node: Data Buffer Convenience90291 -Node: Contexts92511 -Node: Creating Contexts93630 -Node: Destroying Contexts94477 -Node: Result Management94816 -Node: Context Attributes96397 -Node: Protocol Selection97564 -Node: Crypto Engine98610 -Node: Setting the Sender100499 -Node: ASCII Armor102012 -Node: Text Mode102641 -Node: Offline Mode103575 -Node: Pinentry Mode105073 -Node: Included Certificates106967 -Node: Key Listing Mode108413 -Node: Passphrase Callback113537 -Node: Progress Meter Callback117099 -Node: Status Message Callback119084 -Node: Context Flags120849 -Node: Locale128340 -Node: Additional Logs129932 -Node: Key Management132130 -Node: Key objects133354 -Node: Listing Keys148360 -Node: Information About Keys157013 -Node: Manipulating Keys158321 -Node: Generating Keys161219 -Node: Signing Keys179539 -Node: Exporting Keys185298 -Node: Importing Keys192887 -Ref: Importing Keys-Footnote-1201753 -Node: Deleting Keys201881 -Node: Changing Passphrases204161 -Node: Changing TOFU Data205488 -Node: Advanced Key Editing207596 -Node: Crypto Operations210329 -Node: Decrypt211586 -Node: Verify218866 -Node: Decrypt and Verify231959 -Node: Sign234814 -Node: Selecting Signers235378 -Node: Creating a Signature236784 -Node: Signature Notation Data241554 -Node: Encrypt243839 -Node: Encrypting a Plaintext244195 -Node: Miscellaneous258607 -Node: Running other Programs259019 -Node: Using the Assuan protocol261182 -Node: Checking for updates263980 -Node: Run Control268797 -Node: Waiting For Completion269541 -Node: Using External Event Loops271666 -Node: I/O Callback Interface273638 -Node: Registering I/O Callbacks278566 -Node: I/O Callback Example280605 -Node: I/O Callback Example GTK+287230 -Node: I/O Callback Example GDK289019 -Node: I/O Callback Example Qt290661 -Node: Cancellation292949 -Node: UI Server Protocol295257 -Ref: UI Server Protocol-Footnote-1296692 -Node: UI Server Encrypt296811 -Node: UI Server Sign303842 -Node: UI Server Decrypt306195 -Node: UI Server Verify307850 -Node: UI Server Set Input Files311422 -Node: UI Server Sign/Encrypt Files312492 -Node: UI Server Verify/Decrypt Files314300 -Node: UI Server Import/Export Keys316176 -Node: UI Server Checksum Files317238 -Node: Miscellaneous UI Server Commands319456 -Ref: command SENDER321387 -Node: Debugging323089 -Node: Deprecated Functions324838 -Node: Library Copying347847 -Node: Copying376067 -Node: Concept Index413817 -Node: Function and Data Index428529 +Node: Top1670 +Node: Introduction9031 +Node: Getting Started9821 +Node: Features11282 +Node: Overview12594 +Node: Preparation13703 +Node: Header14700 +Node: Building the Source15447 +Node: Largefile Support (LFS)17837 +Node: Using Automake23253 +Node: Using Libtool24827 +Node: Library Version Check25124 +Node: Signal Handling31583 +Node: Multi-Threading32853 +Ref: Multi-Threading-Footnote-134269 +Node: Protocols and Engines34692 +Node: Engine Version Check37443 +Node: Engine Information40492 +Node: Engine Configuration44352 +Node: OpenPGP45656 +Node: Cryptographic Message Syntax45996 +Node: Assuan46309 +Node: Algorithms46683 +Ref: Algorithms-Footnote-147162 +Node: Public Key Algorithms47290 +Node: Hash Algorithms49892 +Node: Error Handling51106 +Node: Error Values52980 +Node: Error Sources58183 +Node: Error Codes60623 +Node: Error Strings65644 +Node: Exchanging Data67451 +Node: Creating Data Buffers69336 +Node: Memory Based Data Buffers69852 +Node: File Based Data Buffers73285 +Node: Callback Based Data Buffers76398 +Node: Destroying Data Buffers80589 +Node: Manipulating Data Buffers82096 +Node: Data Buffer I/O Operations82588 +Node: Data Buffer Meta-Data84961 +Node: Data Buffer Convenience90540 +Node: Contexts92814 +Node: Creating Contexts93933 +Node: Destroying Contexts94780 +Node: Result Management95119 +Node: Context Attributes96700 +Node: Protocol Selection97867 +Node: Crypto Engine98913 +Node: Setting the Sender100802 +Node: ASCII Armor102315 +Node: Text Mode102944 +Node: Offline Mode103878 +Node: Pinentry Mode105376 +Node: Included Certificates107270 +Node: Key Listing Mode108716 +Node: Passphrase Callback114804 +Node: Progress Meter Callback118366 +Node: Status Message Callback120351 +Node: Context Flags122116 +Node: Locale129809 +Node: Additional Logs131401 +Node: Key Management133599 +Node: Key objects134823 +Node: Listing Keys149829 +Node: Information About Keys158482 +Node: Manipulating Keys159790 +Node: Generating Keys162296 +Node: Signing Keys180616 +Node: Exporting Keys186375 +Node: Importing Keys193964 +Ref: Importing Keys-Footnote-1202830 +Node: Deleting Keys202958 +Node: Changing Passphrases205238 +Node: Changing TOFU Data206565 +Node: Advanced Key Editing208673 +Node: Crypto Operations211406 +Node: Decrypt212663 +Node: Verify220745 +Node: Decrypt and Verify236004 +Node: Sign238859 +Node: Selecting Signers239423 +Node: Creating a Signature240829 +Node: Signature Notation Data246452 +Node: Encrypt248737 +Node: Encrypting a Plaintext249093 +Node: Miscellaneous264404 +Node: Running other Programs264816 +Node: Using the Assuan protocol266979 +Node: Checking for updates269777 +Node: Run Control274594 +Node: Waiting For Completion275338 +Node: Using External Event Loops277463 +Node: I/O Callback Interface279435 +Node: Registering I/O Callbacks284363 +Node: I/O Callback Example286402 +Node: I/O Callback Example GTK+293027 +Node: I/O Callback Example GDK294816 +Node: I/O Callback Example Qt296458 +Node: Cancellation298746 +Node: UI Server Protocol302724 +Ref: UI Server Protocol-Footnote-1304159 +Node: UI Server Encrypt304278 +Node: UI Server Sign309636 +Node: UI Server Decrypt311989 +Node: UI Server Verify313644 +Node: UI Server Set Input Files317216 +Node: UI Server Sign/Encrypt Files318286 +Node: UI Server Verify/Decrypt Files320094 +Node: UI Server Import/Export Keys321970 +Node: UI Server Checksum Files323032 +Node: Miscellaneous UI Server Commands325250 +Ref: command SENDER327181 +Node: Debugging328883 +Node: Deprecated Functions331042 +Node: Library Copying354051 +Node: Copying382271 +Node: Concept Index420021 +Node: Function and Data Index434733  End Tag Table
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/doc/gpgme.info-1 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/doc/gpgme.info-1
Changed
@@ -19,8 +19,8 @@ This file documents the GPGME library. - This is Edition 1.17.0, last updated 3 February 2022, of ‘The ‘GnuPG -Made Easy’ Reference Manual’, for Version 1.17.0. + This is Edition 1.21.0, last updated 21 June 2023, of ‘The ‘GnuPG +Made Easy’ Reference Manual’, for Version 1.21.0. Copyright © 2002–2008, 2010, 2012–2018 g10 Code GmbH. @@ -41,8 +41,8 @@ Main Menu ********* -This is Edition 1.17.0, last updated 3 February 2022, of ‘The ‘GnuPG -Made Easy’ Reference Manual’, for Version 1.17.0 of the GPGME library. +This is Edition 1.21.0, last updated 21 June 2023, of ‘The ‘GnuPG Made +Easy’ Reference Manual’, for Version 1.21.0 of the GPGME library. * Menu: @@ -375,42 +375,41 @@ path (via the ‘-I’ option). However, the path to the include file is determined at the time the -source is configured. To solve this problem, gpgme ships with a small -helper program ‘gpgme-config’ that knows about the path to the include -file and other configuration options. The options that need to be added -to the compiler invocation at compile time are output by the ‘--cflags’ -option to ‘gpgme-config’. The following example shows how it can be -used at the command line: - - gcc -c foo.c `gpgme-config --cflags` - - Adding the output of ‘gpgme-config --cflags’ to the compiler command -line will ensure that the compiler can find the GPGME header file. +source is configured. To solve this problem, gpgme ships with +‘gpgme.pc’ file, that knows about the path to the include file and other +configuration options. The command, ‘pkg-config’, can be used to handle +information with ‘gpgme.pc’ file. In an environment which doesn’t have +‘pkg-config’ (like the one in early stage of OS bootstrap), for +Automake, you can use ‘gpgme.m4’ which invokes ‘gpgrt-config’ with +‘gpgme.pc’. (In the past, gpgme used to ship with a small helper +program ‘gpgme-config’. This functionality of ‘gpgme-config’ is +replaced by ‘pkg-config’ with ‘gpgme.pc’ file.) + + The options that need to be added to the compiler invocation at +compile time are output by the ‘--cflags’ option to ‘pkg-config gpgme’. +The following example shows how it can be used at the command line: + + gcc -c foo.c `pkg-config --cflags gpgme` + + Adding the output of ‘pkg-config --cflags gpgme’ to the compiler +command line will ensure that the compiler can find the GPGME header +file. A similar problem occurs when linking the program with the library. Again, the compiler has to find the library files. For this to work, the path to the library files has to be added to the library search path -(via the ‘-L’ option). For this, the option ‘--libs’ to ‘gpgme-config’ -can be used. For convenience, this option also outputs all other +(via the ‘-L’ option). For this, the option ‘--libs’ to ‘pkg-config +gpgme’ can be used. For convenience, this option also outputs all other options that are required to link the program with GPGME (in particular, the ‘-lgpgme’ option). The example shows how to link ‘foo.o’ with the GPGME library to a program ‘foo’. - gcc -o foo foo.o `gpgme-config --libs` + gcc -o foo foo.o `pkg-config --libs gpgme` Of course you can also combine both examples to a single command by -specifying both options to ‘gpgme-config’: - - gcc -o foo foo.c `gpgme-config --cflags --libs` - - If you need to detect the installed language bindings you can use -list them using: - - gpgme-config --print-lang +specifying both options to ‘pkg-config gpgme’: - or test for the availability using - - gpgme-config --have-lang=python && echo 'Bindings for Pythons available' + gcc -o foo foo.c `pkg-config --cflags --libs gpgme`  File: gpgme.info, Node: Largefile Support (LFS), Next: Using Automake, Prev: Building the Source, Up: Preparation @@ -516,45 +515,28 @@ It is much easier if you use GNU Automake instead of writing your own Makefiles. If you do that you do not have to worry about finding and -invoking the ‘gpgme-config’ script at all. GPGME provides an extension -to Automake that does all the work for you. +invoking the ‘pkg-config’ script at all. GPGME provides an extension to +Automake that does all the work for you. -- Macro: AM_PATH_GPGME (MINIMUM-VERSION, ACTION-IF-FOUND, ACTION-IF-NOT-FOUND) - -- Macro: AM_PATH_GPGME_PTH (MINIMUM-VERSION, ACTION-IF-FOUND, - ACTION-IF-NOT-FOUND) - -- Macro: AM_PATH_GPGME_PTHREAD (MINIMUM-VERSION, ACTION-IF-FOUND, - ACTION-IF-NOT-FOUND) Check whether GPGME (at least version MINIMUM-VERSION, if given) exists on the host system. If it is found, execute ACTION-IF-FOUND, otherwise do ACTION-IF-NOT-FOUND, if given. + This macro locates for ‘gpgme.pc’, with cross-compile support. + Additionally, the function defines ‘GPGME_CFLAGS’ to the flags needed for compilation of the program to find the ‘gpgme.h’ header file, and ‘GPGME_LIBS’ to the linker flags needed to link the - program to the GPGME library. If the used helper script does not - match the target type you are building for a warning is printed and - the string ‘libgcrypt’ is appended to the variable - ‘gpg_config_script_warn’. - - ‘AM_PATH_GPGME_PTH’ checks for the version of GPGME that can be - used with GNU Pth, and defines ‘GPGME_PTH_CFLAGS’ and - ‘GPGME_PTH_LIBS’. + program to the GPGME library. - ‘AM_PATH_GPGME_PTHREAD’ checks for the version of GPGME that can be - used with the native pthread implementation, and defines + ‘AM_PATH_GPGME_PTHREAD’ was provided to check for the version of + GPGME with the native pthread implementation, and it defined ‘GPGME_PTHREAD_CFLAGS’ and ‘GPGME_PTHREAD_LIBS’. Since version - 1.8.0 this is no longer required to GPGME_PTHREAD as GPGME itself - is thread safe. - - This macro searches for ‘gpgme-config’ along the PATH. If you are - cross-compiling, it is useful to set the environment variable - ‘SYSROOT’ to the top directory of your target. The macro will then - first look for the helper program in the ‘bin’ directory below that - top directory. An absolute directory name must be used for - ‘SYSROOT’. Finally, if the configure command line option - ‘--with-gpgme-prefix’ is used, only its value is used for the top - directory below which the helper script is expected. + 1.8.0 this is no longer necessary, as GPGME itself is thread safe. + Please use plain ‘AM_PATH_GPGME’ instead, with ‘GPGME_CFLAGS’ and + ‘GPGME_LDFLAGS’. You can use the defined Autoconf variables like this in your ‘Makefile.am’: @@ -569,8 +551,7 @@ ================= The easiest way is to just use GNU Libtool. If you use libtool, and -link to ‘libgpgme.la’, ‘libgpgme-pth.la’ or ‘libgpgme-pthread.la’ -respectively, everything will be done automatically by Libtool. +link to ‘libgpgme.la’, everything will be done automatically by Libtool.  File: gpgme.info, Node: Library Version Check, Next: Signal Handling, Prev: Using Libtool, Up: Preparation @@ -660,6 +641,14 @@ the existent version. The given version must be a string with major, minor, and micro number. Example: "2.1.0". + ‘inst-type’ + The installation type is used to prefer a certain GnuPG + installation. The value is interpreted as an integer: A value + of 0 is ignored, a value of 1 indicates an installation scheme + as used by Gpg4win, a value of 2 indicates an installation + scheme as used by GnuPG Desktop on Windows. All other values + are reserved. + ‘w32-inst-dir’ On Windows GPGME needs to know its installation directory to find its spawn helper. This is in general no problem because @@ -878,6 +867,9 @@ ‘localedir’ Return the name of the directory with GnuPG locale data. + ‘socketdir’ + Return the name of the directory with the following sockets. + ‘agent-socket’ Return the name of the socket to connect to the gpg-agent. @@ -922,6 +914,9 @@ ‘gpg-wks-client-name’ Return the name of the Web Key Service tool. + ‘gpgtar-name’ + Return the name of the gpgtar program. + -- Function: gpgme_error_t gpgme_engine_check_version (gpgme_protocol_t PROTOCOL) The function ‘gpgme_engine_check_version’ verifies that the engine @@ -1508,6 +1503,11 @@ ‘GPG_ERR_CANCELED’ This value means that the operation was canceled. +‘GPG_ERR_FULLY_CANCELED’ + This value means that the operation was canceled. It is sometimes + returned instead of ‘GPG_ERR_CANCELED’ for internal reasons in + GnuPG. You should treat both values identically. + ‘GPG_ERR_INV_ENGINE’ This value means that the engine that implements the desired protocol is currently not available. This can either be because @@ -2032,6 +2032,11 @@ the output when encrypting or signing the data and will be returned to the user when decrypting or verifying the output data. + If a signed or encrypted archive is created, then the file name + will be interpreted as the base directory for the relative paths of + the files and directories to put into the archive. This + corresponds to the –directory option of gpgtar. + The function returns the error code ‘GPG_ERR_INV_VALUE’ if DH is not a valid pointer and ‘GPG_ERR_ENOMEM’ if not enough memory is available. @@ -2178,7 +2183,8 @@ The data is a PKCS#12 message. This is commonly used to exchange private keys for X.509. - -- Function: gpgme_data_type_t gpgme_data_identify (gpgme_data_t DH) + -- Function: gpgme_data_type_t gpgme_data_identify + (gpgme_data_t DH, int RESERVED) SINCE: 1.4.3 The function ‘gpgme_data_identify’ returns the type of the data @@ -2188,6 +2194,7 @@ object has been created the identification may not be possible or the data object may change its internal state (file pointer moved). For file or memory based data object, the state should not change. + RESERVED should be zero.  File: gpgme.info, Node: Contexts, Next: UI Server Protocol, Prev: Exchanging Data, Up: Top @@ -2686,6 +2693,27 @@ Currently only implemented for the S/MIME backend and ignored for other backends. + ‘GPGME_KEYLIST_MODE_FORCE_EXTERN’ + SINCE: 1.18.0 + + The ‘GPGME_KEYLIST_MODE_FORCE_EXTERN’ symbol specifies that + only external sources should be searched for keys in the + keylisting operation. If used in combination with + ‘GPGME_KEYLIST_MODE_LOCATE’, the keylisting results in a + ‘--locate-external-keys’ for ‘GPGME_PROTOCOL_OpenPGP’. The + combination with ‘GPGME_KEYLIST_MODE_LOCAL’, but without + ‘GPGME_KEYLIST_MODE_EXTERN’ is not allowed. Currently only + implemented for the OpenPGP backend and ignored for other + backends. + + ‘GPGME_KEYLIST_MODE_LOCATE_EXTERNAL’ + SINCE: 1.18.0 + + This is a shortcut for the combination of + ‘GPGME_KEYLIST_MODE_LOCATE’ and + ‘GPGME_KEYLIST_MODE_FORCE_EXTERN’, which results in a + ‘--locate-external-keys’ for ‘GPGME_PROTOCOL_OpenPGP’. + At least one of ‘GPGME_KEYLIST_MODE_LOCAL’ and ‘GPGME_KEYLIST_MODE_EXTERN’ must be specified. For future binary compatibility, you should get the current mode with @@ -2924,8 +2952,8 @@ session key is specific to GnuPG and can be retrieved during a decrypt operation when the context flag "export-session-key" is enabled. Please be aware that using this feature with - GnuPG < 2.1.16 will leak the session key on many platforms via - ps(1). + GnuPG < 2.1.16 or when decrypting an archive will leak the + session key on many platforms via ps(1). ‘"auto-key-retrieve"’ Setting the VALUE to "1" asks the backend to automatically @@ -3016,6 +3044,10 @@ documented in the GnuPG manual and the gpg man page under the option ‘--import-filter’. + ‘"no-auto-check-trustdb"’ + SINCE: 1.19.0 Setting the VALUE to "1" forces the GPG backend + to disable the automatic check of the trust database. + This function returns ‘0’ on success. -- Function: const char * gpgme_get_ctx_flag (gpgme_ctx_t CTX, @@ -3874,16 +3906,6 @@ completed by calling ‘gpgme_wait’ on the context. *Note Waiting For Completion::. - -- Function: gpgme_error_t gpgme_op_revuid_start (gpgme_ctx_t CTX, - gpgme_key_t KEY, const char *USERID, unsigned int FLAGS); - - SINCE: 1.14.1 - - The function ‘gpgme_op_setexpire_start’ initiates a - ‘gpgme_op_setexpire’ operation; see there for details. It must be - completed by calling ‘gpgme_wait’ on the context. *Note Waiting - For Completion::. -  File: gpgme.info, Node: Generating Keys, Next: Signing Keys, Prev: Manipulating Keys, Up: Key Management @@ -5088,7 +5110,9 @@ -- Function: gpgme_error_t gpgme_op_decrypt (gpgme_ctx_t CTX, gpgme_data_t CIPHER, gpgme_data_t PLAIN) The function ‘gpgme_op_decrypt’ decrypts the ciphertext in the data - object CIPHER and stores it into the data object PLAIN. + object CIPHER or, if a file name is set on the data object, the + ciphertext stored in the corresponding file. The decrypted + ciphertext is stored into the data object PLAIN. The function returns the error code ‘GPG_ERR_NO_ERROR’ if the ciphertext could be decrypted successfully, ‘GPG_ERR_INV_VALUE’ if @@ -5119,6 +5143,12 @@ ‘gpgme_op_decrypt’ but has an additional argument FLAGS. If FLAGS is 0 both function behave identically. + If the flag ‘GPGME_DECRYPT_ARCHIVE’ is set, then an encrypted + archive in the data object CIPHER is decrypted and extracted. The + content of the archive is extracted into a directory named + ‘GPGARCH_n_’ (where ‘n’ is a number) or into the directory set with + ‘gpgme_data_set_file_name’ for the data object PLAIN. + The value in FLAGS is a bitwise-or combination of one or multiple of the following bit values: @@ -5128,6 +5158,14 @@ The ‘GPGME_DECRYPT_VERIFY’ symbol specifies that this function shall exactly act as ‘gpgme_op_decrypt_verify’. + ‘GPGME_DECRYPT_ARCHIVE’ + SINCE: 1.19.0 + + The ‘GPGME_DECRYPT_ARCHIVE’ symbol specifies that the input is + an encrypted archive that shall be decrypted and extracted. + This feature is currently only supported for the OpenPGP + crypto engine and requires GnuPG 2.4.1. + ‘GPGME_DECRYPT_UNWRAP’ SINCE: 1.8.0 @@ -5267,7 +5305,11 @@ and PLAIN should be a null pointer. Otherwise, if SIG is a normal (or cleartext) signature, SIGNED_TEXT should be a null pointer and PLAIN should be a writable data object that will contain the - plaintext after successful verification. + plaintext after successful verification. If a file name is set on + the data object SIG (or on the data object SIGNED_TEXT), then the + data of the signature (resp. the data of the signed text) is not + read from the data object but from the file with the given file + name. The results of the individual signature verifications can be retrieved with ‘gpgme_op_verify_result’. @@ -5290,6 +5332,47 @@ CTX, SIG or PLAIN is not a valid pointer, and ‘GPG_ERR_NO_DATA’ if SIG or PLAIN does not contain any data to verify. + -- Function: gpgme_error_t gpgme_op_verify_ext ( gpgme_ctx_t CTX, + gpgme_verify_flags_t FLAGS, gpgme_data_t SIG, + gpgme_data_t SIGNED_TEXT, gpgme_data_t PLAIN) + + The function ‘gpgme_op_verify_ext’ is the same as ‘gpgme_op_verify’ + but has an additional argument FLAGS. If FLAGS is 0 both function + behave identically. + + If the flag ‘GPGME_VERIFY_ARCHIVE’ is set, then a signed archive in + the data object SIG is verified and extracted. The content of the + archive is extracted into a directory named ‘GPGARCH_n_’ (where ‘n’ + is a number) or into the directory set with + ‘gpgme_data_set_file_name’ for the data object PLAIN. + + The value in FLAGS is a bitwise-or combination of one or multiple + of the following bit values: + + ‘GPGME_VERIFY_ARCHIVE’ + SINCE: 1.19.0 + + The ‘GPGME_VERIFY_ARCHIVE’ symbol specifies that the input is + a signed archive that shall be verified and extracted. This + feature is currently only supported for the OpenPGP crypto + engine and requires GnuPG 2.4.1. + + The function returns the error codes as descriped for + ‘gpgme_op_decrypt’ respective ‘gpgme_op_encrypt’. + + -- Function: gpgme_error_t gpgme_op_verify_ext_start ( gpgme_ctx_t CTX, + gpgme_verify_flags_t FLAGS, gpgme_data_t SIG, + gpgme_data_t SIGNED_TEXT, gpgme_data_t PLAIN) + + The function ‘gpgme_op_verify_ext_start’ initiates a + ‘gpgme_op_verify_ext’ operation. It can be completed by calling + ‘gpgme_wait’ on the context. *Note Waiting For Completion::. + + The function returns the error code ‘GPG_ERR_NO_ERROR’ if the + operation could be started successfully, ‘GPG_ERR_INV_VALUE’ if + CTX, SIG or PLAIN is not a valid pointer, and ‘GPG_ERR_NO_DATA’ if + SIG or PLAIN does not contain any data to verify. + -- Data type: gpgme_sig_notation_t This is a pointer to a structure used to store a part of the result of a ‘gpgme_op_verify’ operation. The structure contains the @@ -5699,14 +5782,29 @@ A clear text signature is made. The ASCII armor and text mode settings of the context are ignored. + ‘GPGME_SIG_MODE_ARCHIVE’ + SINCE: 1.19.0 + + A signed archive is created from the given files and + directories. This feature is currently only supported for the + OpenPGP crypto engine and requires GnuPG 2.4.1. + -- Function: gpgme_error_t gpgme_op_sign (gpgme_ctx_t CTX, gpgme_data_t PLAIN, gpgme_data_t SIG, gpgme_sig_mode_t MODE) The function ‘gpgme_op_sign’ creates a signature for the text in - the data object PLAIN and returns it in the data object SIG. The - type of the signature created is determined by the ASCII armor (or, - if that is not set, by the encoding specified for SIG), the text - mode attributes set for the context CTX and the requested signature - mode MODE. + the data object PLAIN and returns it in the data object SIG or + writes it directly to the file set with ‘gpgme_data_set_file_name’ + for the data object SIG. The type of the signature created is + determined by the ASCII armor (or, if that is not set, by the + encoding specified for SIG), the text mode attributes set for the + context CTX and the requested signature mode MODE. + + If signature mode ‘GPGME_SIG_MODE_ARCHIVE’ is requested, then a + signed archive is created from the files and directories given as + NUL-separated list in the data object PLAIN and returned in the + data object SIG. The paths of the files and directories have to be + given as paths relative to the current working directory or + relative to the base directory set with ‘gpgme_data_set_file_name’. After the operation completed successfully, the result can be retrieved with ‘gpgme_op_sign_result’. @@ -5754,7 +5852,8 @@ The hash algorithm used to create this signature. ‘unsigned int sig_class’ - The signature class of this signature. + The signature class of this signature. Note that only the + values 0, 1, and 2 are well-defined. ‘long int timestamp’ The creation timestamp of this signature. @@ -5867,10 +5966,18 @@ gpgme_data_t PLAIN, gpgme_data_t CIPHER) The function ‘gpgme_op_encrypt’ encrypts the plaintext in the data object PLAIN for the recipients RECP and stores the ciphertext in - the data object CIPHER. The type of the ciphertext created is - determined by the ASCII armor (or, if that is not set, by the - encoding specified for CIPHER) and the text mode attributes set for - the context CTX. + the data object CIPHER or writes it directly to the file set with + ‘gpgme_data_set_file_name’ for the data object CIPHER. The type of + the ciphertext created is determined by the ASCII armor (or, if + that is not set, by the encoding specified for CIPHER) and the text + mode attributes set for the context CTX. + + If the flag ‘GPGME_ENCRYPT_ARCHIVE’ is set, then an encrypted + archive is created from the files and directories given as + NUL-separated list in the data object PLAIN and returned in the + data object CIPHER. The paths of the files and directories have to + be given as paths relative to the current working directory or + relative to the base directory set with ‘gpgme_data_set_file_name’. RECP must be a ‘NULL’-terminated array of keys. The user must keep references for all keys during the whole duration of the call (but @@ -5948,6 +6055,15 @@ functions. This feature is currently only supported for the OpenPGP crypto engine. + ‘GPGME_ENCRYPT_ARCHIVE’ + SINCE: 1.19.0 + + The ‘GPGME_ENCRYPT_ARCHIVE’ symbol specifies that the input is + a NUL-separated list of file paths and directory paths that + shall be encrypted into an archive. This feature is currently + only supported for the OpenPGP crypto engine and requires + GnuPG 2.4.1. + If ‘GPG_ERR_UNUSABLE_PUBKEY’ is returned, some recipients in RECP are invalid, but not all. In this case the plaintext might be encrypted for all valid recipients and returned in CIPHER (if this @@ -7154,161 +7270,3 @@ The function returns an error code if the cancellation failed (in this case the state of CTX is not modified). - -File: gpgme.info, Node: UI Server Protocol, Next: Debugging, Prev: Contexts, Up: Top - -Appendix A The GnuPG UI Server Protocol -*************************************** - -This section specifies the protocol used between clients and a User -Interface Server (UI server). This protocol helps to build a system -where all cryptographic operations are done by a server and the server -is responsible for all dialogs. Although GPGME has no direct support -for this protocol it is believed that servers will utilize the GPGME -library; thus having the specification included in this manual is an -appropriate choice. This protocol should be referenced as ‘The GnuPG UI -Server Protocol’. - -A server needs to implement these commands:(1) - -* Menu: - -* UI Server Encrypt:: Encrypt a message. -* UI Server Sign:: Sign a message. -* UI Server Decrypt:: Decrypt a message. -* UI Server Verify:: Verify a message. -* UI Server Set Input Files:: Specifying the input files to operate on. -* UI Server Sign/Encrypt Files:: Encrypting and signing files. -* UI Server Verify/Decrypt Files:: Decrypting and verifying files. -* UI Server Import/Export Keys:: Managing certificates. -* UI Server Checksum Files:: Create and verify checksums for files. -* Miscellaneous UI Server Commands:: Commands not related to a specific operation. - - ---------- Footnotes ---------- - - (1) In all examples we assume that the connection has already been -established; see the Assuan manual for details. - - -File: gpgme.info, Node: UI Server Encrypt, Next: UI Server Sign, Up: UI Server Protocol - -A.1 UI Server: Encrypt a Message -================================ - -Before encryption can be done the recipients must be set using the -command: - - -- Command: RECIPIENT STRING - - Set the recipient for the encryption. STRING is an RFC-2822 - recipient name ("mailbox" as per section 3.4). This command may or - may not check the recipient for validity right away; if it does not - all recipients are expected to be checked at the time of the - ‘ENCRYPT’ command. All ‘RECIPIENT’ commands are cumulative until a - successful ‘ENCRYPT’ command or until a ‘RESET’ command. Linefeeds - are obviously not allowed in STRING and should be folded into - spaces (which are equivalent). - -To tell the server the source and destination of the data, the next two -commands are to be used: - - -- Command: INPUT FD=N - Set the file descriptor for the message to be encrypted to N. The - message send to the server is binary encoded. - - GpgOL is a Windows only program, thus N is not a libc file - descriptor but a regular system handle. Given that the Assuan - connection works over a socket, it is not possible to use regular - inheritance to make the file descriptor available to the server. - Thus ‘DuplicateHandle’ needs to be used to duplicate a handle to - the server process. This is the reason that the server needs to - implement the ‘GETINFO pid’ command. Sending this command a second - time replaces the file descriptor set by the last one. - - -- Command: OUTPUT FD=N --binary - Set the file descriptor to be used for the output (i.e. the - encrypted message) to N. If the option ‘--binary’ is given the - output shall be in binary format; if not given, the output for - OpenPGP needs to be ASCII armored and for CMS Base-64 encoded. For - details on the file descriptor, see the ‘INPUT’ command. - -The setting of the recipients, the data source and destination may -happen in any order, even intermixed. If this has been done the actual -encryption operation is called using: - - -- Command: ENCRYPT --protocol=NAME - - This command reads the plaintext from the file descriptor set by - the ‘INPUT’ command, encrypts it and writes the ciphertext to the - file descriptor set by the ‘OUTPUT’ command. The server may (and - should) overlap reading and writing. The recipients used for the - encryption are all the recipients set so far. If any recipient is - not usable the server should take appropriate measures to notify - the user about the problem and may cancel the operation by - returning an error code. The used file descriptors are void after - this command; the recipient list is only cleared if the server - returns success. - - Because GpgOL uses a streaming mode of operation the server is not - allowed to auto select the protocol and must obey to the mandatory - PROTOCOL parameter: - - ‘OpenPGP’ - Use the OpenPGP protocol (RFC-2440). - ‘CMS’ - Use the CMS (PKCS#7) protocol (RFC-3852). - - To support automagically selection of the protocol depending on the -selected keys, the server MAY implement the command: - - -- Command: PREP_ENCRYPT --protocol=NAME --expect-sign - - This commands considers all recipients set so far and decides - whether it is able to take input and start the actual encryption. - This is kind of a dry-run ‘ENCRYPT’ without requiring or using the - input and output file descriptors. The server shall cache the - result of any user selection to avoid asking this again when the - actual ‘ENCRYPT’ command is send. The ‘--protocol’ option is - optional; if it is not given, the server should allow the user to - select the protocol to be used based on the recipients given or by - any other means. - - If ‘--expect-sign’ is given the server should expect that the - message will also be signed and use this hint to present a unified - recipient and signer selection dialog if possible and desired. A - selected signer should then be cached for the expected SIGN command - (which is expected in the same session but possible on another - connection). - - If this command is given again before a successful ‘ENCRYPT’ - command, the second one takes effect. - - Before sending the OK response the server shall tell the client the - protocol to be used (either the one given by the argument or the - one selected by the user) by means of a status line: - - -- Status line: PROTOCOL NAME - Advise the client to use the protocol NAME for the ‘ENCRYPT’ - command. The valid protocol names are listed under the description - of the ‘ENCRYPT’ command. The server shall emit exactly one - PROTOCOL status line. - -Here is an example of a complete encryption sequence; client lines are -indicated by a C:, server responses by C:: - - C: RESET - S: OK - C: RECIPIENT foo@example.net - S: OK - C: RECIPIENT bar@example.com - S: OK - C: PREP_ENCRYPT - S: S PROTOCOL OpenPGP - S: OK - C: INPUT FD=17 - S: OK - C: OUTPUT FD=18 - S: OK - C: ENCRYPT - S: OK -
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/doc/gpgme.info-2 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/doc/gpgme.info-2
Changed
@@ -19,8 +19,8 @@ This file documents the GPGME library. - This is Edition 1.17.0, last updated 3 February 2022, of ‘The ‘GnuPG -Made Easy’ Reference Manual’, for Version 1.17.0. + This is Edition 1.21.0, last updated 21 June 2023, of ‘The ‘GnuPG +Made Easy’ Reference Manual’, for Version 1.21.0. Copyright © 2002–2008, 2010, 2012–2018 g10 Code GmbH. @@ -36,6 +36,164 @@ Public License for more details.  +File: gpgme.info, Node: UI Server Protocol, Next: Debugging, Prev: Contexts, Up: Top + +Appendix A The GnuPG UI Server Protocol +*************************************** + +This section specifies the protocol used between clients and a User +Interface Server (UI server). This protocol helps to build a system +where all cryptographic operations are done by a server and the server +is responsible for all dialogs. Although GPGME has no direct support +for this protocol it is believed that servers will utilize the GPGME +library; thus having the specification included in this manual is an +appropriate choice. This protocol should be referenced as ‘The GnuPG UI +Server Protocol’. + +A server needs to implement these commands:(1) + +* Menu: + +* UI Server Encrypt:: Encrypt a message. +* UI Server Sign:: Sign a message. +* UI Server Decrypt:: Decrypt a message. +* UI Server Verify:: Verify a message. +* UI Server Set Input Files:: Specifying the input files to operate on. +* UI Server Sign/Encrypt Files:: Encrypting and signing files. +* UI Server Verify/Decrypt Files:: Decrypting and verifying files. +* UI Server Import/Export Keys:: Managing certificates. +* UI Server Checksum Files:: Create and verify checksums for files. +* Miscellaneous UI Server Commands:: Commands not related to a specific operation. + + ---------- Footnotes ---------- + + (1) In all examples we assume that the connection has already been +established; see the Assuan manual for details. + + +File: gpgme.info, Node: UI Server Encrypt, Next: UI Server Sign, Up: UI Server Protocol + +A.1 UI Server: Encrypt a Message +================================ + +Before encryption can be done the recipients must be set using the +command: + + -- Command: RECIPIENT STRING + + Set the recipient for the encryption. STRING is an RFC-2822 + recipient name ("mailbox" as per section 3.4). This command may or + may not check the recipient for validity right away; if it does not + all recipients are expected to be checked at the time of the + ‘ENCRYPT’ command. All ‘RECIPIENT’ commands are cumulative until a + successful ‘ENCRYPT’ command or until a ‘RESET’ command. Linefeeds + are obviously not allowed in STRING and should be folded into + spaces (which are equivalent). + +To tell the server the source and destination of the data, the next two +commands are to be used: + + -- Command: INPUT FD=N + Set the file descriptor for the message to be encrypted to N. The + message send to the server is binary encoded. + + GpgOL is a Windows only program, thus N is not a libc file + descriptor but a regular system handle. Given that the Assuan + connection works over a socket, it is not possible to use regular + inheritance to make the file descriptor available to the server. + Thus ‘DuplicateHandle’ needs to be used to duplicate a handle to + the server process. This is the reason that the server needs to + implement the ‘GETINFO pid’ command. Sending this command a second + time replaces the file descriptor set by the last one. + + -- Command: OUTPUT FD=N --binary + Set the file descriptor to be used for the output (i.e. the + encrypted message) to N. If the option ‘--binary’ is given the + output shall be in binary format; if not given, the output for + OpenPGP needs to be ASCII armored and for CMS Base-64 encoded. For + details on the file descriptor, see the ‘INPUT’ command. + +The setting of the recipients, the data source and destination may +happen in any order, even intermixed. If this has been done the actual +encryption operation is called using: + + -- Command: ENCRYPT --protocol=NAME + + This command reads the plaintext from the file descriptor set by + the ‘INPUT’ command, encrypts it and writes the ciphertext to the + file descriptor set by the ‘OUTPUT’ command. The server may (and + should) overlap reading and writing. The recipients used for the + encryption are all the recipients set so far. If any recipient is + not usable the server should take appropriate measures to notify + the user about the problem and may cancel the operation by + returning an error code. The used file descriptors are void after + this command; the recipient list is only cleared if the server + returns success. + + Because GpgOL uses a streaming mode of operation the server is not + allowed to auto select the protocol and must obey to the mandatory + PROTOCOL parameter: + + ‘OpenPGP’ + Use the OpenPGP protocol (RFC-2440). + ‘CMS’ + Use the CMS (PKCS#7) protocol (RFC-3852). + + To support automagically selection of the protocol depending on the +selected keys, the server MAY implement the command: + + -- Command: PREP_ENCRYPT --protocol=NAME --expect-sign + + This commands considers all recipients set so far and decides + whether it is able to take input and start the actual encryption. + This is kind of a dry-run ‘ENCRYPT’ without requiring or using the + input and output file descriptors. The server shall cache the + result of any user selection to avoid asking this again when the + actual ‘ENCRYPT’ command is send. The ‘--protocol’ option is + optional; if it is not given, the server should allow the user to + select the protocol to be used based on the recipients given or by + any other means. + + If ‘--expect-sign’ is given the server should expect that the + message will also be signed and use this hint to present a unified + recipient and signer selection dialog if possible and desired. A + selected signer should then be cached for the expected SIGN command + (which is expected in the same session but possible on another + connection). + + If this command is given again before a successful ‘ENCRYPT’ + command, the second one takes effect. + + Before sending the OK response the server shall tell the client the + protocol to be used (either the one given by the argument or the + one selected by the user) by means of a status line: + + -- Status line: PROTOCOL NAME + Advise the client to use the protocol NAME for the ‘ENCRYPT’ + command. The valid protocol names are listed under the description + of the ‘ENCRYPT’ command. The server shall emit exactly one + PROTOCOL status line. + +Here is an example of a complete encryption sequence; client lines are +indicated by a C:, server responses by C:: + + C: RESET + S: OK + C: RECIPIENT foo@example.net + S: OK + C: RECIPIENT bar@example.com + S: OK + C: PREP_ENCRYPT + S: S PROTOCOL OpenPGP + S: OK + C: INPUT FD=17 + S: OK + C: OUTPUT FD=18 + S: OK + C: ENCRYPT + S: OK + + File: gpgme.info, Node: UI Server Sign, Next: UI Server Decrypt, Prev: UI Server Encrypt, Up: UI Server Protocol A.2 UI Server: Sign a Message @@ -484,6 +642,14 @@ application. If you are asked to send a log file, make sure that you run your tests only with play data. + The trace function makes use of gpgrt’s logging function and thus the +special ‘socket://’ and ‘tcp://’ files may be used. Because this +conflicts with the use of colons to separate fields, the following hack +is used: If the file name contains the string ‘^//’ all carets are +replaced by colons. For example to log to TCP port 42042 this can be +used: + GPGME_DEBUG=5:tcp^//127.0.0.1^42042 +  File: gpgme.info, Node: Deprecated Functions, Next: Library Copying, Prev: Debugging, Up: Top @@ -2544,8 +2710,6 @@ * Menu: * AM_PATH_GPGME: Using Automake. (line 11) -* AM_PATH_GPGME_PTH: Using Automake. (line 13) -* AM_PATH_GPGME_PTHREAD: Using Automake. (line 15) * CHECKSUM_CREATE_FILES: UI Server Checksum Files. (line 9) * CHECKSUM_VERIFY_FILES: UI Server Checksum Files. @@ -2561,7 +2725,7 @@ * ENCRYPT_SIGN_FILES: UI Server Sign/Encrypt Files. (line 11) * enum gpgme_data_encoding_t: Data Buffer Meta-Data. - (line 31) + (line 36) * enum gpgme_data_type_t: Data Buffer Convenience. (line 6) * enum gpgme_event_io_t: I/O Callback Interface. @@ -2594,9 +2758,9 @@ * gpgme_ctx_set_engine_info: Crypto Engine. (line 26) * gpgme_ctx_t: Contexts. (line 11) * gpgme_data_encoding_t: Data Buffer Meta-Data. - (line 32) + (line 37) * gpgme_data_get_encoding: Data Buffer Meta-Data. - (line 81) + (line 86) * gpgme_data_get_file_name: Data Buffer Meta-Data. (line 6) * gpgme_data_identify: Data Buffer Convenience. @@ -2636,11 +2800,11 @@ * gpgme_data_seek_cb_t: Callback Based Data Buffers. (line 46) * gpgme_data_set_encoding: Data Buffer Meta-Data. - (line 87) + (line 92) * gpgme_data_set_file_name: Data Buffer Meta-Data. (line 18) * gpgme_data_set_flag: Data Buffer Meta-Data. - (line 92) + (line 97) * gpgme_data_t: Exchanging Data. (line 13) * gpgme_data_type_t: Data Buffer Convenience. (line 7) @@ -2648,13 +2812,13 @@ (line 16) * gpgme_data_write_cb_t: Callback Based Data Buffers. (line 29) -* gpgme_decrypt_result_t: Decrypt. (line 101) +* gpgme_decrypt_result_t: Decrypt. (line 117) * gpgme_edit_cb_t: Deprecated Functions. (line 33) * gpgme_encrypt_result_t: Encrypting a Plaintext. - (line 241) + (line 258) * gpgme_engine_check_version: Engine Version Check. - (line 82) + (line 88) * gpgme_engine_info_t: Engine Information. (line 6) * gpgme_error: Error Values. (line 65) * gpgme_error_from_errno: Error Values. (line 89) @@ -2693,7 +2857,7 @@ (line 25) * gpgme_genkey_result_t: Generating Keys. (line 381) * gpgme_get_armor: ASCII Armor. (line 13) -* gpgme_get_ctx_flag: Context Flags. (line 153) +* gpgme_get_ctx_flag: Context Flags. (line 157) * gpgme_get_dirinfo: Engine Version Check. (line 6) * gpgme_get_engine_info: Engine Information. (line 46) @@ -2702,7 +2866,7 @@ * gpgme_get_io_cbs: Registering I/O Callbacks. (line 44) * gpgme_get_key: Listing Keys. (line 178) -* gpgme_get_keylist_mode: Key Listing Mode. (line 103) +* gpgme_get_keylist_mode: Key Listing Mode. (line 124) * gpgme_get_offline: Offline Mode. (line 31) * gpgme_get_passphrase_cb: Passphrase Callback. (line 63) * gpgme_get_pinentry_mode: Pinentry Mode. (line 18) @@ -2749,7 +2913,7 @@ * gpgme_key_unref: Manipulating Keys. (line 10) * gpgme_new: Creating Contexts. (line 6) * gpgme_new_signature_t: Creating a Signature. - (line 57) + (line 72) * gpgme_off_t: Exchanging Data. (line 24) * gpgme_op_adduid: Generating Keys. (line 189) * gpgme_op_adduid_start: Generating Keys. (line 215) @@ -2766,10 +2930,10 @@ * gpgme_op_createsubkey: Generating Keys. (line 132) * gpgme_op_createsubkey_start: Generating Keys. (line 176) * gpgme_op_decrypt: Decrypt. (line 6) -* gpgme_op_decrypt_ext: Decrypt. (line 30) -* gpgme_op_decrypt_ext_start: Decrypt. (line 60) -* gpgme_op_decrypt_result: Decrypt. (line 164) -* gpgme_op_decrypt_start: Decrypt. (line 20) +* gpgme_op_decrypt_ext: Decrypt. (line 32) +* gpgme_op_decrypt_ext_start: Decrypt. (line 76) +* gpgme_op_decrypt_result: Decrypt. (line 180) +* gpgme_op_decrypt_start: Decrypt. (line 22) * gpgme_op_decrypt_verify: Decrypt and Verify. (line 6) * gpgme_op_decrypt_verify_start: Decrypt and Verify. (line 30) * gpgme_op_delete: Deleting Keys. (line 47) @@ -2783,21 +2947,21 @@ * gpgme_op_encrypt: Encrypting a Plaintext. (line 6) * gpgme_op_encrypt_ext: Encrypting a Plaintext. - (line 131) + (line 148) * gpgme_op_encrypt_ext_start: Encrypting a Plaintext. - (line 224) + (line 241) * gpgme_op_encrypt_result: Encrypting a Plaintext. - (line 252) + (line 269) * gpgme_op_encrypt_sign: Encrypting a Plaintext. - (line 263) + (line 280) * gpgme_op_encrypt_sign_ext: Encrypting a Plaintext. - (line 288) + (line 305) * gpgme_op_encrypt_sign_ext_start: Encrypting a Plaintext. - (line 304) + (line 321) * gpgme_op_encrypt_sign_start: Encrypting a Plaintext. - (line 274) + (line 291) * gpgme_op_encrypt_start: Encrypting a Plaintext. - (line 113) + (line 130) * gpgme_op_export: Exporting Keys. (line 65) * gpgme_op_export_ext: Exporting Keys. (line 98) * gpgme_op_export_ext_start: Exporting Keys. (line 120) @@ -2841,18 +3005,17 @@ * gpgme_op_revsig: Signing Keys. (line 89) * gpgme_op_revsig_start: Signing Keys. (line 124) * gpgme_op_revuid: Generating Keys. (line 224) -* gpgme_op_revuid_start: Manipulating Keys. (line 58) -* gpgme_op_revuid_start <1>: Generating Keys. (line 252) +* gpgme_op_revuid_start: Generating Keys. (line 252) * gpgme_op_setexpire: Manipulating Keys. (line 15) * gpgme_op_setexpire_start: Manipulating Keys. (line 47) * gpgme_op_set_uid_flag_start: Generating Keys. (line 293) * gpgme_op_set_ui_flag: Generating Keys. (line 261) * gpgme_op_sign: Creating a Signature. - (line 21) + (line 28) * gpgme_op_sign_result: Creating a Signature. - (line 99) + (line 115) * gpgme_op_sign_start: Creating a Signature. - (line 47) + (line 62) * gpgme_op_spawn: Running other Programs. (line 13) * gpgme_op_spawn_start: Running other Programs. @@ -2860,8 +3023,10 @@ * gpgme_op_tofu_policy: Changing TOFU Data. (line 29) * gpgme_op_tofu_policy_start: Changing TOFU Data. (line 43) * gpgme_op_verify: Verify. (line 6) -* gpgme_op_verify_result: Verify. (line 298) -* gpgme_op_verify_start: Verify. (line 26) +* gpgme_op_verify_ext: Verify. (line 42) +* gpgme_op_verify_ext_start: Verify. (line 71) +* gpgme_op_verify_result: Verify. (line 346) +* gpgme_op_verify_start: Verify. (line 30) * gpgme_passphrase_cb_t: Passphrase Callback. (line 10) * gpgme_pinentry_mode_t: Pinentry Mode. (line 26) * gpgme_progress_cb_t: Progress Meter Callback. @@ -2877,7 +3042,7 @@ (line 10) * gpgme_query_swdb_result_t: Checking for updates. (line 11) -* gpgme_recipient_t: Decrypt. (line 75) +* gpgme_recipient_t: Decrypt. (line 91) * gpgme_register_io_cb_t: I/O Callback Interface. (line 23) * gpgme_release: Destroying Contexts. (line 6) @@ -2905,13 +3070,13 @@ * gpgme_set_status_cb: Status Message Callback. (line 17) * gpgme_set_textmode: Text Mode. (line 6) -* gpgme_signature_t: Verify. (line 92) +* gpgme_signature_t: Verify. (line 140) * gpgme_signers_add: Selecting Signers. (line 18) * gpgme_signers_clear: Selecting Signers. (line 11) * gpgme_signers_count: Selecting Signers. (line 25) * gpgme_signers_enum: Selecting Signers. (line 31) * gpgme_sign_result_t: Creating a Signature. - (line 85) + (line 101) * gpgme_sig_mode_t: Creating a Signature. (line 7) * gpgme_sig_notation_add: Signature Notation Data. @@ -2920,7 +3085,7 @@ (line 10) * gpgme_sig_notation_get: Signature Notation Data. (line 45) -* gpgme_sig_notation_t: Verify. (line 38) +* gpgme_sig_notation_t: Verify. (line 86) * gpgme_sig_stat_t: Deprecated Functions. (line 388) * gpgme_ssize_t: Exchanging Data. (line 32) @@ -2935,7 +3100,7 @@ * gpgme_user_id_t: Key objects. (line 217) * gpgme_validity_t: Information About Keys. (line 9) -* gpgme_verify_result_t: Verify. (line 276) +* gpgme_verify_result_t: Verify. (line 324) * gpgme_wait: Waiting For Completion. (line 6) * IMPORT_FILES: UI Server Import/Export Keys.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/doc/gpgme.texi -> _service:tar_scm:gpgme-1.21.0.tar.bz2/doc/gpgme.texi
Changed
@@ -421,18 +421,28 @@ file search path (via the @option{-I} option). However, the path to the include file is determined at the time the -source is configured. To solve this problem, gpgme ships with a small -helper program @command{gpgme-config} that knows about the path to the -include file and other configuration options. The options that need -to be added to the compiler invocation at compile time are output by -the @option{--cflags} option to @command{gpgme-config}. The following -example shows how it can be used at the command line: +source is configured. To solve this problem, gpgme ships with +@code{gpgme.pc} file, that knows about the path to the include file +and other configuration options. The command, @command{pkg-config}, +can be used to handle information with @code{gpgme.pc} file. In an +environment which doesn't have @command{pkg-config} (like the one in +early stage of OS bootstrap), for Automake, you can use +@code{gpgme.m4} which invokes @command{gpgrt-config} with +@code{gpgme.pc}. (In the past, gpgme used to ship with a small helper +program @command{gpgme-config}. This functionality of +@command{gpgme-config} is replaced by @command{pkg-config} with +@code{gpgme.pc} file.) + +The options that need to be added to the compiler invocation at +compile time are output by the @option{--cflags} option to +@command{pkg-config gpgme}. The following example shows how it can be +used at the command line: @example -gcc -c foo.c `gpgme-config --cflags` +gcc -c foo.c `pkg-config --cflags gpgme` @end example -Adding the output of @samp{gpgme-config --cflags} to the compiler +Adding the output of @samp{pkg-config --cflags gpgme} to the compiler command line will ensure that the compiler can find the @acronym{GPGME} header file. @@ -440,36 +450,39 @@ Again, the compiler has to find the library files. For this to work, the path to the library files has to be added to the library search path (via the @option{-L} option). For this, the option -@option{--libs} to @command{gpgme-config} can be used. For +@option{--libs} to @command{pkg-config gpgme} can be used. For convenience, this option also outputs all other options that are required to link the program with @acronym{GPGME} (in particular, the @samp{-lgpgme} option). The example shows how to link @file{foo.o} with the @acronym{GPGME} library to a program @command{foo}. @example -gcc -o foo foo.o `gpgme-config --libs` +gcc -o foo foo.o `pkg-config --libs gpgme` @end example Of course you can also combine both examples to a single command by -specifying both options to @command{gpgme-config}: +specifying both options to @command{pkg-config gpgme}: @example -gcc -o foo foo.c `gpgme-config --cflags --libs` -@end example - -If you need to detect the installed language bindings you can use list -them using: - -@example -gpgme-config --print-lang -@end example - -or test for the availability using - -@example -gpgme-config --have-lang=python && echo 'Bindings for Pythons available' +gcc -o foo foo.c `pkg-config --cflags --libs gpgme` @end example +@c +@c Feature not available by pkg-config/gpgrt-config +@c +@c If you need to detect the installed language bindings you can use list +@c them using: +@c +@c @example +@c gpgme-config --print-lang +@c @end example +@c +@c or test for the availability using +@c +@c @example +@c gpgme-config --have-lang=python && echo 'Bindings for Pythons available' +@c @end example +@c @node Largefile Support (LFS) @section Largefile Support (LFS) @@ -578,7 +591,7 @@ It is much easier if you use GNU Automake instead of writing your own Makefiles. If you do that you do not have to worry about finding and -invoking the @command{gpgme-config} script at all. @acronym{GPGME} +invoking the @command{pkg-config} script at all. @acronym{GPGME} provides an extension to Automake that does all the work for you. @c A simple macro for optional variables. @@ -586,39 +599,36 @@ @r{}@var{\varname\}@r{} @end macro @defmac AM_PATH_GPGME (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found}) -@defmacx AM_PATH_GPGME_PTH (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found}) -@defmacx AM_PATH_GPGME_PTHREAD (@ovar{minimum-version}, @ovar{action-if-found}, @ovar{action-if-not-found}) Check whether @acronym{GPGME} (at least version @var{minimum-version}, if given) exists on the host system. If it is found, execute @var{action-if-found}, otherwise do @var{action-if-not-found}, if given. +This macro locates for @code{gpgme.pc}, with cross-compile support. + Additionally, the function defines @code{GPGME_CFLAGS} to the flags needed for compilation of the program to find the @file{gpgme.h} header file, and @code{GPGME_LIBS} to the linker flags needed to link -the program to the @acronym{GPGME} library. If the used helper script -does not match the target type you are building for a warning is -printed and the string @code{libgcrypt} is appended to the variable -@code{gpg_config_script_warn}. - -@code{AM_PATH_GPGME_PTH} checks for the version of @acronym{GPGME} -that can be used with GNU Pth, and defines @code{GPGME_PTH_CFLAGS} and -@code{GPGME_PTH_LIBS}. - -@code{AM_PATH_GPGME_PTHREAD} checks for the version of @acronym{GPGME} -that can be used with the native pthread implementation, and defines -@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since -version 1.8.0 this is no longer required to GPGME_PTHREAD as -@acronym{GPGME} itself is thread safe. - -This macro searches for @command{gpgme-config} along the PATH. If -you are cross-compiling, it is useful to set the environment variable -@code{SYSROOT} to the top directory of your target. The macro will -then first look for the helper program in the @file{bin} directory -below that top directory. An absolute directory name must be used for -@code{SYSROOT}. Finally, if the configure command line option -@code{--with-gpgme-prefix} is used, only its value is used for the top -directory below which the helper script is expected. +the program to the @acronym{GPGME} library. +@c +@c If the used helper script does not match the target type you are +@c building for a warning is printed and the string @code{gpgme} is +@c appended to the variable @code{gpg_config_script_warn}. +@c@c@c@c@c@c@c@c +@c ^-- About this statement. +@c In the past, this might happens, when it was configured by +@c --with-*-prefix options, and it located the helper script for +@c other target. Cross-build by gpgrt-config has been improved +@c (in different way), so it's not relevant now. +@c + + +@code{AM_PATH_GPGME_PTHREAD} was provided to check for the version of +@acronym{GPGME} with the native pthread implementation, and it defined +@code{GPGME_PTHREAD_CFLAGS} and @code{GPGME_PTHREAD_LIBS}. Since +version 1.8.0 this is no longer necessary, as @acronym{GPGME} itself +is thread safe. Please use plain @code{AM_PATH_GPGME} instead, with +@code{GPGME_CFLAGS} and @code{GPGME_LDFLAGS}. @end defmac @@ -636,9 +646,8 @@ @cindex libtool The easiest way is to just use GNU Libtool. If you use libtool, and -link to @code{libgpgme.la}, @code{libgpgme-pth.la} or -@code{libgpgme-pthread.la} respectively, everything will be done -automatically by Libtool. +link to @code{libgpgme.la}, everything will be done automatically by +Libtool. @node Library Version Check @@ -731,6 +740,13 @@ version. The given version must be a string with major, minor, and micro number. Example: "2.1.0". +@item inst-type +The installation type is used to prefer a certain GnuPG installation. +The value is interpreted as an integer: A value of 0 is ignored, a +value of 1 indicates an installation scheme as used by Gpg4win, a +value of 2 indicates an installation scheme as used by GnuPG Desktop +on Windows. All other values are reserved. + @item w32-inst-dir On Windows GPGME needs to know its installation directory to find its spawn helper. This is in general no problem because a DLL has this @@ -965,6 +981,9 @@ @item localedir Return the name of the directory with GnuPG locale data. +@item socketdir +Return the name of the directory with the following sockets. + @item agent-socket Return the name of the socket to connect to the gpg-agent. @@ -1008,6 +1027,9 @@ @item gpg-wks-client-name Return the name of the Web Key Service tool. +@item gpgtar-name +Return the name of the gpgtar program. + @end table @end deftypefun @@ -1627,6 +1649,11 @@ @item GPG_ERR_CANCELED This value means that the operation was canceled. +@item GPG_ERR_FULLY_CANCELED +This value means that the operation was canceled. It is sometimes returned +instead of @code{GPG_ERR_CANCELED} for internal reasons in GnuPG. You should +treat both values identically. + @item GPG_ERR_INV_ENGINE This value means that the engine that implements the desired protocol is currently not available. This can either be because the sources @@ -2177,6 +2204,11 @@ output when encrypting or signing the data and will be returned to the user when decrypting or verifying the output data. +If a signed or encrypted archive is created, then the file name will be +interpreted as the base directory for the relative paths of the files and +directories to put into the archive. This corresponds to the --directory +option of gpgtar. + The function returns the error code @code{GPG_ERR_INV_VALUE} if @var{dh} is not a valid pointer and @code{GPG_ERR_ENOMEM} if not enough memory is available. @@ -2340,7 +2372,7 @@ private keys for X.509. @end table -@deftypefun gpgme_data_type_t gpgme_data_identify (@w{gpgme_data_t @var{dh}}) +@deftypefun gpgme_data_type_t gpgme_data_identify (@w{gpgme_data_t @var{dh}, int @var{reserved}}) @since{1.4.3} The function @code{gpgme_data_identify} returns the type of the data @@ -2350,6 +2382,7 @@ object has been created the identification may not be possible or the data object may change its internal state (file pointer moved). For file or memory based data object, the state should not change. +@var{reserved} should be zero. @end deftypefun @@ -2876,6 +2909,26 @@ expensive operation and is in general not useful. Currently only implemented for the S/MIME backend and ignored for other backends. +@item GPGME_KEYLIST_MODE_FORCE_EXTERN +@since{1.18.0} + +The @code{GPGME_KEYLIST_MODE_FORCE_EXTERN} symbol specifies that only +external sources should be searched for keys in the keylisting +operation. If used in combination with @code{GPGME_KEYLIST_MODE_LOCATE}, +the keylisting results in a @code{--locate-external-keys} for +@code{GPGME_PROTOCOL_OpenPGP}. The combination with +@code{GPGME_KEYLIST_MODE_LOCAL}, but without @code{GPGME_KEYLIST_MODE_EXTERN} +is not allowed. Currently only implemented for the OpenPGP backend and +ignored for other backends. + +@item GPGME_KEYLIST_MODE_LOCATE_EXTERNAL +@since{1.18.0} + +This is a shortcut for the combination of +@code{GPGME_KEYLIST_MODE_LOCATE} and @code{GPGME_KEYLIST_MODE_FORCE_EXTERN}, +which results in a @code{--locate-external-keys} for +@code{GPGME_PROTOCOL_OpenPGP}. + @end table At least one of @code{GPGME_KEYLIST_MODE_LOCAL} and @@ -3125,8 +3178,8 @@ the session key for decryption. The format of that session key is specific to GnuPG and can be retrieved during a decrypt operation when the context flag "export-session-key" is enabled. Please be aware that -using this feature with GnuPG < 2.1.16 will leak the session key on -many platforms via ps(1). +using this feature with GnuPG < 2.1.16 or when decrypting an archive +will leak the session key on many platforms via ps(1). @item "auto-key-retrieve" Setting the @var{value} to "1" asks the backend to automatically @@ -3213,6 +3266,11 @@ filter when importing keys. Valid values are documented in the GnuPG manual and the gpg man page under the option @option{--import-filter}. +@item "no-auto-check-trustdb" +@since{1.19.0} +Setting the @var{value} to "1" forces the GPG backend to disable the +automatic check of the trust database. + @end table This function returns @code{0} on success. @@ -4137,22 +4195,6 @@ @end deftypefun -@deftypefun gpgme_error_t gpgme_op_revuid_start @ - (@w{gpgme_ctx_t @var{ctx}}, @ - @w{gpgme_key_t @var{key}}, @ - @w{const char *@var{userid}}, @ - @w{unsigned int @var{flags}}); - -@since{1.14.1} - -The function @code{gpgme_op_setexpire_start} initiates a -@code{gpgme_op_setexpire} operation; see there for details. It must -be completed by calling @code{gpgme_wait} on the context. -@xref{Waiting For Completion}. - -@end deftypefun - - @node Generating Keys @subsection Generating Keys @cindex key, creation @@ -5550,8 +5592,9 @@ @deftypefun gpgme_error_t gpgme_op_decrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{cipher}}, @w{gpgme_data_t @var{plain}}) The function @code{gpgme_op_decrypt} decrypts the ciphertext in the -data object @var{cipher} and stores it into the data object -@var{plain}. +data object @var{cipher} or, if a file name is set on the data object, +the ciphertext stored in the corresponding file. The decrypted +ciphertext is stored into the data object @var{plain}. The function returns the error code @code{GPG_ERR_NO_ERROR} if the ciphertext could be decrypted successfully, @code{GPG_ERR_INV_VALUE} @@ -5586,6 +5629,12 @@ @code{gpgme_op_decrypt} but has an additional argument @var{flags}. If @var{flags} is 0 both function behave identically. +If the flag @code{GPGME_DECRYPT_ARCHIVE} is set, then an encrypted +archive in the data object @var{cipher} is decrypted and extracted. +The content of the archive is extracted into a directory named +@code{GPGARCH_n_} (where @code{n} is a number) or into the directory +set with @code{gpgme_data_set_file_name} for the data object @var{plain}. + The value in @var{flags} is a bitwise-or combination of one or multiple of the following bit values: @@ -5596,6 +5645,14 @@ The @code{GPGME_DECRYPT_VERIFY} symbol specifies that this function shall exactly act as @code{gpgme_op_decrypt_verify}. +@item GPGME_DECRYPT_ARCHIVE +@since{1.19.0} + +The @code{GPGME_DECRYPT_ARCHIVE} symbol specifies that the input is an +encrypted archive that shall be decrypted and extracted. This feature +is currently only supported for the OpenPGP crypto engine and requires +GnuPG 2.4.1. + @item GPGME_DECRYPT_UNWRAP @since{1.8.0} @@ -5750,7 +5807,10 @@ Otherwise, if @var{sig} is a normal (or cleartext) signature, @var{signed_text} should be a null pointer and @var{plain} should be a writable data object that will contain the plaintext after successful -verification. +verification. If a file name is set on the data object @var{sig} (or +on the data object @var{signed_text}), then the data of the signature +(resp. the data of the signed text) is not read from the data object +but from the file with the given file name. The results of the individual signature verifications can be retrieved with @code{gpgme_op_verify_result}. @@ -5775,6 +5835,61 @@ any data to verify. @end deftypefun + +@deftypefun gpgme_error_t gpgme_op_verify_ext ( @ + @w{gpgme_ctx_t @var{ctx}}, @ + @w{gpgme_verify_flags_t @var{flags}}, @ + @w{gpgme_data_t @var{sig}}, @ + @w{gpgme_data_t @var{signed_text}}, @ + @w{gpgme_data_t @var{plain}}) + +The function @code{gpgme_op_verify_ext} is the same as +@code{gpgme_op_verify} but has an additional argument +@var{flags}. If @var{flags} is 0 both function behave identically. + +If the flag @code{GPGME_VERIFY_ARCHIVE} is set, then a signed archive +in the data object @var{sig} is verified and extracted. The content of +the archive is extracted into a directory named @code{GPGARCH_n_} +(where @code{n} is a number) or into the directory set with +@code{gpgme_data_set_file_name} for the data object @var{plain}. + +The value in @var{flags} is a bitwise-or combination of one or +multiple of the following bit values: + +@table @code +@item GPGME_VERIFY_ARCHIVE +@since{1.19.0} + +The @code{GPGME_VERIFY_ARCHIVE} symbol specifies that the input is a +signed archive that shall be verified and extracted. This feature +is currently only supported for the OpenPGP crypto engine and requires +GnuPG 2.4.1. + +@end table + +The function returns the error codes as descriped for +@code{gpgme_op_decrypt} respective @code{gpgme_op_encrypt}. +@end deftypefun + +@deftypefun gpgme_error_t gpgme_op_verify_ext_start ( @ + @w{gpgme_ctx_t @var{ctx}}, @ + @w{gpgme_verify_flags_t @var{flags}}, @ + @w{gpgme_data_t @var{sig}}, @ + @w{gpgme_data_t @var{signed_text}}, @ + @w{gpgme_data_t @var{plain}}) + +The function @code{gpgme_op_verify_ext_start} initiates a +@code{gpgme_op_verify_ext} operation. It can be completed by calling +@code{gpgme_wait} on the context. @xref{Waiting For Completion}. + +The function returns the error code @code{GPG_ERR_NO_ERROR} if the +operation could be started successfully, @code{GPG_ERR_INV_VALUE} if +@var{ctx}, @var{sig} or @var{plain} is not a valid pointer, and +@code{GPG_ERR_NO_DATA} if @var{sig} or @var{plain} does not contain +any data to verify. +@end deftypefun + + @deftp {Data type} {gpgme_sig_notation_t} This is a pointer to a structure used to store a part of the result of a @code{gpgme_op_verify} operation. The structure contains the @@ -6207,16 +6322,33 @@ @item GPGME_SIG_MODE_CLEAR A clear text signature is made. The @acronym{ASCII} armor and text mode settings of the context are ignored. + +@item GPGME_SIG_MODE_ARCHIVE +@since{1.19.0} + +A signed archive is created from the given files and directories. This +feature is currently only supported for the OpenPGP crypto engine and requires +GnuPG 2.4.1. + @end table @end deftp @deftypefun gpgme_error_t gpgme_op_sign (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{sig}}, @w{gpgme_sig_mode_t @var{mode}}) The function @code{gpgme_op_sign} creates a signature for the text in the data object @var{plain} and returns it in the data object -@var{sig}. The type of the signature created is determined by the -@acronym{ASCII} armor (or, if that is not set, by the encoding -specified for @var{sig}), the text mode attributes set for the context -@var{ctx} and the requested signature mode @var{mode}. +@var{sig} or writes it directly to the file set with +@code{gpgme_data_set_file_name} for the data object @var{sig}. The type +of the signature created is determined by the @acronym{ASCII} armor (or, +if that is not set, by the encoding specified for @var{sig}), the text +mode attributes set for the context @var{ctx} and the requested signature +mode @var{mode}. + +If signature mode @code{GPGME_SIG_MODE_ARCHIVE} is requested, then a +signed archive is created from the files and directories given as +NUL-separated list in the data object @var{plain} and returned in the +data object @var{sig}. The paths of the files and directories have to +be given as paths relative to the current working directory or relative +to the base directory set with @code{gpgme_data_set_file_name}. After the operation completed successfully, the result can be retrieved with @code{gpgme_op_sign_result}. @@ -6265,7 +6397,8 @@ The hash algorithm used to create this signature. @item unsigned int sig_class -The signature class of this signature. +The signature class of this signature. Note that only the values 0, +1, and 2 are well-defined. @item long int timestamp The creation timestamp of this signature. @@ -6383,10 +6516,19 @@ @deftypefun gpgme_error_t gpgme_op_encrypt (@w{gpgme_ctx_t @var{ctx}}, @w{gpgme_key_t @var{recp}}, @w{gpgme_encrypt_flags_t @var{flags}}, @w{gpgme_data_t @var{plain}}, @w{gpgme_data_t @var{cipher}}) The function @code{gpgme_op_encrypt} encrypts the plaintext in the data object @var{plain} for the recipients @var{recp} and stores the -ciphertext in the data object @var{cipher}. The type of the -ciphertext created is determined by the @acronym{ASCII} armor (or, if -that is not set, by the encoding specified for @var{cipher}) and the -text mode attributes set for the context @var{ctx}. +ciphertext in the data object @var{cipher} or writes it directly to the +file set with @code{gpgme_data_set_file_name} for the data object +@var{cipher}. The type of the ciphertext created is determined by the +@acronym{ASCII} armor (or, if that is not set, by the encoding specified +for @var{cipher}) and the text mode attributes set for the context +@var{ctx}. + +If the flag @code{GPGME_ENCRYPT_ARCHIVE} is set, then an encrypted +archive is created from the files and directories given as NUL-separated +list in the data object @var{plain} and returned in the data object +@var{cipher}. The paths of the files and directories have to +be given as paths relative to the current working directory or relative +to the base directory set with @code{gpgme_data_set_file_name}. @var{recp} must be a @code{NULL}-terminated array of keys. The user must keep references for all keys during the whole duration of the @@ -6463,6 +6605,14 @@ of the extended encrypt functions. This feature is currently only supported for the OpenPGP crypto engine. +@item GPGME_ENCRYPT_ARCHIVE +@since{1.19.0} + +The @code{GPGME_ENCRYPT_ARCHIVE} symbol specifies that the input is a +NUL-separated list of file paths and directory paths that shall be +encrypted into an archive. This feature is currently only supported +for the OpenPGP crypto engine and requires GnuPG 2.4.1. + @end table If @code{GPG_ERR_UNUSABLE_PUBKEY} is returned, some recipients in @@ -7798,6 +7948,15 @@ your application. If you are asked to send a log file, make sure that you run your tests only with play data. +The trace function makes use of gpgrt's logging function and thus the +special @file{socket://} and @file{tcp://} files may be used. Because +this conflicts with the use of colons to separate fields, the following +hack is used: If the file name contains the string @code{^//} all +carets are replaced by colons. For example to log to TCP port 42042 +this can be used: +@smallexample +GPGME_DEBUG=5:tcp^//127.0.0.1^42042 +@end smallexample @node Deprecated Functions @appendix Deprecated Functions
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/gpgme.spec -> _service:tar_scm:gpgme-1.21.0.tar.bz2/gpgme.spec
Changed
@@ -1,7 +1,7 @@ # This is a template. The dist target uses it to create the real file. Summary: GPGME - GnuPG Made Easy Name: gpgme -Version: 1.17.0 +Version: 1.21.0 Release: 1 URL: https://gnupg.org/gpgme.html Source: https://www.gnupg.org/ftp/gcrypt/gpgme/%{name}-%{version}.tar.gz
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -257,10 +259,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -270,6 +277,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cl/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cl/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = lang/cl ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(dist_clfiles_DATA) \ @@ -229,10 +231,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -242,6 +249,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cl/gpgme.asd -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cl/gpgme.asd
Changed
@@ -27,7 +27,7 @@ (defsystem gpgme :description "GnuPG Made Easy." :author "g10 Code GmbH" - :version "1.17.0" + :version "1.21.0" :licence "GPL" :defsystem-depends-on ("cffi-grovel") :depends-on ("cffi" "gpg-error" "trivial-garbage")
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/Makefile.am
Changed
@@ -18,6 +18,12 @@ # License along with this program; if not, see <https://gnu.org/licenses/>. # SPDX-License-Identifier: LGPL-2.1-or-later -SUBDIRS = src tests +if RUN_GPG_TESTS +tests = tests +else +tests = +endif + +SUBDIRS = src ${tests} EXTRA_DIST = README
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = lang/cpp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -181,7 +183,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = src tests am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/mkinstalldirs README DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -259,10 +261,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -272,6 +279,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -408,7 +416,9 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -SUBDIRS = src tests +@RUN_GPG_TESTS_FALSE@tests = +@RUN_GPG_TESTS_TRUE@tests = tests +SUBDIRS = src ${tests} EXTRA_DIST = README all: all-recursive
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/GpgmeppConfig-w32.cmake.in.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/GpgmeppConfig-w32.cmake.in.in
Changed
@@ -97,7 +97,3 @@ # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) cmake_policy(POP) - -get_filename_component(QGpgme_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -# Pull in QGpgme for compatibility with KF5 variant. -find_package(QGpgme CONFIG)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/GpgmeppConfig.cmake.in.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/GpgmeppConfig.cmake.in.in
Changed
@@ -93,7 +93,3 @@ # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) cmake_policy(POP) - -get_filename_component(QGpgme_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -# Pull in QGpgme for compatibility with KF5 variant. -find_package(QGpgme CONFIG)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/Makefile.am
Changed
@@ -34,6 +34,7 @@ gpgsetownertrusteditinteractor.cpp gpgsignkeyeditinteractor.cpp \ gpgadduserideditinteractor.cpp gpggencardkeyinteractor.cpp \ gpgaddexistingsubkeyeditinteractor.cpp \ + gpgrevokekeyeditinteractor.cpp \ defaultassuantransaction.cpp \ scdgetinfoassuantransaction.cpp gpgagentgetinfoassuantransaction.cpp \ statusconsumerassuantransaction.cpp \ @@ -49,6 +50,7 @@ gpgsetownertrusteditinteractor.h gpgsignkeyeditinteractor.h \ gpggencardkeyinteractor.h \ gpgaddexistingsubkeyeditinteractor.h \ + gpgrevokekeyeditinteractor.h \ importresult.h keygenerationresult.h key.h keylistresult.h \ notation.h result.h scdgetinfoassuantransaction.h signingresult.h \ statusconsumerassuantransaction.h \ @@ -71,7 +73,8 @@ libgpgmepp_la_SOURCES = $(main_sources) $(gpgmepp_headers) context_vanilla.cpp \ $(interface_headers) $(private_gpgmepp_headers) -AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ +AM_CPPFLAGS = -I$(top_builddir)/src \ + @GPGME_CPP_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ -DBUILDING_GPGMEPP -Wsuggest-override \ -Wzero-as-null-pointer-constant
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/Makefile.in
Changed
@@ -113,6 +113,7 @@ subdir = lang/cpp/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -121,8 +122,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(gpgmeppinclude_HEADERS) \ @@ -174,7 +176,8 @@ gpgsetownertrusteditinteractor.lo gpgsignkeyeditinteractor.lo \ gpgadduserideditinteractor.lo gpggencardkeyinteractor.lo \ gpgaddexistingsubkeyeditinteractor.lo \ - defaultassuantransaction.lo scdgetinfoassuantransaction.lo \ + gpgrevokekeyeditinteractor.lo defaultassuantransaction.lo \ + scdgetinfoassuantransaction.lo \ gpgagentgetinfoassuantransaction.lo \ statusconsumerassuantransaction.lo vfsmountresult.lo \ configuration.lo tofuinfo.lo swdbresult.lo util.lo @@ -217,6 +220,7 @@ ./$(DEPDIR)/gpgadduserideditinteractor.Plo \ ./$(DEPDIR)/gpgagentgetinfoassuantransaction.Plo \ ./$(DEPDIR)/gpggencardkeyinteractor.Plo \ + ./$(DEPDIR)/gpgrevokekeyeditinteractor.Plo \ ./$(DEPDIR)/gpgsetexpirytimeeditinteractor.Plo \ ./$(DEPDIR)/gpgsetownertrusteditinteractor.Plo \ ./$(DEPDIR)/gpgsignkeyeditinteractor.Plo \ @@ -350,10 +354,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -363,6 +372,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -513,6 +523,7 @@ gpgsetownertrusteditinteractor.cpp gpgsignkeyeditinteractor.cpp \ gpgadduserideditinteractor.cpp gpggencardkeyinteractor.cpp \ gpgaddexistingsubkeyeditinteractor.cpp \ + gpgrevokekeyeditinteractor.cpp \ defaultassuantransaction.cpp \ scdgetinfoassuantransaction.cpp gpgagentgetinfoassuantransaction.cpp \ statusconsumerassuantransaction.cpp \ @@ -528,6 +539,7 @@ gpgsetownertrusteditinteractor.h gpgsignkeyeditinteractor.h \ gpggencardkeyinteractor.h \ gpgaddexistingsubkeyeditinteractor.h \ + gpgrevokekeyeditinteractor.h \ importresult.h keygenerationresult.h key.h keylistresult.h \ notation.h result.h scdgetinfoassuantransaction.h signingresult.h \ statusconsumerassuantransaction.h \ @@ -549,7 +561,8 @@ libgpgmepp_la_SOURCES = $(main_sources) $(gpgmepp_headers) context_vanilla.cpp \ $(interface_headers) $(private_gpgmepp_headers) -AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ +AM_CPPFLAGS = -I$(top_builddir)/src \ + @GPGME_CPP_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ -DBUILDING_GPGMEPP -Wsuggest-override \ -Wzero-as-null-pointer-constant @@ -664,6 +677,7 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgadduserideditinteractor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgagentgetinfoassuantransaction.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpggencardkeyinteractor.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgrevokekeyeditinteractor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgsetexpirytimeeditinteractor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgsetownertrusteditinteractor.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpgsignkeyeditinteractor.Plo@am__quote@ # am--include-marker @@ -925,6 +939,7 @@ -rm -f ./$(DEPDIR)/gpgadduserideditinteractor.Plo -rm -f ./$(DEPDIR)/gpgagentgetinfoassuantransaction.Plo -rm -f ./$(DEPDIR)/gpggencardkeyinteractor.Plo + -rm -f ./$(DEPDIR)/gpgrevokekeyeditinteractor.Plo -rm -f ./$(DEPDIR)/gpgsetexpirytimeeditinteractor.Plo -rm -f ./$(DEPDIR)/gpgsetownertrusteditinteractor.Plo -rm -f ./$(DEPDIR)/gpgsignkeyeditinteractor.Plo @@ -1004,6 +1019,7 @@ -rm -f ./$(DEPDIR)/gpgadduserideditinteractor.Plo -rm -f ./$(DEPDIR)/gpgagentgetinfoassuantransaction.Plo -rm -f ./$(DEPDIR)/gpggencardkeyinteractor.Plo + -rm -f ./$(DEPDIR)/gpgrevokekeyeditinteractor.Plo -rm -f ./$(DEPDIR)/gpgsetexpirytimeeditinteractor.Plo -rm -f ./$(DEPDIR)/gpgsetownertrusteditinteractor.Plo -rm -f ./$(DEPDIR)/gpgsignkeyeditinteractor.Plo
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/configuration.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/configuration.h
Changed
@@ -98,8 +98,7 @@ explicit Component(const shared_gpgme_conf_comp_t &gpgme_comp) : comp(gpgme_comp) {} - // copy ctor is ok - + Component(const Component &other) = default; const Component &operator=(const Component &other) { if (this != &other) { @@ -149,6 +148,7 @@ Option(const shared_gpgme_conf_comp_t &gpgme_comp, gpgme_conf_opt_t gpgme_opt) : comp(gpgme_comp), opt(gpgme_opt) {} + Option(const Option &other) = default; const Option &operator=(const Option &other) { if (this != &other) {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/context.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/context.cpp
Changed
@@ -142,7 +142,7 @@ bool Error::isCanceled() const { - return code() == GPG_ERR_CANCELED; + return code() == GPG_ERR_CANCELED || code() == GPG_ERR_FULLY_CANCELED; } int Error::toErrno() const @@ -195,6 +195,19 @@ return os << "GpgME::Error(" << err.encodedError() << " (" << err.asString() << "))"; } +Context::KeyListModeSaver::KeyListModeSaver(Context *ctx) + : mCtx{ctx} + , mKeyListMode{ctx ? ctx->keyListMode() : 0} +{ +} + +Context::KeyListModeSaver::~KeyListModeSaver() +{ + if (mCtx) { + mCtx->setKeyListMode(mKeyListMode); + } +} + Context::Context(gpgme_ctx_t ctx) : d(new Private(ctx)) { } @@ -522,19 +535,25 @@ Error Context::startKeyListing(const char *pattern, bool secretOnly) { - d->lastop = Private::KeyList; + d->lastop = (((keyListMode() & GpgME::Locate) == GpgME::Locate) + ? Private::KeyListWithImport + : Private::KeyList); return Error(d->lasterr = gpgme_op_keylist_start(d->ctx, pattern, int(secretOnly))); } Error Context::startKeyListing(const char *patterns, bool secretOnly) { - d->lastop = Private::KeyList; + d->lastop = (((keyListMode() & GpgME::Locate) == GpgME::Locate) + ? Private::KeyListWithImport + : Private::KeyList); return Error(d->lasterr = gpgme_op_keylist_ext_start(d->ctx, patterns, int(secretOnly), 0)); } Key Context::nextKey(GpgME::Error &e) { - d->lastop = Private::KeyList; + d->lastop = (((keyListMode() & GpgME::Locate) == GpgME::Locate) + ? Private::KeyListWithImport + : Private::KeyList); gpgme_key_t key = nullptr; e = Error(d->lasterr = gpgme_op_keylist_next(d->ctx, &key)); return Key(key, false); @@ -1051,7 +1070,7 @@ const Data::Private *const cdp = cipherText.impl(); Data::Private *const pdp = plainText.impl(); d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags), cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr); - return DecryptionResult(d->ctx, Error(d->lasterr)); + return decryptionResult(); } DecryptionResult Context::decrypt(const Data &cipherText, Data &plainText) @@ -1088,7 +1107,7 @@ const Data::Private *const sdp = signature.impl(); const Data::Private *const tdp = signedText.impl(); d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, tdp ? tdp->data : nullptr, nullptr); - return VerificationResult(d->ctx, Error(d->lasterr)); + return verificationResult(); } VerificationResult Context::verifyOpaqueSignature(const Data &signedData, Data &plainText) @@ -1097,7 +1116,7 @@ const Data::Private *const sdp = signedData.impl(); Data::Private *const pdp = plainText.impl(); d->lasterr = gpgme_op_verify(d->ctx, sdp ? sdp->data : nullptr, nullptr, pdp ? pdp->data : nullptr); - return VerificationResult(d->ctx, Error(d->lasterr)); + return verificationResult(); } Error Context::startDetachedSignatureVerification(const Data &signature, const Data &signedText) @@ -1119,9 +1138,18 @@ VerificationResult Context::verificationResult() const { if (d->lastop & Private::Verify) { - return VerificationResult(d->ctx, Error(d->lasterr)); + const auto res = VerificationResult{d->ctx, Error(d->lasterr)}; + if ((d->lastop == Private::DecryptAndVerify) + && (res.error().code() == GPG_ERR_NO_DATA) + && (res.numSignatures() > 0)) { + // ignore "no data" error for verification if there are signatures and + // the operation was a combined (tentative) decryption and verification + // because then "no data" just indicates that there was nothing to decrypt + return VerificationResult{d->ctx, Error{}}; + } + return res; } else { - return VerificationResult(); + return {}; } } @@ -1132,8 +1160,7 @@ Data::Private *const pdp = plainText.impl(); d->lasterr = gpgme_op_decrypt_ext(d->ctx, static_cast<gpgme_decrypt_flags_t> (d->decryptFlags | flags | DecryptVerify), cdp ? cdp->data : nullptr, pdp ? pdp->data : nullptr); - return std::make_pair(DecryptionResult(d->ctx, Error(d->lasterr)), - VerificationResult(d->ctx, Error(d->lasterr))); + return std::make_pair(decryptionResult(), verificationResult()); } std::pair<DecryptionResult, VerificationResult> Context::decryptAndVerify(const Data &cipherText, Data &plainText) @@ -1154,6 +1181,7 @@ return startCombinedDecryptionAndVerification(cipherText, plainText, DecryptNone); } +namespace { unsigned int to_auditlog_flags(unsigned int flags) { unsigned int result = 0; @@ -1168,6 +1196,7 @@ } return result; } +} Error Context::startGetAuditLog(Data &output, unsigned int flags) { @@ -1257,14 +1286,22 @@ return result; } -static gpgme_sig_mode_t sigmode2sigmode(SignatureMode mode) +static gpgme_sig_mode_t sigflags2sigflags(SignatureMode flags) { - switch (mode) { - default: - case NormalSignatureMode: return GPGME_SIG_MODE_NORMAL; - case Detached: return GPGME_SIG_MODE_DETACH; - case Clearsigned: return GPGME_SIG_MODE_CLEAR; + unsigned int result = 0; + if (flags & SignatureMode::NormalSignatureMode) { + result |= GPGME_SIG_MODE_NORMAL; + } + if (flags & SignatureMode::Detached) { + result |= GPGME_SIG_MODE_DETACH; } + if (flags & SignatureMode::Clearsigned) { + result |= GPGME_SIG_MODE_CLEAR; + } + if (flags & SignatureMode::SignArchive) { + result |= GPGME_SIG_MODE_ARCHIVE; + } + return static_cast<gpgme_sig_mode_t>(result); } SigningResult Context::sign(const Data &plainText, Data &signature, SignatureMode mode) @@ -1272,7 +1309,7 @@ d->lastop = Private::Sign; const Data::Private *const pdp = plainText.impl(); Data::Private *const sdp = signature.impl(); - d->lasterr = gpgme_op_sign(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigmode2sigmode(mode)); + d->lasterr = gpgme_op_sign(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigflags2sigflags(mode)); return SigningResult(d->ctx, Error(d->lasterr)); } @@ -1281,7 +1318,7 @@ d->lastop = Private::Sign; const Data::Private *const pdp = plainText.impl(); Data::Private *const sdp = signature.impl(); - return Error(d->lasterr = gpgme_op_sign_start(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigmode2sigmode(mode))); + return Error(d->lasterr = gpgme_op_sign_start(d->ctx, pdp ? pdp->data : nullptr, sdp ? sdp->data : nullptr, sigflags2sigflags(mode))); } SigningResult Context::signingResult() const @@ -1314,6 +1351,18 @@ if (flags & Context::Symmetric) { result |= GPGME_ENCRYPT_SYMMETRIC; } + if (flags & Context::ThrowKeyIds) { + result |= GPGME_ENCRYPT_THROW_KEYIDS; + } + if (flags & Context::EncryptWrap) { + result |= GPGME_ENCRYPT_WRAP; + } + if (flags & Context::WantAddress) { + result |= GPGME_ENCRYPT_WANT_ADDRESS; + } + if (flags & Context::EncryptArchive) { + result |= GPGME_ENCRYPT_ARCHIVE; + } return static_cast<gpgme_encrypt_flags_t>(result); } @@ -1620,6 +1669,16 @@ k.impl(), userid, 0)); } +Error Context::setPrimaryUid(const Key &k, const char *userid) +{ + return Error(d->lasterr = gpgme_op_set_uid_flag(d->ctx, k.impl(), userid, "primary", nullptr)); +} + +Error Context::startSetPrimaryUid(const Key &k, const char *userid) +{ + return Error(d->lasterr = gpgme_op_set_uid_flag_start(d->ctx, k.impl(), userid, "primary", nullptr)); +} + Error Context::createSubkey(const Key &k, const char *algo, unsigned long reserved, unsigned long expires, @@ -1847,6 +1906,7 @@ CHECK(WithTofu); CHECK(WithKeygrip); CHECK(WithSecret); + CHECK(ForceExtern); #undef CHECK return os << ')'; } @@ -1854,7 +1914,8 @@ std::ostream &operator<<(std::ostream &os, SignatureMode mode) { os << "GpgME::SignatureMode("; - switch (mode) { +#undef CHECK + switch (mode & (NormalSignatureMode|Detached|Clearsigned)) { #define CHECK( x ) case x: os << #x; break CHECK(NormalSignatureMode); CHECK(Detached); @@ -1864,6 +1925,9 @@ os << "???" "(" << static_cast<int>(mode) << ')'; break; } +#define CHECK( x ) if ( !(mode & (x)) ) {} else do { os << #x " "; } while (0) + CHECK(SignArchive); +#undef CHECK return os << ')'; } @@ -1877,6 +1941,10 @@ CHECK(ExpectSign); CHECK(NoCompress); CHECK(Symmetric); + CHECK(ThrowKeyIds); + CHECK(EncryptWrap); + CHECK(WantAddress); + CHECK(EncryptArchive); #undef CHECK return os << ')'; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/context.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/context.h
Changed
@@ -64,6 +64,17 @@ public: //using GpgME::Protocol; + /// RAII-style class for saving/restoring the key list mode. + class GPGMEPP_EXPORT KeyListModeSaver + { + public: + explicit KeyListModeSaver(Context *ctx); + ~KeyListModeSaver(); + private: + Context *mCtx; + unsigned int mKeyListMode; + }; + // // Creation and destruction: // @@ -284,6 +295,9 @@ Error revUid(const Key &key, const char *userid); Error startRevUid(const Key &key, const char *userid); + Error setPrimaryUid(const Key &key, const char *userid); + Error startSetPrimaryUid(const Key &key, const char *userid); + Error createSubkey(const Key &key, const char *algo, unsigned long reserved = 0, unsigned long expires = 0, @@ -356,6 +370,7 @@ // Keep in line with core's flags DecryptNone = 0, DecryptVerify = 1, + DecryptArchive = 2, DecryptUnwrap = 128, DecryptMaxValue = 0x80000000 }; @@ -433,7 +448,9 @@ NoCompress = 16, Symmetric = 32, ThrowKeyIds = 64, - EncryptWrap = 128 + EncryptWrap = 128, + WantAddress = 256, + EncryptArchive = 512 }; EncryptionResult encrypt(const std::vector<Key> &recipients, const Data &plainText, Data &cipherText, EncryptionFlags flags); GpgME::Error encryptSymmetrically(const Data &plainText, Data &cipherText);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/context_p.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/context_p.h
Changed
@@ -53,6 +53,7 @@ KeyGen = 0x080, KeyList = 0x100, + KeyListWithImport = KeyList | Import, // gpgme_keylist_result_t and gpgme_import_result_t TrustList = 0x200, // no gpgme_trustlist_result_t, but nevertheless... Edit = 0x400, // no gpgme_edit_result_t, but nevertheless...
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/data.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/data.cpp
Changed
@@ -217,6 +217,11 @@ return Error(gpgme_data_set_file_name(d->data, name)); } +GpgME::Error GpgME::Data::setFileName(const std::string &name) +{ + return Error(gpgme_data_set_file_name(d->data, name.c_str())); +} + ssize_t GpgME::Data::read(void *buffer, size_t length) { return gpgme_data_read(d->data, buffer, length); @@ -275,3 +280,14 @@ seek (0, SEEK_SET); return ret; } + +GpgME::Error GpgME::Data::setFlag(const char *name, const char *value) +{ + return Error(gpgme_data_set_flag(d->data, name, value)); +} + +GpgME::Error GpgME::Data::setSizeHint(uint64_t size) +{ + const std::string val = std::to_string(size); + return Error(gpgme_data_set_flag(d->data, "size-hint", val.c_str())); +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/data.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/data.h
Changed
@@ -27,6 +27,7 @@ #include "key.h" #include <sys/types.h> // for size_t, off_t +#include <cstdint> // unit64_t #include <cstdio> // FILE #include <algorithm> #include <memory> @@ -60,6 +61,7 @@ static const Null null; + Data(const Data &other) = default; const Data &operator=(Data other) { swap(other); @@ -105,6 +107,7 @@ char *fileName() const; Error setFileName(const char *name); + Error setFileName(const std::string &name); ssize_t read(void *buffer, size_t length); ssize_t write(const void *buffer, size_t length); @@ -120,6 +123,12 @@ /** Return a copy of the data as std::string. Sets seek pos to 0 */ std::string toString(); + /** See gpgme_data_set_flag */ + Error setFlag(const char *name, const char *value); + + /** Set a size hint for this data e.g. for progress calculations. */ + Error setSizeHint(uint64_t size); + class Private; Private *impl() {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/decryptionresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/decryptionresult.h
Changed
@@ -47,6 +47,7 @@ DecryptionResult(gpgme_ctx_t ctx, const Error &err); explicit DecryptionResult(const Error &err); + DecryptionResult(const DecryptionResult &other) = default; const DecryptionResult &operator=(DecryptionResult other) { swap(other); @@ -103,6 +104,7 @@ Recipient(); explicit Recipient(gpgme_recipient_t reci); + Recipient(const Recipient &other) = default; const Recipient &operator=(Recipient other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/editinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/editinteractor.cpp
Changed
@@ -29,6 +29,7 @@ #include "editinteractor.h" #include "callbacks.h" #include "error.h" +#include "util.h" #include <gpgme.h> @@ -95,12 +96,21 @@ // advance to next state based on input: const unsigned int oldState = ei->state; - ei->state = ei->q->nextState(status, args, err); + + if (ei->q->needsNoResponse(status)) { + // keep state + } else if (status == GPGME_STATUS_ERROR) { + err = ei->q->parseStatusError(args); + ei->state = EditInteractor::ErrorState; + } else { + ei->state = ei->q->nextState(status, args, err); + } + if (ei->debug) { std::fprintf(ei->debug, "EditInteractor: %u -> nextState( %s, %s ) -> %u\n", oldState, status_to_string(status), args ? args : "<null>", ei->state); } - if (err) { + if (err || err.isCanceled()) { ei->state = oldState; goto error; } @@ -153,7 +163,7 @@ } error: - if (err) { + if (err || err.isCanceled()) { ei->error = err; ei->state = EditInteractor::ErrorState; } @@ -256,6 +266,20 @@ d->debug = debug; } +GpgME::Error EditInteractor::parseStatusError(const char *args) +{ + Error err; + + const auto fields = split(args, ' '); + if (fields.size() >= 2) { + err = Error{static_cast<unsigned int>(std::stoul(fields1))}; + } else { + err = Error::fromCode(GPG_ERR_GENERAL); + } + + return err; +} + static const char *const status_strings = { "EOF", /* mkstatus processing starts here */
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/editinteractor.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/editinteractor.h
Changed
@@ -60,6 +60,9 @@ void setDebugChannel(std::FILE *file); +protected: + Error parseStatusError(const char *args); + private: class Private; Private *const d;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/encryptionresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/encryptionresult.h
Changed
@@ -48,6 +48,7 @@ EncryptionResult(gpgme_ctx_t ctx, const Error &error); EncryptionResult(const Error &err); + EncryptionResult(const EncryptionResult &other) = default; const EncryptionResult &operator=(EncryptionResult other) { swap(other); @@ -83,6 +84,7 @@ public: InvalidRecipient(); + InvalidRecipient(const InvalidRecipient &other) = default; const InvalidRecipient &operator=(InvalidRecipient other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/engineinfo.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/engineinfo.h
Changed
@@ -69,6 +69,76 @@ } } + bool operator < (const Version& other) const + { + if (major > other.major || + (major == other.major && minor > other.minor) || + (major == other.major && minor == other.minor && patch > other.patch) || + (major >= other.major && minor >= other.minor && patch >= other.patch)) { + return false; + } + return true; + } + + bool operator < (const char* other) const + { + return operator<(Version(other)); + } + + bool operator <= (const Version &other) const + { + return !operator>(other); + } + + bool operator <= (const char *other) const + { + return operator<=(Version(other)); + } + + bool operator > (const char* other) const + { + return operator>(Version(other)); + } + + bool operator > (const Version & other) const + { + return !operator<(other) && !operator==(other); + } + + bool operator >= (const Version &other) const + { + return !operator<(other); + } + + bool operator >= (const char *other) const + { + return operator>=(Version(other)); + } + + bool operator == (const Version& other) const + { + return major == other.major + && minor == other.minor + && patch == other.patch; + } + + bool operator == (const char* other) const + { + return operator==(Version(other)); + } + + bool operator != (const Version &other) const + { + return !operator==(other); + } + + bool operator != (const char *other) const + { + return operator!=(Version(other)); + } + + // the non-const overloads of the comparison operators are kept for + // binary compatibility bool operator < (const Version& other) { if (major > other.major || @@ -151,6 +221,7 @@ EngineInfo(); explicit EngineInfo(gpgme_engine_info_t engine); + EngineInfo(const EngineInfo &other) = default; const EngineInfo &operator=(EngineInfo other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/global.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/global.h
Changed
@@ -60,17 +60,33 @@ enum KeyListMode { Local = 0x1, Extern = 0x2, - Locate = 0x3, + Locate = Local|Extern, Signatures = 0x4, SignatureNotations = 0x8, Validate = 0x10, Ephemeral = 0x20, WithTofu = 0x40, WithKeygrip = 0x80, - WithSecret = 0x100 + WithSecret = 0x100, + ForceExtern = 0x200, + LocateExternal = Locate|ForceExtern, + + KeyListModeMask = 0x3ff +}; + +enum SignatureMode { + NormalSignatureMode = 0, + Detached = 1, + Clearsigned = 2, + SignArchive = 4, }; -enum SignatureMode { NormalSignatureMode, Detached, Clearsigned }; +enum class RevocationReason { + Unspecified = 0, + Compromised = 1, + Superseded = 2, + NoLongerUsed = 3 +}; GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, Protocol proto); GPGMEPP_EXPORT std::ostream &operator<<(std::ostream &os, Engine eng); @@ -92,7 +108,7 @@ datadir, localedir, agent-socket, agent-ssh-socket, dirmngr-socket, uiserver-socket, gpgconf-name, gpg-name, gpgsm-name, g13-name, keyboxd-name, agent-name, scdaemon-name, -dirmngr-name, pinentry-name, socketdir. +dirmngr-name, pinentry-name, socketdir, gpg-wks-client-name, gpgtar-name. This may be extended in the future. */
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgaddexistingsubkeyeditinteractor.cpp
Changed
@@ -105,10 +105,6 @@ static const Error NO_KEY_ERROR = Error::fromCode(GPG_ERR_NO_KEY); static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME); - if (q->needsNoResponse(status)) { - return q->state(); - } - switch (q->state()) { case START: if (status == GPGME_STATUS_GET_LINE && @@ -136,7 +132,7 @@ strcmp(args, "keygen.flags") == 0) { return FLAGS; } else if (status == GPGME_STATUS_GET_LINE && - strcmp(args, "keygen.keygrip")) { + strcmp(args, "keygen.keygrip") == 0) { err = NO_KEY_ERROR; return ERROR; } @@ -157,7 +153,7 @@ strcmp(args, "keyedit.prompt") == 0) { return QUIT; } else if (status == GPGME_STATUS_GET_LINE && - strcmp(args, "keygen.valid")) { + strcmp(args, "keygen.valid") == 0) { err = INV_TIME_ERROR; return ERROR; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpgadduserideditinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgadduserideditinteractor.cpp
Changed
@@ -120,10 +120,6 @@ static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgAddUserIDEditInteractor_Private; switch (state()) {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpggencardkeyinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpggencardkeyinteractor.cpp
Changed
@@ -36,16 +36,17 @@ class GpgGenCardKeyInteractor::Private { public: - Private() : keysize("2048"), backup(false), algo(RSA) + Private() : keysize("2048") { - } + std::string name, email, backupFileName, expiry, serial, keysize; - bool backup; - Algo algo; + bool backup = false; + Algo algo = RSA; + std::string curve; }; -GpgGenCardKeyInteractor::~GpgGenCardKeyInteractor() {} +GpgGenCardKeyInteractor::~GpgGenCardKeyInteractor() = default; GpgGenCardKeyInteractor::GpgGenCardKeyInteractor(const std::string &serial): d(new Private) @@ -88,6 +89,15 @@ d->algo = algo; } +void GpgGenCardKeyInteractor::setCurve(Curve curve) +{ + if (curve == DefaultCurve) { + d->curve.clear(); + } else if (curve >= 1 && curve <= LastCurve) { + d->curve = std::to_string(static_cast<int>(curve)); + } +} + namespace GpgGenCardKeyInteractor_Private { enum { @@ -141,7 +151,7 @@ case KEY_CURVE1: case KEY_CURVE2: case KEY_CURVE3: - return "1"; // Only cv25519 supported. + return d->curve.empty() ? "1" : d->curve.c_str(); // default is Curve25519 case NAME: return d->name.c_str(); case EMAIL: @@ -182,10 +192,6 @@ static const Error INV_EMAIL_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); static const Error INV_COMMENT_ERROR = Error::fromCode(GPG_ERR_INV_USER_ID); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgGenCardKeyInteractor_Private; switch (state()) {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpggencardkeyinteractor.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpggencardkeyinteractor.h
Changed
@@ -58,10 +58,27 @@ enum Algo { RSA = 1, - ECC = 2 + ECC = 2, }; void setAlgo(Algo algo); + // the enum values minus 1 have to match the indexes of the curves used by + // ask_curve() in gnupg's g10/keygen.c + enum Curve { + DefaultCurve = 0, // currently Curve25519 + Curve25519 = 1, + Curve448, + NISTP256, + NISTP384, + NISTP521, + BrainpoolP256, + BrainpoolP384, + BrainpoolP512, + Secp256k1, + LastCurve = Secp256k1, + }; + void setCurve(Curve curve); + std::string backupFileName() const; private:
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgrevokekeyeditinteractor.cpp
Added
@@ -0,0 +1,208 @@ +/* + gpgrevokekeyeditinteractor.cpp - Edit Interactor to revoke own OpenPGP keys + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + This file is part of GPGME++. + + GPGME++ is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + GPGME++ 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 Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with GPGME++; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "gpgrevokekeyeditinteractor.h" + +#include "error.h" + +#include <gpgme.h> + +#include <sstream> +#include <vector> + +// avoid conflict (msvc) +#ifdef ERROR +# undef ERROR +#endif + +using namespace GpgME; + +class GpgRevokeKeyEditInteractor::Private +{ + enum { + START = EditInteractor::StartState, + COMMAND, + CONFIRM_REVOKING_ENTIRE_KEY, + REASON_CODE, + REASON_TEXT, + // all these free slots belong to REASON_TEXT, too; we increase state() + // by one for each line of text, so that action() is called + REASON_TEXT_DONE = REASON_TEXT + 1000, + CONFIRM_REASON, + QUIT, + CONFIRM_SAVE, + + ERROR = EditInteractor::ErrorState + }; + + GpgRevokeKeyEditInteractor *const q = nullptr; + +public: + Private(GpgRevokeKeyEditInteractor *q) + : q{q} + , reasonCode{"0"} + { + } + + const char *action(Error &err) const; + unsigned int nextState(unsigned int statusCode, const char *args, Error &err); + + std::string reasonCode; + std::vector<std::string> reasonLines; + int nextLine = -1; +}; + +const char *GpgRevokeKeyEditInteractor::Private::action(Error &err) const +{ + switch (const auto state = q->state()) { + case COMMAND: + return "revkey"; + case CONFIRM_REVOKING_ENTIRE_KEY: + return "Y"; + case REASON_CODE: + return reasonCode.c_str(); + case REASON_TEXT_DONE: + return ""; + case CONFIRM_REASON: + return "Y"; + case QUIT: + return "quit"; + case CONFIRM_SAVE: + return "Y"; + case START: + return nullptr; + default: + if (state >= REASON_TEXT && state < REASON_TEXT_DONE) { + return reasonLinesnextLine.c_str(); + } + // fall through + case ERROR: + err = Error::fromCode(GPG_ERR_GENERAL); + return nullptr; + } +} + +unsigned int GpgRevokeKeyEditInteractor::Private::nextState(unsigned int status, const char *args, Error &err) +{ + using std::strcmp; + + static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); + + switch (const auto state = q->state()) { + case START: + if (status == GPGME_STATUS_GET_LINE && + strcmp(args, "keyedit.prompt") == 0) { + return COMMAND; + } + err = GENERAL_ERROR; + return ERROR; + case COMMAND: + if (status == GPGME_STATUS_GET_BOOL && + strcmp(args, "keyedit.revoke.subkey.okay") == 0) { + return CONFIRM_REVOKING_ENTIRE_KEY; + } + err = GENERAL_ERROR; + return ERROR; + case CONFIRM_REVOKING_ENTIRE_KEY: + if (status == GPGME_STATUS_GET_LINE && + strcmp(args, "ask_revocation_reason.code") == 0) { + return REASON_CODE; + } + err = GENERAL_ERROR; + return ERROR; + case REASON_CODE: + if (status == GPGME_STATUS_GET_LINE && + strcmp(args, "ask_revocation_reason.text") == 0) { + nextLine++; + return static_cast<std::size_t>(nextLine) < reasonLines.size() ? REASON_TEXT : REASON_TEXT_DONE; + } + err = GENERAL_ERROR; + return ERROR; + default: + if (state >= REASON_TEXT && state < REASON_TEXT_DONE) { + if (status == GPGME_STATUS_GET_LINE && + strcmp(args, "ask_revocation_reason.text") == 0) { + nextLine++; + return static_cast<std::size_t>(nextLine) < reasonLines.size() ? state + 1 : REASON_TEXT_DONE; + } + } + err = GENERAL_ERROR; + return ERROR; + case REASON_TEXT_DONE: + if (status == GPGME_STATUS_GET_BOOL && + strcmp(args, "ask_revocation_reason.okay") == 0) { + return CONFIRM_REASON; + } + err = GENERAL_ERROR; + return ERROR; + case CONFIRM_REASON: + if (status == GPGME_STATUS_GET_LINE && + strcmp(args, "keyedit.prompt") == 0) { + return QUIT; + } + err = GENERAL_ERROR; + return ERROR; + case QUIT: + if (status == GPGME_STATUS_GET_BOOL && + strcmp(args, "keyedit.save.okay") == 0) { + return CONFIRM_SAVE; + } + err = GENERAL_ERROR; + return ERROR; + case ERROR: + if (status == GPGME_STATUS_GET_LINE && + strcmp(args, "keyedit.prompt") == 0) { + return QUIT; + } + err = q->lastError(); + return ERROR; + } +} + +GpgRevokeKeyEditInteractor::GpgRevokeKeyEditInteractor() + : EditInteractor{} + , d{new Private{this}} +{ +} + +GpgRevokeKeyEditInteractor::~GpgRevokeKeyEditInteractor() = default; + +void GpgRevokeKeyEditInteractor::setReason(RevocationReason reason, const std::vector<std::string> &description) +{ + d->reasonCode = std::to_string(static_cast<int>(reason)); + d->reasonLines = description; +} + +const char *GpgRevokeKeyEditInteractor::action(Error &err) const +{ + return d->action(err); +} + +unsigned int GpgRevokeKeyEditInteractor::nextState(unsigned int status, const char *args, Error &err) const +{ + return d->nextState(status, args, err); +}
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgrevokekeyeditinteractor.h
Added
@@ -0,0 +1,62 @@ +/* + gpgrevokekeyeditinteractor.h - Edit Interactor to revoke own OpenPGP keys + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + This file is part of GPGME++. + + GPGME++ is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + GPGME++ 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 Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with GPGME++; see the file COPYING.LIB. If not, write to the + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef __GPGMEPP_GPGREVOKEKEYEDITINTERACTOR_H__ +#define __GPGMEPP_GPGREVOKEKEYEDITINTERACTOR_H__ + +#include "editinteractor.h" +#include "global.h" + +#include <memory> +#include <vector> + +namespace GpgME +{ + +/** Edit interactor to revoke the key a key edit operation is working on. + * Supports revocation of own keys only. */ +class GPGMEPP_EXPORT GpgRevokeKeyEditInteractor : public EditInteractor +{ +public: + GpgRevokeKeyEditInteractor(); + ~GpgRevokeKeyEditInteractor() override; + + /** Sets the reason for the revocation. The reason defaults to \c Unspecified. + * \a description can be used for adding a comment for the revocation. The + * individual elements of \a description must be non-empty strings and they + * must not contain any endline characters. + */ + void setReason(RevocationReason reason, const std::vector<std::string> &description = {}); + +private: + const char *action(Error &err) const override; + unsigned int nextState(unsigned int statusCode, const char *args, Error &err) const override; + +private: + class GPGMEPP_NO_EXPORT Private; + const std::unique_ptr<Private> d; +}; + +} // namespace GpgME + +#endif // __GPGMEPP_GPGREVOKEKEYEDITINTERACTOR_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgsetexpirytimeeditinteractor.cpp
Changed
@@ -94,10 +94,6 @@ static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); static const Error INV_TIME_ERROR = Error::fromCode(GPG_ERR_INV_TIME); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgSetExpiryTimeEditInteractor_Private; switch (state()) {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpgsetownertrusteditinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgsetownertrusteditinteractor.cpp
Changed
@@ -98,10 +98,6 @@ static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); //static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME ); - if (needsNoResponse(status)) { - return state(); - } - using namespace GpgSetOwnerTrustEditInteractor_Private; switch (state()) {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/gpgsignkeyeditinteractor.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/gpgsignkeyeditinteractor.cpp
Changed
@@ -170,6 +170,7 @@ CONFIRM2, DUPE_OK, DUPE_OK2, + REJECT_SIGN_EXPIRED, QUIT, SAVE, ERROR = EditInteractor::ErrorState @@ -193,6 +194,7 @@ #define addEntry( s1, status, str, s2 ) tabstd::make_tuple( s1, status, str) = s2 addEntry(START, GET_LINE, "keyedit.prompt", COMMAND); addEntry(COMMAND, GET_BOOL, "keyedit.sign_all.okay", UIDS_ANSWER_SIGN_ALL); + addEntry(COMMAND, GET_BOOL, "sign_uid.expired_okay", REJECT_SIGN_EXPIRED); addEntry(COMMAND, GET_BOOL, "sign_uid.okay", CONFIRM); addEntry(COMMAND, GET_BOOL, "sign_uid.local_promote_okay", CONFIRM2); addEntry(COMMAND, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK); @@ -228,6 +230,7 @@ addEntry(DUPE_OK, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK2); addEntry(DUPE_OK2, GET_BOOL, "sign_uid.dupe_okay", DUPE_OK); addEntry(CONFIRM, GET_LINE, "keyedit.prompt", QUIT); + addEntry(REJECT_SIGN_EXPIRED, GET_LINE, "keyedit.prompt", QUIT); addEntry(ERROR, GET_LINE, "keyedit.prompt", QUIT); addEntry(QUIT, GET_BOOL, "keyedit.save.okay", SAVE); #undef addEntry @@ -263,6 +266,9 @@ case CONFIRM2: case CONFIRM: return answer(true); + case REJECT_SIGN_EXPIRED: + err = Error::fromCode(GPG_ERR_KEY_EXPIRED); + return answer(false); case QUIT: return "quit"; case SAVE: @@ -298,9 +304,6 @@ static const Error GENERAL_ERROR = Error::fromCode(GPG_ERR_GENERAL); //static const Error INV_TIME_ERROR = Error::fromCode( GPG_ERR_INV_TIME ); static const TransitionMap table(makeTable()); - if (needsNoResponse(status)) { - return state(); - } using namespace GpgSignKeyEditInteractor_Private;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/importresult.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/importresult.cpp
Changed
@@ -94,6 +94,131 @@ make_standard_stuff(ImportResult) +void GpgME::ImportResult::mergeWith(const ImportResult &other) +{ + if (other.isNull()) { + return; + } + if (isNull()) { // just assign + operator=(other); + return; + } + + // Add the numbers of considered keys; the number will be corrected when + // merging the imports to account for duplicates + d->res.considered += other.d->res.considered; + // Add the numbers of keys without user ID; may count duplicates + d->res.no_user_id += other.d->res.no_user_id; + // Add the numbers of imported keys + d->res.imported += other.d->res.imported; + // Add the numbers of imported RSA keys + d->res.imported_rsa += other.d->res.imported_rsa; + // Add the numbers of unchanged keys; the number will be corrected when + // merging the imports to account for keys changed by this import + d->res.unchanged += other.d->res.unchanged; + // Add the numbers of new user IDs + d->res.new_user_ids += other.d->res.new_user_ids; + // Add the numbers of new subkeys + d->res.new_sub_keys += other.d->res.new_sub_keys; + // Add the numbers of new signatures + d->res.new_signatures += other.d->res.new_signatures; + // Add the numbers of new revocations + d->res.new_revocations += other.d->res.new_revocations; + + // Add the numbers of considered secret keys; the number will be corrected when + // merging the imports to account for duplicates + d->res.secret_read += other.d->res.secret_read; + // Add the numbers of imported secret keys + d->res.secret_imported += other.d->res.secret_imported; + // Add the numbers of unchanged secret keys; the number will be corrected when + // merging the imports to account for keys changed by this import + d->res.secret_unchanged += other.d->res.secret_unchanged; + + // Add the numbers of new keys that were skipped; may count duplicates + d->res.skipped_new_keys += other.d->res.skipped_new_keys; + // Add the numbers of keys that were not imported; may count duplicates + d->res.not_imported += other.d->res.not_imported; + // Add the numbers of v3 keys that were skipped; may count duplicates + d->res.skipped_v3_keys += other.d->res.skipped_v3_keys; + + // Look at the list of keys for which an import was attempted during the + // other import to correct some of the consolidated numbers + for (auto it = std::begin(other.d->imports), end = std::end(other.d->imports); it != end; ++it) { + const char *fpr = (*it)->fpr; + if (!fpr || !*fpr) { + // we cannot derive any useful information about an import if the + // fingerprint is null or empty + continue; + } + // was this key also considered during the first import + const auto consideredInFirstImports = + std::any_of(std::begin(d->imports), std::end(d->imports), fpr(const gpgme_import_status_t i) { + return i->fpr && !strcmp(i->fpr, fpr); + }); + // did we see this key already in the list of keys of the other import + const auto consideredInPreviousOtherImports = + std::any_of(std::begin(other.d->imports), it, fpr(const gpgme_import_status_t i) { + return i->fpr && !strcmp(i->fpr, fpr); + }); + // was anything added to this key during the other import + const auto changedInOtherImports = + std::any_of(std::begin(other.d->imports), std::end(other.d->imports), fpr(const gpgme_import_status_t i) { + return i->fpr && !strcmp(i->fpr, fpr) && (i->status != 0); + }); + if (consideredInFirstImports && !consideredInPreviousOtherImports) { + // key was also considered during first import, but not before in the list of other imports + d->res.considered -= 1; + if (!changedInOtherImports) { + // key was (most likely) counted as unchanged in the second import; + // this needs to be corrected (regardless of whether it was changed in the first import) + d->res.unchanged -= 1; + } + } + + // now do the same for the secret key counts + const auto secretKeyConsideredInFirstImports = + std::any_of(std::begin(d->imports), std::end(d->imports), fpr(const gpgme_import_status_t i) { + return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET); + }); + const auto secretKeyConsideredInPreviousOtherImports = + std::any_of(std::begin(other.d->imports), it, fpr(const gpgme_import_status_t i) { + return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET); + }); + const auto secretKeyChangedInOtherImports = + std::any_of(std::begin(other.d->imports), std::end(other.d->imports), fpr(const gpgme_import_status_t i) { + return i->fpr && !strcmp(i->fpr, fpr) && (i->status & GPGME_IMPORT_SECRET) && (i->status != GPGME_IMPORT_SECRET); + }); + if (secretKeyConsideredInFirstImports && !secretKeyConsideredInPreviousOtherImports) { + // key was also considered during first import, but not before in the list of other imports + d->res.secret_read -= 1; + if (!secretKeyChangedInOtherImports) { + // key was (most likely) counted as unchanged in the second import; + // this needs to be corrected (regardless of whether it was changed in the first import) + d->res.secret_unchanged -= 1; + } + } + } + + // Now append the list of keys for which an import was attempted during the + // other import + d->imports.reserve(d->imports.size() + other.d->imports.size()); + std::transform(std::begin(other.d->imports), std::end(other.d->imports), + std::back_inserter(d->imports), + (const gpgme_import_status_t import) { + gpgme_import_status_t copy = new _gpgme_import_status{*import}; + if (import->fpr) { + copy->fpr = strdup(import->fpr); + } + copy->next = nullptr; // should already be null, but better safe than sorry + return copy; + }); + + // Finally, merge the error if there was none yet + if (!bool(error())) { + Result::operator=(other); + } +} + int GpgME::ImportResult::numConsidered() const { return d ? d->res.considered : 0 ;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/importresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/importresult.h
Changed
@@ -47,6 +47,7 @@ ImportResult(gpgme_ctx_t ctx, const Error &error); explicit ImportResult(const Error &error); + ImportResult(const ImportResult &other) = default; const ImportResult &operator=(ImportResult other) { swap(other); @@ -60,6 +61,16 @@ swap(this->d, other.d); } + /** + * Merges the result @p other into this result (and all of its copies). + * + * @note The merge algorithm assumes that @p other is the result of an + * import that was performed after the import of this result. + * @note Some numbers cannot be consolidated reliably, e.g. the number of + * keys without user ID. + */ + void mergeWith(const ImportResult &other); + bool isNull() const; int numConsidered() const; @@ -96,6 +107,7 @@ public: Import(); + Import(const Import &other) = default; const Import &operator=(Import other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/key.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/key.cpp
Changed
@@ -208,17 +208,12 @@ bool Key::canSign() const { -#ifndef GPGME_CAN_SIGN_ON_SECRET_OPENPGP_KEYLISTING_NOT_BROKEN - if (key && key->protocol == GPGME_PROTOCOL_OpenPGP) { - return true; - } -#endif - return canReallySign(); + return key && key->can_sign; } bool Key::canReallySign() const { - return key && key->can_sign; + return canSign(); } bool Key::canCertify() const @@ -515,6 +510,21 @@ return subkey && subkey->can_authenticate; } +bool Subkey::canRenc() const +{ + return subkey && subkey->can_renc; +} + +bool Subkey::canTimestamp() const +{ + return subkey && subkey->can_timestamp; +} + +bool Subkey::isGroupOwned() const +{ + return subkey && subkey->is_group_owned; +} + bool Subkey::isQualified() const { return subkey && subkey->is_qualified; @@ -1250,16 +1260,25 @@ os << "GpgME::Subkey("; if (!subkey.isNull()) { os << "\n fingerprint: " << protect(subkey.fingerprint()) + << "\n keyGrip: " << protect(subkey.keyGrip()) << "\n creationTime: " << subkey.creationTime() << "\n expirationTime:" << subkey.expirationTime() << "\n isRevoked: " << subkey.isRevoked() << "\n isExpired: " << subkey.isExpired() - << "\n isInvalid: " << subkey.isRevoked() - << "\n isDisabled: " << subkey.isInvalid() + << "\n isInvalid: " << subkey.isInvalid() + << "\n isDisabled: " << subkey.isDisabled() << "\n canSign: " << subkey.canSign() << "\n canEncrypt: " << subkey.canEncrypt() << "\n canCertify: " << subkey.canCertify() - << "\n canAuth: " << subkey.canAuthenticate(); + << "\n canAuth: " << subkey.canAuthenticate() + << "\n canRenc: " << subkey.canRenc() + << "\n canTimestanp: " << subkey.canTimestamp() + << "\n isSecret: " << subkey.isSecret() + << "\n isGroupOwned: " << subkey.isGroupOwned() + << "\n isQualified: " << subkey.isQualified() + << "\n isDeVs: " << subkey.isDeVs() + << "\n isCardKey: " << subkey.isCardKey() + << "\n cardSerialNumber:" << protect(subkey.cardSerialNumber()); } return os << ')'; } @@ -1273,7 +1292,7 @@ << "\n issuer: " << protect(key.issuerName()) << "\n fingerprint:" << protect(key.primaryFingerprint()) << "\n listmode: " << key.keyListMode() - << "\n canSign: " << key.canReallySign() + << "\n canSign: " << key.canSign() << "\n canEncrypt: " << key.canEncrypt() << "\n canCertify: " << key.canCertify() << "\n canAuth: " << key.canAuthenticate()
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/key.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/key.h
Changed
@@ -71,6 +71,7 @@ static const Null null; + Key(const Key &other) = default; const Key &operator=(Key other) { swap(other); @@ -109,16 +110,8 @@ bool isBad() const; bool canEncrypt() const; - /*! - This function contains a workaround for old gpgme's: all secret - OpenPGP keys canSign() == true, which canReallySign() doesn't - have. I don't have time to find what breaks when I remove this - workaround, but since Kleopatra merges secret into public keys, - the workaround is not necessary there (and actively harms), I've - added a new function instead. - */ bool canSign() const; - bool canReallySign() const; + GPGMEPP_DEPRECATED bool canReallySign() const; bool canCertify() const; bool canAuthenticate() const; bool isQualified() const; @@ -228,6 +221,7 @@ Subkey(const shared_gpgme_key_t &key, gpgme_sub_key_t subkey); Subkey(const shared_gpgme_key_t &key, unsigned int idx); + Subkey(const Subkey &other) = default; const Subkey &operator=(Subkey other) { swap(other); @@ -268,6 +262,9 @@ bool canSign() const; bool canCertify() const; bool canAuthenticate() const; + bool canRenc() const; + bool canTimestamp() const; + bool isGroupOwned() const; bool isQualified() const; bool isDeVs() const; bool isCardKey() const; @@ -341,6 +338,7 @@ UserID(const shared_gpgme_key_t &key, gpgme_user_id_t uid); UserID(const shared_gpgme_key_t &key, unsigned int idx); + UserID(const UserID &other) = default; const UserID &operator=(UserID other) { swap(other); @@ -459,6 +457,7 @@ Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, gpgme_key_sig_t sig); Signature(const shared_gpgme_key_t &key, gpgme_user_id_t uid, unsigned int idx); + Signature(const Signature &other) = default; const Signature &operator=(Signature other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/keygenerationresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/keygenerationresult.h
Changed
@@ -44,6 +44,7 @@ KeyGenerationResult(gpgme_ctx_t ctx, const Error &error); explicit KeyGenerationResult(const Error &err); + KeyGenerationResult(const KeyGenerationResult &other) = default; const KeyGenerationResult &operator=(KeyGenerationResult other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/keylistresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/keylistresult.h
Changed
@@ -45,6 +45,7 @@ explicit KeyListResult(const Error &err); KeyListResult(const Error &err, const _gpgme_op_keylist_result &res); + KeyListResult(const KeyListResult &other) = default; const KeyListResult &operator=(KeyListResult other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/notation.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/notation.h
Changed
@@ -44,6 +44,7 @@ Notation(); explicit Notation(gpgme_sig_notation_t nota); + Notation(const Notation &other) = default; const Notation &operator=(Notation other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/result.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/result.h
Changed
@@ -50,6 +50,14 @@ { return mError; } + /** + * Replaces the error set during construction with \p error. + * Use with care, e.g. to set a more suitable error. + */ + void setError(const Error &error) + { + mError = error; + } protected: Error mError;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/signingresult.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/signingresult.cpp
Changed
@@ -199,6 +199,7 @@ case GPGME_SIG_MODE_NORMAL: return NormalSignatureMode; case GPGME_SIG_MODE_DETACH: return Detached; case GPGME_SIG_MODE_CLEAR: return Clearsigned; + case GPGME_SIG_MODE_ARCHIVE: return SignArchive; // cannot happen } }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/signingresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/signingresult.h
Changed
@@ -50,6 +50,7 @@ SigningResult(gpgme_ctx_t ctx, const Error &error); explicit SigningResult(const Error &err); + SigningResult(const SigningResult &other) = default; const SigningResult &operator=(SigningResult other) { swap(other); @@ -86,6 +87,7 @@ public: InvalidSigningKey(); + InvalidSigningKey(const InvalidSigningKey &other) = default; const InvalidSigningKey &operator=(InvalidSigningKey other) { swap(other); @@ -119,6 +121,7 @@ CreatedSignature(); + CreatedSignature(const CreatedSignature &other) = default; const CreatedSignature &operator=(CreatedSignature other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/swdbresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/swdbresult.h
Changed
@@ -62,6 +62,7 @@ const char *iversion = NULL, Error *err = NULL); + SwdbResult(const SwdbResult &other) = default; const SwdbResult &operator=(SwdbResult other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/tofuinfo.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/tofuinfo.h
Changed
@@ -39,6 +39,7 @@ TofuInfo(); explicit TofuInfo(gpgme_tofu_info_t info); + TofuInfo(const TofuInfo &other) = default; const TofuInfo &operator=(TofuInfo other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/util.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/util.h
Changed
@@ -89,19 +89,15 @@ if (newmodes & GpgME::WithSecret) { oldmode |= GPGME_KEYLIST_MODE_WITH_SECRET; } + if (newmodes & GpgME::ForceExtern) { + oldmode |= GPGME_KEYLIST_MODE_FORCE_EXTERN; + } #ifndef NDEBUG - if (newmodes & ~(GpgME::Local | - GpgME::Extern | - GpgME::Signatures | - GpgME::SignatureNotations | - GpgME::Validate | - GpgME::Ephemeral | - GpgME::WithTofu | - GpgME::WithKeygrip | - GpgME::WithSecret)) { + if (newmodes & ~(GpgME::KeyListModeMask)) { //std::cerr << "GpgME::Context: keylist mode must be one of Local, " //"Extern, Signatures, SignatureNotations, Validate, Ephemeral, WithTofu, " - //"WithKeygrip, WithSecret, or a combination thereof!" << std::endl; + //"WithKeygrip, WithSecret, ForceExtern, or a combination thereof!" + //<< std::endl; } #endif return static_cast<gpgme_keylist_mode_t>(oldmode); @@ -137,6 +133,9 @@ if (mode & GPGME_KEYLIST_MODE_VALIDATE) { result |= GpgME::Validate; } + if (mode & GPGME_KEYLIST_MODE_FORCE_EXTERN) { + result |= GpgME::ForceExtern; + } #ifndef NDEBUG if (mode & ~(GPGME_KEYLIST_MODE_LOCAL | GPGME_KEYLIST_MODE_EXTERN | @@ -146,7 +145,8 @@ GPGME_KEYLIST_MODE_WITH_TOFU | GPGME_KEYLIST_MODE_WITH_KEYGRIP | GPGME_KEYLIST_MODE_EPHEMERAL | - GPGME_KEYLIST_MODE_VALIDATE)) { + GPGME_KEYLIST_MODE_VALIDATE | + GPGME_KEYLIST_MODE_FORCE_EXTERN)) { //std::cerr << "GpgME: WARNING: gpgme_get_keylist_mode() returned an unknown flag!" << std::endl; } #endif // NDEBUG @@ -177,6 +177,19 @@ return static_cast<gpgme_sig_notation_flags_t>(result); } +static inline std::vector<std::string> split(const std::string &text, char delimiter) +{ + std::vector<std::string> result; + if (!text.empty()) { + std::istringstream stream{text}; + std::string line; + while (std::getline(stream, line, delimiter)) { + result.push_back(line); + } + } + return result; +} + /** * Adapter for passing a vector of strings as NULL-terminated array of * const char* to the C-interface of gpgme.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/verificationresult.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/verificationresult.cpp
Changed
@@ -544,32 +544,41 @@ std::ostream &GpgME::operator<<(std::ostream &os, Signature::PKAStatus pkaStatus) { -#define OUTPUT( x ) if ( !(pkaStatus & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0) os << "GpgME::Signature::PKAStatus("; - OUTPUT(UnknownPKAStatus); - OUTPUT(PKAVerificationFailed); - OUTPUT(PKAVerificationSucceeded); + switch (pkaStatus) { +#define OUTPUT( x ) case GpgME::Signature:: x: os << #x; break + OUTPUT(UnknownPKAStatus); + OUTPUT(PKAVerificationFailed); + OUTPUT(PKAVerificationSucceeded); #undef OUTPUT + default: + os << "??? (" << static_cast<int>(pkaStatus) << ')'; + break; + } return os << ')'; } std::ostream &GpgME::operator<<(std::ostream &os, Signature::Summary summary) { -#define OUTPUT( x ) if ( !(summary & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0) os << "GpgME::Signature::Summary("; - OUTPUT(Valid); - OUTPUT(Green); - OUTPUT(Red); - OUTPUT(KeyRevoked); - OUTPUT(KeyExpired); - OUTPUT(SigExpired); - OUTPUT(KeyMissing); - OUTPUT(CrlMissing); - OUTPUT(CrlTooOld); - OUTPUT(BadPolicy); - OUTPUT(SysError); - OUTPUT(TofuConflict); + if (summary == Signature::None) { + os << "None"; + } else { +#define OUTPUT( x ) if ( !(summary & (GpgME::Signature:: x)) ) {} else do { os << #x " "; } while(0) + OUTPUT(Valid); + OUTPUT(Green); + OUTPUT(Red); + OUTPUT(KeyRevoked); + OUTPUT(KeyExpired); + OUTPUT(SigExpired); + OUTPUT(KeyMissing); + OUTPUT(CrlMissing); + OUTPUT(CrlTooOld); + OUTPUT(BadPolicy); + OUTPUT(SysError); + OUTPUT(TofuConflict); #undef OUTPUT + } return os << ')'; } @@ -603,10 +612,14 @@ std::ostream &GpgME::operator<<(std::ostream &os, Notation::Flags flags) { os << "GpgME::Notation::Flags("; + if (flags == Notation::NoFlags) { + os << "NoFlags"; + } else { #define OUTPUT( x ) if ( !(flags & (GpgME::Notation:: x)) ) {} else do { os << #x " "; } while(0) - OUTPUT(HumanReadable); - OUTPUT(Critical); + OUTPUT(HumanReadable); + OUTPUT(Critical); #undef OUTPUT + } return os << ')'; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/verificationresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/verificationresult.h
Changed
@@ -52,6 +52,7 @@ VerificationResult(gpgme_ctx_t ctx, const Error &error); explicit VerificationResult(const Error &err); + VerificationResult(const VerificationResult &other) = default; const VerificationResult &operator=(VerificationResult other) { swap(other); @@ -90,6 +91,7 @@ Signature(); + Signature(const Signature &other) = default; const Signature &operator=(Signature other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/src/vfsmountresult.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/src/vfsmountresult.h
Changed
@@ -45,6 +45,7 @@ VfsMountResult(gpgme_ctx_t ctx, const Error &error, const Error &opError); explicit VfsMountResult(const Error &err); + VfsMountResult(const VfsMountResult &other) = default; const VfsMountResult &operator=(VfsMountResult other) { swap(other);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/tests/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/tests/Makefile.in
Changed
@@ -111,6 +111,7 @@ subdir = lang/cpp/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -119,8 +120,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -274,10 +276,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -287,6 +294,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/tests/run-getkey.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/tests/run-getkey.cpp
Changed
@@ -60,6 +60,8 @@ " --ephemeral use GPGME_KEYLIST_MODE_EPHEMERAL\n" " --validate use GPGME_KEYLIST_MODE_VALIDATE\n" " --locate use GPGME_KEYLIST_MODE_LOCATE\n" + " --force-extern use GPGME_KEYLIST_MODE_FORCE_EXTERN\n" + " --locate-external use GPGME_KEYLIST_MODE_LOCATE_EXTERNAL\n" , stderr); exit (ex); } @@ -116,6 +118,12 @@ } else if (!strcmp (*argv, "--locate")) { argc--; argv++; mode |= KeyListMode::Locate; + } else if (!strcmp (*argv, "--force-extern")) { + argc--; argv++; + mode |= KeyListMode::ForceExtern; + } else if (!strcmp (*argv, "--locate-external")) { + argc--; argv++; + mode |= KeyListMode::LocateExternal; } else if (!strncmp (*argv, "--", 2)) { show_usage (1); } @@ -132,6 +140,12 @@ return -1; } ctx->setKeyListMode (mode); + if (ctx->keyListMode() != mode) { + // unfortunately, Context::setKeyListMode() does not return the error + // returned by gpgme + std::cerr << "Failed to set keylist mode. You may have used an invalid combination of options."; + return -1; + } Error err; const GpgME::Key key = ctx->key (*argv, err, only_secret); std::stringstream ss;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/cpp/tests/run-keylist.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/cpp/tests/run-keylist.cpp
Changed
@@ -61,6 +61,8 @@ " --ephemeral use GPGME_KEYLIST_MODE_EPHEMERAL\n" " --validate use GPGME_KEYLIST_MODE_VALIDATE\n" " --locate use GPGME_KEYLIST_MODE_LOCATE\n" + " --force-extern use GPGME_KEYLIST_MODE_FORCE_EXTERN\n" + " --locate-external use GPGME_KEYLIST_MODE_LOCATE_EXTERNAL\n" , stderr); exit (ex); } @@ -117,7 +119,17 @@ } else if (!strcmp (*argv, "--locate")) { argc--; argv++; mode |= KeyListMode::Locate; + } else if (!strcmp (*argv, "--with-secret")) { + argc--; argv++; + mode |= KeyListMode::WithSecret; + } else if (!strcmp (*argv, "--force-extern")) { + argc--; argv++; + mode |= KeyListMode::ForceExtern; + } else if (!strcmp (*argv, "--locate-external")) { + argc--; argv++; + mode |= KeyListMode::LocateExternal; } else if (!strncmp (*argv, "--", 2)) { + std::cerr << "Error: Unknown option: " << *argv << std::endl; show_usage (1); } } @@ -133,6 +145,12 @@ return -1; } ctx->setKeyListMode (mode); + if (ctx->keyListMode() != mode) { + // unfortunately, Context::setKeyListMode() does not return the error + // returned by gpgme + std::cerr << "Failed to set keylist mode. You may have used an invalid combination of options.\n"; + return -1; + } Error err = ctx->startKeyListing (*argv, only_secret); if (err) { std::cout << "Error: " << err.asString() << "\n";
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/js/BrowserTestExtension/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/js/BrowserTestExtension/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = lang/js/BrowserTestExtension ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -199,10 +201,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -212,6 +219,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/js/DemoExtension/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/js/DemoExtension/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = lang/js/DemoExtension ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -199,10 +201,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -212,6 +219,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/js/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/js/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang/js ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -258,10 +260,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -271,6 +278,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/js/src/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/js/src/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = lang/js/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -199,10 +201,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -212,6 +219,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/Makefile.am
Changed
@@ -23,7 +23,13 @@ gpgme.i \ helpers.c helpers.h private.h -SUBDIRS = . tests examples doc src +if RUN_GPG_TESTS +tests = tests +else +tests = +endif + +SUBDIRS = . ${tests} examples doc src .PHONY: prepare prepare: copystamp
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang/python ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -180,7 +182,7 @@ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags -DIST_SUBDIRS = $(SUBDIRS) +DIST_SUBDIRS = . tests examples doc src am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/setup.py.in \ $(srcdir)/version.py.in $(top_srcdir)/build-aux/mkinstalldirs \ README @@ -259,10 +261,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -272,6 +279,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -414,7 +422,9 @@ gpgme.i \ helpers.c helpers.h private.h -SUBDIRS = . tests examples doc src +@RUN_GPG_TESTS_FALSE@tests = +@RUN_GPG_TESTS_TRUE@tests = tests +SUBDIRS = . ${tests} examples doc src CLEANFILES = copystamp \ config.h \ data.h \
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/doc/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/doc/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang/python/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -198,10 +200,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -211,6 +218,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/doc/src/gpgme-python-howto.org -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/doc/src/gpgme-python-howto.org
Changed
@@ -1612,6 +1612,7 @@ #+BEGIN_SRC python -i import gpg +import os import os.path import sys @@ -1619,6 +1620,9 @@ This script exports one or more public keys in minimised form. """) +def open_0o600(path, flags): + return os.open(path, flags, mode=0o600) + c = gpg.Context(armor=True) if len(sys.argv) >= 4: @@ -1654,7 +1658,7 @@ result = c.key_export_minimal(pattern=None) if result is not None: - with open(keyfile, "wb") as f: + with open(keyfile, "wb", opener=open_0o600) as f: f.write(result) else: pass @@ -1686,6 +1690,9 @@ The gpg-agent and pinentry are invoked to authorise the export. """) +def open_0o600(path, flags): + return os.open(path, flags, mode=0o600) + c = gpg.Context(armor=True) if len(sys.argv) >= 4: @@ -1735,9 +1742,8 @@ result = c.key_export_secret(pattern=None) if result is not None: - with open(keyfile, "wb") as f: + with open(keyfile, "wb", opener=open_0o600)) as f: f.write(result) - os.chmod(keyfile, 0o600) else: pass #+END_SRC @@ -3124,7 +3130,7 @@ For the most part the =gpg.version.versionstr= and =gpg.version.versionlist= methods have been quite sufficient. The -former returns the same string as =gpgme-config --version=, while the +former returns the same string as =pkg-config gpgme --modversion=, while the latter returns the major, minor and patch values in a list. To check if the installed bindings have actually been built against @@ -3135,7 +3141,7 @@ import subprocess import sys -gpgme_version_call = subprocess.Popen("gpgme-config", "--version", +gpgme_version_call = subprocess.Popen("pkg-config", "gpgme", "--modversion", stdout=subprocess.PIPE, stderr=subprocess.PIPE) gpgme_version_str = gpgme_version_call.communicate()
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/examples/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/examples/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang/python/examples ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -198,10 +200,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -211,6 +218,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/examples/howto/export-secret-key.py -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/examples/howto/export-secret-key.py
Changed
@@ -35,6 +35,9 @@ The gpg-agent and pinentry are invoked to authorise the export. """) +def open_0o600(path, flags): + return os.open(path, flags, mode=0o600) + c = gpg.Context(armor=True) if len(sys.argv) >= 4: @@ -84,8 +87,7 @@ result = c.key_export_secret(pattern=None) if result is not None: - with open(keyfile, "wb") as f: + with open(keyfile, "wb", opener=open_0o600) as f: f.write(result) - os.chmod(keyfile, 0o600) else: pass
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/examples/howto/export-secret-keys.py -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/examples/howto/export-secret-keys.py
Changed
@@ -37,6 +37,9 @@ The gpg-agent and pinentry are invoked to authorise the export. """) +def open_0o600(path, flags): + return os.open(path, flags, mode=0o600) + if sys.platform == "win32": gpgconfcmd = "gpgconf.exe --list-dirs homedir" else: @@ -119,15 +122,13 @@ b_result = b.key_export_secret(pattern=None) if a_result is not None: - with open(ascfile, "wb") as f: + with open(ascfile, "wb", opener=open_0o600) as f: f.write(a_result) - os.chmod(ascfile, 0o600) else: pass if b_result is not None: - with open(gpgfile, "wb") as f: + with open(gpgfile, "wb", opener=open_0o600) as f: f.write(b_result) - os.chmod(gpgfile, 0o600) else: pass
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/examples/howto/temp-homedir-config.py -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/examples/howto/temp-homedir-config.py
Changed
@@ -112,18 +112,18 @@ nh = "{0}/.{1}".format(userdir, new_homedir) +def open_0o600(path, flags): + return os.open(path, flags, mode=0o600) + if os.path.exists(nh) is True: print("The {0} directory already exists.".format(nh)) else: print("Creating the {0} directory.".format(nh)) - os.mkdir(nh) - os.chmod(nh, 0o700) - with open("{0}/{1}".format(nh, "gpg.conf"), "w") as f1: + os.mkdir(nh, 0o700) + with open("{0}/{1}".format(nh, "gpg.conf"), "w", opener=open_0o600) as f1: f1.write(gpgconf) - os.chmod("{0}/{1}".format(nh, "gpg.conf"), 0o600) - with open("{0}/{1}".format(nh, "gpg-agent.conf"), "w") as f2: + with open("{0}/{1}".format(nh, "gpg-agent.conf"), "w", opener=open_0o600) as f2: f2.write(gpgconf) - os.chmod("{0}/{1}".format(nh, "gpg-agent.conf"), 0o600) print("""You may now use the {0} directory as an alternative GPG homedir: gpg --homedir {0}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/helpers.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/helpers.c
Changed
@@ -404,7 +404,7 @@ err_status = _gpg_exception2code(); } else { if (!retval) { - if (write(fd, "\n", 1) < 0) { + if (gpgme_io_writen (fd, "\n", 1) < 0) { err_status = gpgme_error_from_syserror (); _gpg_raise_exception (err_status); } @@ -439,11 +439,11 @@ goto leave; } - if (write(fd, buf, len) < 0) { + if (gpgme_io_writen (fd, buf, len) < 0) { err_status = gpgme_error_from_syserror (); _gpg_raise_exception (err_status); } - if (! err_status && write(fd, "\n", 1) < 0) { + if (! err_status && gpgme_io_writen (fd, "\n", 1) < 0) { err_status = gpgme_error_from_syserror (); _gpg_raise_exception (err_status); } @@ -761,11 +761,11 @@ goto leave; } - if (write(fd, buffer, size) < 0) { + if (gpgme_io_writen (fd, buffer, size) < 0) { err_status = gpgme_error_from_syserror (); _gpg_raise_exception (err_status); } - if (! err_status && write(fd, "\n", 1) < 0) { + if (! err_status && gpgme_io_writen (fd, "\n", 1) < 0) { err_status = gpgme_error_from_syserror (); _gpg_raise_exception (err_status); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/helpers.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/helpers.h
Changed
@@ -25,11 +25,6 @@ #include <gpgme.h> #include "Python.h" -#ifdef _WIN32 -#include <windows.h> -#define write(fd, str, sz) {DWORD written; WriteFile((HANDLE) fd, str, sz, &written, 0);} -#endif - /* Flag specifying whether this is an in-tree build. */ extern int gpg_in_tree_build;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/setup.py.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/setup.py.in
Changed
@@ -30,9 +30,6 @@ import sys # Out-of-tree build of the gpg bindings. -gpg_error_config = 'gpg-error-config' -gpgme_config_flags = '--thread=pthread' -gpgme_config = 'gpgme-config' + gpgme_config_flags gpgme_h = '' include_dirs = os.getcwd() library_dirs = @@ -44,8 +41,6 @@ if top_builddir: # In-tree build. in_tree = True - gpgme_config = os.path.join(top_builddir, 'src/gpgme-config') - + gpgme_config_flags gpgme_h = os.path.join(top_builddir, 'src/gpgme.h') library_dirs = os.path.join(top_builddir, 'src/.libs') # XXX uses libtool internals @@ -60,20 +55,8 @@ else: devnull = open(os.devnull, 'w') -try: - subprocess.check_call(gpgme_config + '--version', stdout=devnull) -except: - sys.exit('Could not find gpgme-config. ' + - 'Please install the libgpgme development package.') - -def getconfig(what, config=gpgme_config): - confdata = subprocess.Popen( - config + '--%s' % what, stdout=subprocess.PIPE).communicate()0 - return x for x in confdata.decode('utf-8').split() if x != '' - - -version = version_raw = getconfig('version')0 +version = version_raw = "@VERSION@" if '-' in version: version = version.split('-')0 major, minor, patch = map(int, version.split('.')) @@ -82,25 +65,29 @@ sys.exit('Need at least GPGME version 1.7, found {}.'.format(version_raw)) if not gpgme_h: - gpgme_h = os.path.join(getconfig('prefix')0, 'include', 'gpgme.h') + gpgme_h = os.path.join('@prefix@', 'include', 'gpgme.h') define_macros = -libs = getconfig('libs') +if '@GPGME_CONFIG_LIBS@': + libs = '@GPGME_CONFIG_LIBS@'.split(' ') +else: + libs = # Define extra_macros for both the SWIG and C code for k, v in extra_macros.items(): extra_swig_opts.append('-D{0}={1}'.format(k, v)) define_macros.append((k, str(v))) -for item in getconfig('cflags'): - if item.startswith('-I'): - include_dirs.append(item2:) - elif item.startswith('-D'): - defitem = item2:.split('=', 1) - if len(defitem) == 2: - define_macros.append((defitem0, defitem1)) - else: - define_macros.append((defitem0, None)) +if '@GPGME_CONFIG_CFLAGS@': + for item in '@GPGME_CONFIG_CFLAGS@'.split(' '): + if item.startswith('-I'): + include_dirs.append(item2:) + elif item.startswith('-D'): + defitem = item2:.split('=', 1) + if len(defitem) == 2: + define_macros.append((defitem0, defitem1)) + else: + define_macros.append((defitem0, None)) # Adjust include and library locations in case of win32 uname_s = os.popen('uname -s').read() @@ -182,15 +169,9 @@ def _generate_errors_i(self): - try: - subprocess.check_call( - gpg_error_config + '--version', stdout=devnull) - except: - sys.exit('Could not find gpg-error-config. ' + - 'Please install the libgpg-error development package.') - + ge_cflags='@GPG_ERROR_CFLAGS@' gpg_error_content = self._read_header( - 'gpg-error.h', getconfig('cflags', config=gpg_error_config)) + 'gpg-error.h', ge_cflags.split(' ') if ge_cflags else ) filter_re = re.compile(r'GPG_ERR_^ * =') rewrite_re = re.compile(r' *(.*) = .*')
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/src/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/src/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang/python/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -198,10 +200,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -211,6 +218,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/src/core.py -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/src/core.py
Changed
@@ -106,9 +106,13 @@ set_func = getattr(gpgme, "{}set_{}".format(self._cprefix, key)) def get(slf): + if not slf.wrapped: + return False return bool(get_func(slf.wrapped)) def set_(slf, value): + if not slf.wrapped: + return set_func(slf.wrapped, bool(value)) p = property(get, set_, doc="{} flag".format(key)) @@ -135,6 +139,8 @@ if self._errorcheck(name): def _funcwrap(slf, *args): + if not slf.wrapped: + return None result = func(slf.wrapped, *args) if slf._callback_excinfo: gpgme.gpg_raise_callback_exception(slf) @@ -142,6 +148,8 @@ else: def _funcwrap(slf, *args): + if not slf.wrapped: + return None result = func(slf.wrapped, *args) if slf._callback_excinfo: gpgme.gpg_raise_callback_exception(slf) @@ -332,8 +340,7 @@ finally: if passphrase is not None: self.pinentry_mode = old_pinentry_mode - if old_passphrase_cb: - self.set_passphrase_cb(*old_passphrase_cb1:) + gpgme.gpg_set_passphrase_cb(self, old_passphrase_cb) result = self.op_encrypt_result() assert not result.invalid_recipients @@ -426,8 +433,7 @@ finally: if passphrase is not None: self.pinentry_mode = old_pinentry_mode - if old_passphrase_cb: - self.set_passphrase_cb(*old_passphrase_cb1:) + gpgme.gpg_set_passphrase_cb(self, old_passphrase_cb) result = self.op_decrypt_result() @@ -851,8 +857,7 @@ finally: if util.is_a_string(passphrase): self.pinentry_mode = old_pinentry_mode - if old_passphrase_cb: - self.set_passphrase_cb(*old_passphrase_cb1:) + gpgme.gpg_set_passphrase_cb(self, old_passphrase_cb) return self.op_genkey_result() @@ -934,8 +939,7 @@ finally: if util.is_a_string(passphrase): self.pinentry_mode = old_pinentry_mode - if old_passphrase_cb: - self.set_passphrase_cb(*old_passphrase_cb1:) + gpgme.gpg_set_passphrase_cb(self, old_passphrase_cb) return self.op_genkey_result() @@ -1102,6 +1106,8 @@ @property def signers(self): """Keys used for signing""" + if not self.wrapped: + return None return self.signers_enum(i) for i in range(self.signers_count()) @signers.setter @@ -1137,6 +1143,8 @@ @property def home_dir(self): """Engine's home directory""" + if not self.wrapped: + return None return self.engine_info.home_dir @home_dir.setter @@ -1182,7 +1190,7 @@ return self def __exit__(self, type, value, tb): - self.__del__() + return False def op_keylist_all(self, *args, **kwargs): self.op_keylist_start(*args, **kwargs) @@ -1520,7 +1528,7 @@ return self def __exit__(self, type, value, tb): - self.__del__() + return False def _free_datacbs(self): self._data_cbs = None
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/tests/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/tests/Makefile.am
Changed
@@ -107,6 +107,7 @@ --import $(test_srcdir)/pubdemo.asc -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(test_srcdir)/secdemo.asc + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo x > ./pubring-stamp gpg.conf:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/tests/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/tests/Makefile.in
Changed
@@ -108,6 +108,7 @@ subdir = lang/python/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -116,8 +117,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -197,10 +199,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -210,6 +217,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -635,6 +643,7 @@ --import $(test_srcdir)/pubdemo.asc -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(test_srcdir)/secdemo.asc + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo x > ./pubring-stamp gpg.conf:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/python/tests/t-idiomatic.py -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/python/tests/t-idiomatic.py
Changed
@@ -35,6 +35,9 @@ d.write(b"Halloechen") leak_c = c leak_d = d + +leak_c.__del__() +leak_d.__del__() assert leak_c.wrapped is None assert leak_d.wrapped is None
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/Makefile.in
Changed
@@ -110,6 +110,7 @@ subdir = lang/qt ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -118,8 +119,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -259,10 +261,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -272,6 +279,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/doc/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/doc/Makefile.in
Changed
@@ -109,6 +109,7 @@ subdir = lang/qt/doc ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -117,8 +118,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -198,10 +200,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -211,6 +218,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/DecryptVerifyArchiveJob
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/decryptverifyarchivejob.h"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/EncryptArchiveJob
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/encryptarchivejob.h"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/FileListDataProvider
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/filelistdataprovider.h"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/Makefile.am
Changed
@@ -18,31 +18,51 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA + +if WANT_QT5 lib_LTLIBRARIES = libqgpgme.la +endif +if WANT_QT6 +lib_LTLIBRARIES = libqgpgmeqt6.la +endif + EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \ qgpgme_debug.h qgpgme_version.h.in \ - QGpgmeConfig.cmake.in.in + QGpgmeConfig-w32.cmake.in.in QGpgmeQt6Config.cmake.in.in \ + QGpgmeQt6Config-w32.cmake.in.in QGpgmeQt6ConfigVersion.cmake.in qgpgme_sources = \ dataprovider.cpp \ debug.cpp \ + decryptverifyarchivejob.cpp \ + encryptarchivejob.cpp \ + filelistdataprovider.cpp \ job.cpp multideletejob.cpp qgpgmeadduseridjob.cpp \ qgpgmeaddexistingsubkeyjob.cpp \ qgpgmebackend.cpp qgpgmechangeexpiryjob.cpp qgpgmechangeownertrustjob.cpp \ qgpgmechangepasswdjob.cpp qgpgmedecryptjob.cpp \ + qgpgmedecryptverifyarchivejob.cpp \ qgpgmedecryptverifyjob.cpp qgpgmedeletejob.cpp qgpgmedownloadjob.cpp \ + qgpgmeencryptarchivejob.cpp \ qgpgmeencryptjob.cpp qgpgmeexportjob.cpp qgpgmeimportfromkeyserverjob.cpp \ qgpgmeimportjob.cpp qgpgmekeygenerationjob.cpp qgpgmekeylistjob.cpp \ - qgpgmelistallkeysjob.cpp qgpgmenewcryptoconfig.cpp \ + listallkeysjob.cpp qgpgmelistallkeysjob.cpp qgpgmenewcryptoconfig.cpp \ qgpgmereceivekeysjob.cpp \ - qgpgmerefreshkeysjob.cpp \ + qgpgmerefreshsmimekeysjob.cpp \ + qgpgmerevokekeyjob.cpp \ + qgpgmesetprimaryuseridjob.cpp \ + qgpgmesignarchivejob.cpp \ qgpgmesignencryptjob.cpp \ + qgpgmesignencryptarchivejob.cpp \ qgpgmesignjob.cpp qgpgmesignkeyjob.cpp qgpgmeverifydetachedjob.cpp \ qgpgmeverifyopaquejob.cpp qgpgmewkdlookupjob.cpp threadedjobmixin.cpp \ qgpgmekeyformailboxjob.cpp qgpgme_debug.cpp \ qgpgmetofupolicyjob.cpp qgpgmequickjob.cpp \ defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \ - qgpgmegpgcardjob.cpp changeexpiryjob.cpp importjob.cpp \ + qgpgmegpgcardjob.cpp changeexpiryjob.cpp encryptjob.cpp importjob.cpp \ + signarchivejob.cpp \ + signencryptjob.cpp \ + signencryptarchivejob.cpp \ dn.cpp cryptoconfig.cpp wkdlookupresult.cpp \ util.cpp @@ -57,10 +77,13 @@ dataprovider.h \ debug.h \ decryptjob.h \ + decryptverifyarchivejob.h \ decryptverifyjob.h \ downloadjob.h \ + encryptarchivejob.h \ encryptjob.h \ exportjob.h \ + filelistdataprovider.h \ hierarchicalkeylistjob.h \ job.h \ keyformailboxjob.h \ @@ -70,10 +93,14 @@ qgpgmenewcryptoconfig.h \ quickjob.h \ receivekeysjob.h \ + revokekeyjob.h \ + setprimaryuseridjob.h \ specialjob.h \ + signarchivejob.h \ signjob.h \ signkeyjob.h \ signencryptjob.h \ + signencryptarchivejob.h \ verifyopaquejob.h \ refreshkeysjob.h \ cryptoconfig.h \ @@ -102,11 +129,14 @@ DataProvider \ Debug \ DecryptJob \ + DecryptVerifyArchiveJob \ DecryptVerifyJob \ DN \ DownloadJob \ + EncryptArchiveJob \ EncryptJob \ ExportJob \ + FileListDataProvider \ HierarchicalKeyKistJob \ Job \ MultiDeleteJob \ @@ -114,9 +144,13 @@ QGpgMENewCryptoConfig \ QuickJob \ ReceiveKeysJob \ + RevokeKeyJob \ + SetPrimaryUserIDJob \ SpecialJob \ + SignArchiveJob \ SignJob \ SignKeyJob \ + SignEncryptArchiveJob \ SignEncryptJob \ VerifyOpaqueJob \ RefreshKeysJob \ @@ -137,6 +171,12 @@ GpgCardJob private_qgpgme_headers = \ + changeexpiryjob_p.h \ + decryptverifyarchivejob_p.h \ + encryptarchivejob_p.h \ + encryptjob_p.h \ + importjob_p.h \ + listallkeysjob_p.h \ qgpgme_export.h \ protocol_p.h \ job_p.h \ @@ -147,9 +187,11 @@ qgpgmechangeownertrustjob.h \ qgpgmechangepasswdjob.h \ qgpgmedecryptjob.h \ + qgpgmedecryptverifyarchivejob.h \ qgpgmedecryptverifyjob.h \ qgpgmedeletejob.h \ qgpgmedownloadjob.h \ + qgpgmeencryptarchivejob.h \ qgpgmeencryptjob.h \ qgpgmeexportjob.h \ qgpgmeimportfromkeyserverjob.h \ @@ -158,8 +200,12 @@ qgpgmekeylistjob.h \ qgpgmelistallkeysjob.h \ qgpgmereceivekeysjob.h \ - qgpgmerefreshkeysjob.h \ + qgpgmerefreshsmimekeysjob.h \ + qgpgmerevokekeyjob.h \ + qgpgmesetprimaryuseridjob.h \ + qgpgmesignarchivejob.h \ qgpgmesignencryptjob.h \ + qgpgmesignencryptarchivejob.h \ qgpgmesignjob.h \ qgpgmesignkeyjob.h \ qgpgmeverifydetachedjob.h \ @@ -170,6 +216,9 @@ qgpgmetofupolicyjob.h \ qgpgmegpgcardjob.h \ qgpgmequickjob.h \ + signarchivejob_p.h \ + signencryptjob_p.h \ + signencryptarchivejob_p.h \ threadedjobmixin.h \ util.h @@ -181,9 +230,11 @@ changeownertrustjob.moc \ changepasswdjob.moc \ decryptjob.moc \ + decryptverifyarchivejob.moc \ decryptverifyjob.moc \ deletejob.moc \ downloadjob.moc \ + encryptarchivejob.moc \ encryptjob.moc \ exportjob.moc \ hierarchicalkeylistjob.moc \ @@ -200,9 +251,11 @@ qgpgmechangeownertrustjob.moc \ qgpgmechangepasswdjob.moc \ qgpgmedecryptjob.moc \ + qgpgmedecryptverifyarchivejob.moc \ qgpgmedecryptverifyjob.moc \ qgpgmedeletejob.moc \ qgpgmedownloadjob.moc \ + qgpgmeencryptarchivejob.moc \ qgpgmeencryptjob.moc \ qgpgmeexportjob.moc \ qgpgmeimportfromkeyserverjob.moc \ @@ -211,8 +264,12 @@ qgpgmekeylistjob.moc \ qgpgmelistallkeysjob.moc \ qgpgmereceivekeysjob.moc \ - qgpgmerefreshkeysjob.moc \ + qgpgmerefreshsmimekeysjob.moc \ + qgpgmerevokekeyjob.moc \ + qgpgmesetprimaryuseridjob.moc \ + qgpgmesignarchivejob.moc \ qgpgmesignencryptjob.moc \ + qgpgmesignencryptarchivejob.moc \ qgpgmesignjob.moc \ qgpgmesignkeyjob.moc \ qgpgmeverifydetachedjob.moc \ @@ -223,7 +280,11 @@ qgpgmetofupolicyjob.moc \ receivekeysjob.moc \ refreshkeysjob.moc \ + revokekeyjob.moc \ + setprimaryuseridjob.moc \ + signarchivejob.moc \ signencryptjob.moc \ + signencryptarchivejob.moc \ signjob.moc \ signkeyjob.moc \ specialjob.moc \ @@ -245,17 +306,32 @@ camelcaseinclude_HEADERS = $(camelcase_headers) nodist_qgpgmeinclude_HEADERS = qgpgme_version.h -libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) - +if WANT_QT5 AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ - @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ + @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ -DBUILDING_QGPGME -Wsuggest-override \ -Wzero-as-null-pointer-constant +libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) + libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \ - @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT_LIBS@ + @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT5_LIBS@ libqgpgme_la_LDFLAGS = -no-undefined -version-info \ - @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ + @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ +endif +if WANT_QT6 +AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ + @GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ + -DBUILDING_QGPGME -Wsuggest-override \ + -Wzero-as-null-pointer-constant + +libqgpgmeqt6_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) + +libqgpgmeqt6_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \ + @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT6_LIBS@ +libqgpgmeqt6_la_LDFLAGS = -no-undefined -version-info \ + @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ +endif if HAVE_MACOS_SYSTEM libsuffix=.dylib @@ -263,6 +339,7 @@ libsuffix=.so endif +if WANT_QT5 if HAVE_W32_SYSTEM QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in sed -e 's|@resolved_bindir@|$(bindir)|g' < "$<" | \ @@ -274,23 +351,52 @@ sed -e 's|@libsuffix@|$(libsuffix)|g' | \ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ endif +endif +if WANT_QT6 +if HAVE_W32_SYSTEM +QGpgmeQt6Config.cmake: QGpgmeQt6Config-w32.cmake.in + sed -e 's|@resolved_bindir@|$(bindir)|g' < "$<" | \ + sed -e 's|@resolved_libdir@|$(libdir)|g' | \ + sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ +else +QGpgmeQt6Config.cmake: QGpgmeQt6Config.cmake.in + sed -e 's|@resolved_libdir@|$(libdir)|g' < "$<" | \ + sed -e 's|@libsuffix@|$(libsuffix)|g' | \ + sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ +endif +endif $(camelcase_headers): Makefile.am echo -n "#include \"qgpgme/" > "$@" echo -n "$@" | tr ':upper:' ':lower:' >> "$@" echo ".h\"" >> "$@" +if WANT_QT5 install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme $(INSTALL) -m 644 QGpgmeConfig.cmake \ - $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake + $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake $(INSTALL) -m 644 QGpgmeConfigVersion.cmake \ - $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake + $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake uninstall-cmake-files: -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake -rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/ +endif +if WANT_QT6 +install-cmake-files: QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake + -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgmeQt6 + $(INSTALL) -m 644 QGpgmeQt6Config.cmake \ + $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake + $(INSTALL) -m 644 QGpgmeQt6ConfigVersion.cmake \ + $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake + +uninstall-cmake-files: + -rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake + -rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake + -rmdir $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/ +endif install-data-local: install-cmake-files @@ -300,9 +406,16 @@ CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake \ qgpgme_version.h QGpgmeConfig.cmake.in \ - QGpgmeConfigVersion.cmake + QGpgmeConfig-w32.cmake.in QGpgmeConfigVersion.cmake \ + QGpgmeQt6Config.cmake.in QGpgmeQt6Config-w32.cmake.in \ + QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake +if WANT_QT5 nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources) +endif +if WANT_QT6 +nodist_libqgpgmeqt6_la_SOURCES = $(qgpgme_moc_sources) +endif .h.moc: $(MOC) `test -f '$<' || echo '$(srcdir)/'`$< -o $@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/Makefile.in
Changed
@@ -14,6 +14,27 @@ @SET_MAKE@ +# Makefile.am for GPGMEPP. +# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik +# Software engineering by Intevation GmbH +# +# This file is part of GPGMEPP. +# +# GPGME-CL is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# GPGME-CL 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 General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA + VPATH = @srcdir@ am__is_gnu_make = { \ @@ -92,6 +113,7 @@ subdir = lang/qt/src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -100,8 +122,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(camelcaseinclude_HEADERS) \ @@ -109,7 +132,9 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/build-aux/mkinstalldirs CONFIG_HEADER = $(top_builddir)/conf/config.h CONFIG_CLEAN_FILES = QGpgmeConfig-w32.cmake.in QGpgmeConfig.cmake.in \ - QGpgmeConfigVersion.cmake qgpgme_version.h + QGpgmeConfigVersion.cmake QGpgmeQt6Config-w32.cmake.in \ + QGpgmeQt6Config.cmake.in QGpgmeQt6ConfigVersion.cmake \ + qgpgme_version.h CONFIG_CLEAN_VPATH_FILES = am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -143,31 +168,101 @@ "$(DESTDIR)$(qgpgmeincludedir)" \ "$(DESTDIR)$(qgpgmeincludedir)" LTLIBRARIES = $(lib_LTLIBRARIES) -libqgpgme_la_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../../../src/libgpgme.la -am__objects_1 = dataprovider.lo debug.lo job.lo multideletejob.lo \ - qgpgmeadduseridjob.lo qgpgmeaddexistingsubkeyjob.lo \ - qgpgmebackend.lo qgpgmechangeexpiryjob.lo \ - qgpgmechangeownertrustjob.lo qgpgmechangepasswdjob.lo \ - qgpgmedecryptjob.lo qgpgmedecryptverifyjob.lo \ - qgpgmedeletejob.lo qgpgmedownloadjob.lo qgpgmeencryptjob.lo \ +@WANT_QT5_TRUE@libqgpgme_la_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la +am__libqgpgme_la_SOURCES_DIST = dataprovider.cpp debug.cpp \ + decryptverifyarchivejob.cpp encryptarchivejob.cpp \ + filelistdataprovider.cpp job.cpp multideletejob.cpp \ + qgpgmeadduseridjob.cpp qgpgmeaddexistingsubkeyjob.cpp \ + qgpgmebackend.cpp qgpgmechangeexpiryjob.cpp \ + qgpgmechangeownertrustjob.cpp qgpgmechangepasswdjob.cpp \ + qgpgmedecryptjob.cpp qgpgmedecryptverifyarchivejob.cpp \ + qgpgmedecryptverifyjob.cpp qgpgmedeletejob.cpp \ + qgpgmedownloadjob.cpp qgpgmeencryptarchivejob.cpp \ + qgpgmeencryptjob.cpp qgpgmeexportjob.cpp \ + qgpgmeimportfromkeyserverjob.cpp qgpgmeimportjob.cpp \ + qgpgmekeygenerationjob.cpp qgpgmekeylistjob.cpp \ + listallkeysjob.cpp qgpgmelistallkeysjob.cpp \ + qgpgmenewcryptoconfig.cpp qgpgmereceivekeysjob.cpp \ + qgpgmerefreshsmimekeysjob.cpp qgpgmerevokekeyjob.cpp \ + qgpgmesetprimaryuseridjob.cpp qgpgmesignarchivejob.cpp \ + qgpgmesignencryptjob.cpp qgpgmesignencryptarchivejob.cpp \ + qgpgmesignjob.cpp qgpgmesignkeyjob.cpp \ + qgpgmeverifydetachedjob.cpp qgpgmeverifyopaquejob.cpp \ + qgpgmewkdlookupjob.cpp threadedjobmixin.cpp \ + qgpgmekeyformailboxjob.cpp qgpgme_debug.cpp \ + qgpgmetofupolicyjob.cpp qgpgmequickjob.cpp \ + defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \ + qgpgmegpgcardjob.cpp changeexpiryjob.cpp encryptjob.cpp \ + importjob.cpp signarchivejob.cpp signencryptjob.cpp \ + signencryptarchivejob.cpp dn.cpp cryptoconfig.cpp \ + wkdlookupresult.cpp util.cpp abstractimportjob.h \ + addexistingsubkeyjob.h adduseridjob.h changeexpiryjob.h \ + changeownertrustjob.h changepasswdjob.h dataprovider.h debug.h \ + decryptjob.h decryptverifyarchivejob.h decryptverifyjob.h \ + downloadjob.h encryptarchivejob.h encryptjob.h exportjob.h \ + filelistdataprovider.h hierarchicalkeylistjob.h job.h \ + keyformailboxjob.h multideletejob.h protocol.h qgpgme_export.h \ + qgpgmenewcryptoconfig.h quickjob.h receivekeysjob.h \ + revokekeyjob.h setprimaryuseridjob.h specialjob.h \ + signarchivejob.h signjob.h signkeyjob.h signencryptjob.h \ + signencryptarchivejob.h verifyopaquejob.h refreshkeysjob.h \ + cryptoconfig.h deletejob.h importfromkeyserverjob.h \ + importjob.h keygenerationjob.h keylistjob.h listallkeysjob.h \ + verifydetachedjob.h defaultkeygenerationjob.h tofupolicyjob.h \ + wkdlookupjob.h wkdlookupresult.h wkspublishjob.h gpgcardjob.h \ + dn.h changeexpiryjob_p.h decryptverifyarchivejob_p.h \ + encryptarchivejob_p.h encryptjob_p.h importjob_p.h \ + listallkeysjob_p.h protocol_p.h job_p.h \ + qgpgmeaddexistingsubkeyjob.h qgpgmeadduseridjob.h \ + qgpgmebackend.h qgpgmechangeexpiryjob.h \ + qgpgmechangeownertrustjob.h qgpgmechangepasswdjob.h \ + qgpgmedecryptjob.h qgpgmedecryptverifyarchivejob.h \ + qgpgmedecryptverifyjob.h qgpgmedeletejob.h qgpgmedownloadjob.h \ + qgpgmeencryptarchivejob.h qgpgmeencryptjob.h qgpgmeexportjob.h \ + qgpgmeimportfromkeyserverjob.h qgpgmeimportjob.h \ + qgpgmekeygenerationjob.h qgpgmekeylistjob.h \ + qgpgmelistallkeysjob.h qgpgmereceivekeysjob.h \ + qgpgmerefreshsmimekeysjob.h qgpgmerevokekeyjob.h \ + qgpgmesetprimaryuseridjob.h qgpgmesignarchivejob.h \ + qgpgmesignencryptjob.h qgpgmesignencryptarchivejob.h \ + qgpgmesignjob.h qgpgmesignkeyjob.h qgpgmeverifydetachedjob.h \ + qgpgmeverifyopaquejob.h qgpgmewkdlookupjob.h \ + qgpgmekeyformailboxjob.h qgpgmewkspublishjob.h \ + qgpgmetofupolicyjob.h qgpgmegpgcardjob.h qgpgmequickjob.h \ + signarchivejob_p.h signencryptjob_p.h \ + signencryptarchivejob_p.h threadedjobmixin.h util.h +am__objects_1 = dataprovider.lo debug.lo decryptverifyarchivejob.lo \ + encryptarchivejob.lo filelistdataprovider.lo job.lo \ + multideletejob.lo qgpgmeadduseridjob.lo \ + qgpgmeaddexistingsubkeyjob.lo qgpgmebackend.lo \ + qgpgmechangeexpiryjob.lo qgpgmechangeownertrustjob.lo \ + qgpgmechangepasswdjob.lo qgpgmedecryptjob.lo \ + qgpgmedecryptverifyarchivejob.lo qgpgmedecryptverifyjob.lo \ + qgpgmedeletejob.lo qgpgmedownloadjob.lo \ + qgpgmeencryptarchivejob.lo qgpgmeencryptjob.lo \ qgpgmeexportjob.lo qgpgmeimportfromkeyserverjob.lo \ qgpgmeimportjob.lo qgpgmekeygenerationjob.lo \ - qgpgmekeylistjob.lo qgpgmelistallkeysjob.lo \ + qgpgmekeylistjob.lo listallkeysjob.lo qgpgmelistallkeysjob.lo \ qgpgmenewcryptoconfig.lo qgpgmereceivekeysjob.lo \ - qgpgmerefreshkeysjob.lo qgpgmesignencryptjob.lo \ + qgpgmerefreshsmimekeysjob.lo qgpgmerevokekeyjob.lo \ + qgpgmesetprimaryuseridjob.lo qgpgmesignarchivejob.lo \ + qgpgmesignencryptjob.lo qgpgmesignencryptarchivejob.lo \ qgpgmesignjob.lo qgpgmesignkeyjob.lo \ qgpgmeverifydetachedjob.lo qgpgmeverifyopaquejob.lo \ qgpgmewkdlookupjob.lo threadedjobmixin.lo \ qgpgmekeyformailboxjob.lo qgpgme_debug.lo \ qgpgmetofupolicyjob.lo qgpgmequickjob.lo \ defaultkeygenerationjob.lo qgpgmewkspublishjob.lo \ - qgpgmegpgcardjob.lo changeexpiryjob.lo importjob.lo dn.lo \ - cryptoconfig.lo wkdlookupresult.lo util.lo + qgpgmegpgcardjob.lo changeexpiryjob.lo encryptjob.lo \ + importjob.lo signarchivejob.lo signencryptjob.lo \ + signencryptarchivejob.lo dn.lo cryptoconfig.lo \ + wkdlookupresult.lo util.lo am__objects_2 = -am_libqgpgme_la_OBJECTS = $(am__objects_1) $(am__objects_2) \ - $(am__objects_2) -nodist_libqgpgme_la_OBJECTS = $(am__objects_2) +@WANT_QT5_TRUE@am_libqgpgme_la_OBJECTS = $(am__objects_1) \ +@WANT_QT5_TRUE@ $(am__objects_2) $(am__objects_2) +@WANT_QT5_TRUE@nodist_libqgpgme_la_OBJECTS = $(am__objects_2) libqgpgme_la_OBJECTS = $(am_libqgpgme_la_OBJECTS) \ $(nodist_libqgpgme_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) @@ -177,6 +272,82 @@ libqgpgme_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(libqgpgme_la_LDFLAGS) $(LDFLAGS) -o $@ +@WANT_QT5_TRUE@am_libqgpgme_la_rpath = -rpath $(libdir) +@WANT_QT6_TRUE@libqgpgmeqt6_la_DEPENDENCIES = \ +@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT6_TRUE@ ../../../src/libgpgme.la +am__libqgpgmeqt6_la_SOURCES_DIST = dataprovider.cpp debug.cpp \ + decryptverifyarchivejob.cpp encryptarchivejob.cpp \ + filelistdataprovider.cpp job.cpp multideletejob.cpp \ + qgpgmeadduseridjob.cpp qgpgmeaddexistingsubkeyjob.cpp \ + qgpgmebackend.cpp qgpgmechangeexpiryjob.cpp \ + qgpgmechangeownertrustjob.cpp qgpgmechangepasswdjob.cpp \ + qgpgmedecryptjob.cpp qgpgmedecryptverifyarchivejob.cpp \ + qgpgmedecryptverifyjob.cpp qgpgmedeletejob.cpp \ + qgpgmedownloadjob.cpp qgpgmeencryptarchivejob.cpp \ + qgpgmeencryptjob.cpp qgpgmeexportjob.cpp \ + qgpgmeimportfromkeyserverjob.cpp qgpgmeimportjob.cpp \ + qgpgmekeygenerationjob.cpp qgpgmekeylistjob.cpp \ + listallkeysjob.cpp qgpgmelistallkeysjob.cpp \ + qgpgmenewcryptoconfig.cpp qgpgmereceivekeysjob.cpp \ + qgpgmerefreshsmimekeysjob.cpp qgpgmerevokekeyjob.cpp \ + qgpgmesetprimaryuseridjob.cpp qgpgmesignarchivejob.cpp \ + qgpgmesignencryptjob.cpp qgpgmesignencryptarchivejob.cpp \ + qgpgmesignjob.cpp qgpgmesignkeyjob.cpp \ + qgpgmeverifydetachedjob.cpp qgpgmeverifyopaquejob.cpp \ + qgpgmewkdlookupjob.cpp threadedjobmixin.cpp \ + qgpgmekeyformailboxjob.cpp qgpgme_debug.cpp \ + qgpgmetofupolicyjob.cpp qgpgmequickjob.cpp \ + defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \ + qgpgmegpgcardjob.cpp changeexpiryjob.cpp encryptjob.cpp \ + importjob.cpp signarchivejob.cpp signencryptjob.cpp \ + signencryptarchivejob.cpp dn.cpp cryptoconfig.cpp \ + wkdlookupresult.cpp util.cpp abstractimportjob.h \ + addexistingsubkeyjob.h adduseridjob.h changeexpiryjob.h \ + changeownertrustjob.h changepasswdjob.h dataprovider.h debug.h \ + decryptjob.h decryptverifyarchivejob.h decryptverifyjob.h \ + downloadjob.h encryptarchivejob.h encryptjob.h exportjob.h \ + filelistdataprovider.h hierarchicalkeylistjob.h job.h \ + keyformailboxjob.h multideletejob.h protocol.h qgpgme_export.h \ + qgpgmenewcryptoconfig.h quickjob.h receivekeysjob.h \ + revokekeyjob.h setprimaryuseridjob.h specialjob.h \ + signarchivejob.h signjob.h signkeyjob.h signencryptjob.h \ + signencryptarchivejob.h verifyopaquejob.h refreshkeysjob.h \ + cryptoconfig.h deletejob.h importfromkeyserverjob.h \ + importjob.h keygenerationjob.h keylistjob.h listallkeysjob.h \ + verifydetachedjob.h defaultkeygenerationjob.h tofupolicyjob.h \ + wkdlookupjob.h wkdlookupresult.h wkspublishjob.h gpgcardjob.h \ + dn.h changeexpiryjob_p.h decryptverifyarchivejob_p.h \ + encryptarchivejob_p.h encryptjob_p.h importjob_p.h \ + listallkeysjob_p.h protocol_p.h job_p.h \ + qgpgmeaddexistingsubkeyjob.h qgpgmeadduseridjob.h \ + qgpgmebackend.h qgpgmechangeexpiryjob.h \ + qgpgmechangeownertrustjob.h qgpgmechangepasswdjob.h \ + qgpgmedecryptjob.h qgpgmedecryptverifyarchivejob.h \ + qgpgmedecryptverifyjob.h qgpgmedeletejob.h qgpgmedownloadjob.h \ + qgpgmeencryptarchivejob.h qgpgmeencryptjob.h qgpgmeexportjob.h \ + qgpgmeimportfromkeyserverjob.h qgpgmeimportjob.h \ + qgpgmekeygenerationjob.h qgpgmekeylistjob.h \ + qgpgmelistallkeysjob.h qgpgmereceivekeysjob.h \ + qgpgmerefreshsmimekeysjob.h qgpgmerevokekeyjob.h \ + qgpgmesetprimaryuseridjob.h qgpgmesignarchivejob.h \ + qgpgmesignencryptjob.h qgpgmesignencryptarchivejob.h \ + qgpgmesignjob.h qgpgmesignkeyjob.h qgpgmeverifydetachedjob.h \ + qgpgmeverifyopaquejob.h qgpgmewkdlookupjob.h \ + qgpgmekeyformailboxjob.h qgpgmewkspublishjob.h \ + qgpgmetofupolicyjob.h qgpgmegpgcardjob.h qgpgmequickjob.h \ + signarchivejob_p.h signencryptjob_p.h \ + signencryptarchivejob_p.h threadedjobmixin.h util.h +@WANT_QT6_TRUE@am_libqgpgmeqt6_la_OBJECTS = $(am__objects_1) \ +@WANT_QT6_TRUE@ $(am__objects_2) $(am__objects_2) +@WANT_QT6_TRUE@nodist_libqgpgmeqt6_la_OBJECTS = $(am__objects_2) +libqgpgmeqt6_la_OBJECTS = $(am_libqgpgmeqt6_la_OBJECTS) \ + $(nodist_libqgpgmeqt6_la_OBJECTS) +libqgpgmeqt6_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \ + $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CXXLD) \ + $(AM_CXXFLAGS) $(CXXFLAGS) $(libqgpgmeqt6_la_LDFLAGS) \ + $(LDFLAGS) -o $@ +@WANT_QT6_TRUE@am_libqgpgmeqt6_la_rpath = -rpath $(libdir) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -194,10 +365,12 @@ am__maybe_remake_depfiles = depfiles am__depfiles_remade = ./$(DEPDIR)/changeexpiryjob.Plo \ ./$(DEPDIR)/cryptoconfig.Plo ./$(DEPDIR)/dataprovider.Plo \ - ./$(DEPDIR)/debug.Plo ./$(DEPDIR)/defaultkeygenerationjob.Plo \ - ./$(DEPDIR)/dn.Plo ./$(DEPDIR)/importjob.Plo \ - ./$(DEPDIR)/job.Plo ./$(DEPDIR)/multideletejob.Plo \ - ./$(DEPDIR)/qgpgme_debug.Plo \ + ./$(DEPDIR)/debug.Plo ./$(DEPDIR)/decryptverifyarchivejob.Plo \ + ./$(DEPDIR)/defaultkeygenerationjob.Plo ./$(DEPDIR)/dn.Plo \ + ./$(DEPDIR)/encryptarchivejob.Plo ./$(DEPDIR)/encryptjob.Plo \ + ./$(DEPDIR)/filelistdataprovider.Plo ./$(DEPDIR)/importjob.Plo \ + ./$(DEPDIR)/job.Plo ./$(DEPDIR)/listallkeysjob.Plo \ + ./$(DEPDIR)/multideletejob.Plo ./$(DEPDIR)/qgpgme_debug.Plo \ ./$(DEPDIR)/qgpgmeaddexistingsubkeyjob.Plo \ ./$(DEPDIR)/qgpgmeadduseridjob.Plo \ ./$(DEPDIR)/qgpgmebackend.Plo \ @@ -205,9 +378,11 @@ ./$(DEPDIR)/qgpgmechangeownertrustjob.Plo \ ./$(DEPDIR)/qgpgmechangepasswdjob.Plo \ ./$(DEPDIR)/qgpgmedecryptjob.Plo \ + ./$(DEPDIR)/qgpgmedecryptverifyarchivejob.Plo \ ./$(DEPDIR)/qgpgmedecryptverifyjob.Plo \ ./$(DEPDIR)/qgpgmedeletejob.Plo \ ./$(DEPDIR)/qgpgmedownloadjob.Plo \ + ./$(DEPDIR)/qgpgmeencryptarchivejob.Plo \ ./$(DEPDIR)/qgpgmeencryptjob.Plo \ ./$(DEPDIR)/qgpgmeexportjob.Plo \ ./$(DEPDIR)/qgpgmegpgcardjob.Plo \ @@ -220,7 +395,11 @@ ./$(DEPDIR)/qgpgmenewcryptoconfig.Plo \ ./$(DEPDIR)/qgpgmequickjob.Plo \ ./$(DEPDIR)/qgpgmereceivekeysjob.Plo \ - ./$(DEPDIR)/qgpgmerefreshkeysjob.Plo \ + ./$(DEPDIR)/qgpgmerefreshsmimekeysjob.Plo \ + ./$(DEPDIR)/qgpgmerevokekeyjob.Plo \ + ./$(DEPDIR)/qgpgmesetprimaryuseridjob.Plo \ + ./$(DEPDIR)/qgpgmesignarchivejob.Plo \ + ./$(DEPDIR)/qgpgmesignencryptarchivejob.Plo \ ./$(DEPDIR)/qgpgmesignencryptjob.Plo \ ./$(DEPDIR)/qgpgmesignjob.Plo ./$(DEPDIR)/qgpgmesignkeyjob.Plo \ ./$(DEPDIR)/qgpgmetofupolicyjob.Plo \ @@ -228,6 +407,9 @@ ./$(DEPDIR)/qgpgmeverifyopaquejob.Plo \ ./$(DEPDIR)/qgpgmewkdlookupjob.Plo \ ./$(DEPDIR)/qgpgmewkspublishjob.Plo \ + ./$(DEPDIR)/signarchivejob.Plo \ + ./$(DEPDIR)/signencryptarchivejob.Plo \ + ./$(DEPDIR)/signencryptjob.Plo \ ./$(DEPDIR)/threadedjobmixin.Plo ./$(DEPDIR)/util.Plo \ ./$(DEPDIR)/wkdlookupresult.Plo am__mv = mv -f @@ -267,8 +449,10 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(libqgpgme_la_SOURCES) $(nodist_libqgpgme_la_SOURCES) -DIST_SOURCES = $(libqgpgme_la_SOURCES) +SOURCES = $(libqgpgme_la_SOURCES) $(nodist_libqgpgme_la_SOURCES) \ + $(libqgpgmeqt6_la_SOURCES) $(nodist_libqgpgmeqt6_la_SOURCES) +DIST_SOURCES = $(am__libqgpgme_la_SOURCES_DIST) \ + $(am__libqgpgmeqt6_la_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -299,6 +483,9 @@ $(srcdir)/QGpgmeConfig-w32.cmake.in.in \ $(srcdir)/QGpgmeConfig.cmake.in.in \ $(srcdir)/QGpgmeConfigVersion.cmake.in \ + $(srcdir)/QGpgmeQt6Config-w32.cmake.in.in \ + $(srcdir)/QGpgmeQt6Config.cmake.in.in \ + $(srcdir)/QGpgmeQt6ConfigVersion.cmake.in \ $(srcdir)/qgpgme_version.h.in $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/mkinstalldirs DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) @@ -351,10 +538,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -364,6 +556,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -500,52 +693,45 @@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ - -# Makefile.am for GPGMEPP. -# Copyright (C) 2016 Bundesamt für Sicherheit in der Informationstechnik -# Software engineering by Intevation GmbH -# -# This file is part of GPGMEPP. -# -# GPGME-CL is free software; you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# GPGME-CL 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 General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA -# 02111-1307, USA -lib_LTLIBRARIES = libqgpgme.la +@WANT_QT5_TRUE@lib_LTLIBRARIES = libqgpgme.la +@WANT_QT6_TRUE@lib_LTLIBRARIES = libqgpgmeqt6.la EXTRA_DIST = QGpgmeConfig.cmake.in.in QGpgmeConfigVersion.cmake.in \ qgpgme_debug.h qgpgme_version.h.in \ - QGpgmeConfig.cmake.in.in + QGpgmeConfig-w32.cmake.in.in QGpgmeQt6Config.cmake.in.in \ + QGpgmeQt6Config-w32.cmake.in.in QGpgmeQt6ConfigVersion.cmake.in qgpgme_sources = \ dataprovider.cpp \ debug.cpp \ + decryptverifyarchivejob.cpp \ + encryptarchivejob.cpp \ + filelistdataprovider.cpp \ job.cpp multideletejob.cpp qgpgmeadduseridjob.cpp \ qgpgmeaddexistingsubkeyjob.cpp \ qgpgmebackend.cpp qgpgmechangeexpiryjob.cpp qgpgmechangeownertrustjob.cpp \ qgpgmechangepasswdjob.cpp qgpgmedecryptjob.cpp \ + qgpgmedecryptverifyarchivejob.cpp \ qgpgmedecryptverifyjob.cpp qgpgmedeletejob.cpp qgpgmedownloadjob.cpp \ + qgpgmeencryptarchivejob.cpp \ qgpgmeencryptjob.cpp qgpgmeexportjob.cpp qgpgmeimportfromkeyserverjob.cpp \ qgpgmeimportjob.cpp qgpgmekeygenerationjob.cpp qgpgmekeylistjob.cpp \ - qgpgmelistallkeysjob.cpp qgpgmenewcryptoconfig.cpp \ + listallkeysjob.cpp qgpgmelistallkeysjob.cpp qgpgmenewcryptoconfig.cpp \ qgpgmereceivekeysjob.cpp \ - qgpgmerefreshkeysjob.cpp \ + qgpgmerefreshsmimekeysjob.cpp \ + qgpgmerevokekeyjob.cpp \ + qgpgmesetprimaryuseridjob.cpp \ + qgpgmesignarchivejob.cpp \ qgpgmesignencryptjob.cpp \ + qgpgmesignencryptarchivejob.cpp \ qgpgmesignjob.cpp qgpgmesignkeyjob.cpp qgpgmeverifydetachedjob.cpp \ qgpgmeverifyopaquejob.cpp qgpgmewkdlookupjob.cpp threadedjobmixin.cpp \ qgpgmekeyformailboxjob.cpp qgpgme_debug.cpp \ qgpgmetofupolicyjob.cpp qgpgmequickjob.cpp \ defaultkeygenerationjob.cpp qgpgmewkspublishjob.cpp \ - qgpgmegpgcardjob.cpp changeexpiryjob.cpp importjob.cpp \ + qgpgmegpgcardjob.cpp changeexpiryjob.cpp encryptjob.cpp importjob.cpp \ + signarchivejob.cpp \ + signencryptjob.cpp \ + signencryptarchivejob.cpp \ dn.cpp cryptoconfig.cpp wkdlookupresult.cpp \ util.cpp @@ -561,10 +747,13 @@ dataprovider.h \ debug.h \ decryptjob.h \ + decryptverifyarchivejob.h \ decryptverifyjob.h \ downloadjob.h \ + encryptarchivejob.h \ encryptjob.h \ exportjob.h \ + filelistdataprovider.h \ hierarchicalkeylistjob.h \ job.h \ keyformailboxjob.h \ @@ -574,10 +763,14 @@ qgpgmenewcryptoconfig.h \ quickjob.h \ receivekeysjob.h \ + revokekeyjob.h \ + setprimaryuseridjob.h \ specialjob.h \ + signarchivejob.h \ signjob.h \ signkeyjob.h \ signencryptjob.h \ + signencryptarchivejob.h \ verifyopaquejob.h \ refreshkeysjob.h \ cryptoconfig.h \ @@ -606,11 +799,14 @@ DataProvider \ Debug \ DecryptJob \ + DecryptVerifyArchiveJob \ DecryptVerifyJob \ DN \ DownloadJob \ + EncryptArchiveJob \ EncryptJob \ ExportJob \ + FileListDataProvider \ HierarchicalKeyKistJob \ Job \ MultiDeleteJob \ @@ -618,9 +814,13 @@ QGpgMENewCryptoConfig \ QuickJob \ ReceiveKeysJob \ + RevokeKeyJob \ + SetPrimaryUserIDJob \ SpecialJob \ + SignArchiveJob \ SignJob \ SignKeyJob \ + SignEncryptArchiveJob \ SignEncryptJob \ VerifyOpaqueJob \ RefreshKeysJob \ @@ -641,6 +841,12 @@ GpgCardJob private_qgpgme_headers = \ + changeexpiryjob_p.h \ + decryptverifyarchivejob_p.h \ + encryptarchivejob_p.h \ + encryptjob_p.h \ + importjob_p.h \ + listallkeysjob_p.h \ qgpgme_export.h \ protocol_p.h \ job_p.h \ @@ -651,9 +857,11 @@ qgpgmechangeownertrustjob.h \ qgpgmechangepasswdjob.h \ qgpgmedecryptjob.h \ + qgpgmedecryptverifyarchivejob.h \ qgpgmedecryptverifyjob.h \ qgpgmedeletejob.h \ qgpgmedownloadjob.h \ + qgpgmeencryptarchivejob.h \ qgpgmeencryptjob.h \ qgpgmeexportjob.h \ qgpgmeimportfromkeyserverjob.h \ @@ -662,8 +870,12 @@ qgpgmekeylistjob.h \ qgpgmelistallkeysjob.h \ qgpgmereceivekeysjob.h \ - qgpgmerefreshkeysjob.h \ + qgpgmerefreshsmimekeysjob.h \ + qgpgmerevokekeyjob.h \ + qgpgmesetprimaryuseridjob.h \ + qgpgmesignarchivejob.h \ qgpgmesignencryptjob.h \ + qgpgmesignencryptarchivejob.h \ qgpgmesignjob.h \ qgpgmesignkeyjob.h \ qgpgmeverifydetachedjob.h \ @@ -674,6 +886,9 @@ qgpgmetofupolicyjob.h \ qgpgmegpgcardjob.h \ qgpgmequickjob.h \ + signarchivejob_p.h \ + signencryptjob_p.h \ + signencryptarchivejob_p.h \ threadedjobmixin.h \ util.h @@ -685,9 +900,11 @@ changeownertrustjob.moc \ changepasswdjob.moc \ decryptjob.moc \ + decryptverifyarchivejob.moc \ decryptverifyjob.moc \ deletejob.moc \ downloadjob.moc \ + encryptarchivejob.moc \ encryptjob.moc \ exportjob.moc \ hierarchicalkeylistjob.moc \ @@ -704,9 +921,11 @@ qgpgmechangeownertrustjob.moc \ qgpgmechangepasswdjob.moc \ qgpgmedecryptjob.moc \ + qgpgmedecryptverifyarchivejob.moc \ qgpgmedecryptverifyjob.moc \ qgpgmedeletejob.moc \ qgpgmedownloadjob.moc \ + qgpgmeencryptarchivejob.moc \ qgpgmeencryptjob.moc \ qgpgmeexportjob.moc \ qgpgmeimportfromkeyserverjob.moc \ @@ -715,8 +934,12 @@ qgpgmekeylistjob.moc \ qgpgmelistallkeysjob.moc \ qgpgmereceivekeysjob.moc \ - qgpgmerefreshkeysjob.moc \ + qgpgmerefreshsmimekeysjob.moc \ + qgpgmerevokekeyjob.moc \ + qgpgmesetprimaryuseridjob.moc \ + qgpgmesignarchivejob.moc \ qgpgmesignencryptjob.moc \ + qgpgmesignencryptarchivejob.moc \ qgpgmesignjob.moc \ qgpgmesignkeyjob.moc \ qgpgmeverifydetachedjob.moc \ @@ -727,7 +950,11 @@ qgpgmetofupolicyjob.moc \ receivekeysjob.moc \ refreshkeysjob.moc \ + revokekeyjob.moc \ + setprimaryuseridjob.moc \ + signarchivejob.moc \ signencryptjob.moc \ + signencryptarchivejob.moc \ signjob.moc \ signkeyjob.moc \ specialjob.moc \ @@ -748,26 +975,41 @@ camelcaseincludedir = $(includedir)/QGpgME camelcaseinclude_HEADERS = $(camelcase_headers) nodist_qgpgmeinclude_HEADERS = qgpgme_version.h -libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) -AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ - @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ - -DBUILDING_QGPGME -Wsuggest-override \ - -Wzero-as-null-pointer-constant +@WANT_QT5_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ +@WANT_QT5_TRUE@ @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ +@WANT_QT5_TRUE@ -DBUILDING_QGPGME -Wsuggest-override \ +@WANT_QT5_TRUE@ -Wzero-as-null-pointer-constant + +@WANT_QT6_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ +@WANT_QT6_TRUE@ @GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \ +@WANT_QT6_TRUE@ -DBUILDING_QGPGME -Wsuggest-override \ +@WANT_QT6_TRUE@ -Wzero-as-null-pointer-constant -libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \ - @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT_LIBS@ +@WANT_QT5_TRUE@libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) +@WANT_QT5_TRUE@libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \ +@WANT_QT5_TRUE@ @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT5_LIBS@ -libqgpgme_la_LDFLAGS = -no-undefined -version-info \ - @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ +@WANT_QT5_TRUE@libqgpgme_la_LDFLAGS = -no-undefined -version-info \ +@WANT_QT5_TRUE@ @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ + +@WANT_QT6_TRUE@libqgpgmeqt6_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers) +@WANT_QT6_TRUE@libqgpgmeqt6_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \ +@WANT_QT6_TRUE@ @LIBASSUAN_LIBS@ @GPG_ERROR_LIBS@ @GPGME_QT6_LIBS@ + +@WANT_QT6_TRUE@libqgpgmeqt6_la_LDFLAGS = -no-undefined -version-info \ +@WANT_QT6_TRUE@ @LIBQGPGME_LT_CURRENT@:@LIBQGPGME_LT_REVISION@:@LIBQGPGME_LT_AGE@ @HAVE_MACOS_SYSTEM_FALSE@libsuffix = .so @HAVE_MACOS_SYSTEM_TRUE@libsuffix = .dylib BUILT_SOURCES = $(qgpgme_moc_sources) $(camelcase_headers) CLEANFILES = $(qgpgme_moc_sources) $(camelcase_headers) QGpgmeConfig.cmake \ qgpgme_version.h QGpgmeConfig.cmake.in \ - QGpgmeConfigVersion.cmake + QGpgmeConfig-w32.cmake.in QGpgmeConfigVersion.cmake \ + QGpgmeQt6Config.cmake.in QGpgmeQt6Config-w32.cmake.in \ + QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake -nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources) +@WANT_QT5_TRUE@nodist_libqgpgme_la_SOURCES = $(qgpgme_moc_sources) +@WANT_QT6_TRUE@nodist_libqgpgmeqt6_la_SOURCES = $(qgpgme_moc_sources) all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am @@ -808,6 +1050,12 @@ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ QGpgmeConfigVersion.cmake: $(top_builddir)/config.status $(srcdir)/QGpgmeConfigVersion.cmake.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +QGpgmeQt6Config-w32.cmake.in: $(top_builddir)/config.status $(srcdir)/QGpgmeQt6Config-w32.cmake.in.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +QGpgmeQt6Config.cmake.in: $(top_builddir)/config.status $(srcdir)/QGpgmeQt6Config.cmake.in.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ +QGpgmeQt6ConfigVersion.cmake: $(top_builddir)/config.status $(srcdir)/QGpgmeQt6ConfigVersion.cmake.in + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ qgpgme_version.h: $(top_builddir)/config.status $(srcdir)/qgpgme_version.h.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ @@ -847,7 +1095,10 @@ } libqgpgme.la: $(libqgpgme_la_OBJECTS) $(libqgpgme_la_DEPENDENCIES) $(EXTRA_libqgpgme_la_DEPENDENCIES) - $(AM_V_CXXLD)$(libqgpgme_la_LINK) -rpath $(libdir) $(libqgpgme_la_OBJECTS) $(libqgpgme_la_LIBADD) $(LIBS) + $(AM_V_CXXLD)$(libqgpgme_la_LINK) $(am_libqgpgme_la_rpath) $(libqgpgme_la_OBJECTS) $(libqgpgme_la_LIBADD) $(LIBS) + +libqgpgmeqt6.la: $(libqgpgmeqt6_la_OBJECTS) $(libqgpgmeqt6_la_DEPENDENCIES) $(EXTRA_libqgpgmeqt6_la_DEPENDENCIES) + $(AM_V_CXXLD)$(libqgpgmeqt6_la_LINK) $(am_libqgpgmeqt6_la_rpath) $(libqgpgmeqt6_la_OBJECTS) $(libqgpgmeqt6_la_LIBADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) @@ -859,10 +1110,15 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cryptoconfig.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dataprovider.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decryptverifyarchivejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/defaultkeygenerationjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dn.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encryptarchivejob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/encryptjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/filelistdataprovider.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/importjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/job.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listallkeysjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/multideletejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgme_debug.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmeaddexistingsubkeyjob.Plo@am__quote@ # am--include-marker @@ -872,9 +1128,11 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmechangeownertrustjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmechangepasswdjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmedecryptjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmedecryptverifyarchivejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmedecryptverifyjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmedeletejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmedownloadjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmeencryptarchivejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmeencryptjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmeexportjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmegpgcardjob.Plo@am__quote@ # am--include-marker @@ -887,7 +1145,11 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmenewcryptoconfig.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmequickjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmereceivekeysjob.Plo@am__quote@ # am--include-marker -@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmerefreshkeysjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmerefreshsmimekeysjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmerevokekeyjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesetprimaryuseridjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesignarchivejob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesignencryptarchivejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesignencryptjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesignjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmesignkeyjob.Plo@am__quote@ # am--include-marker @@ -896,6 +1158,9 @@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmeverifyopaquejob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmewkdlookupjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/qgpgmewkspublishjob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signarchivejob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signencryptarchivejob.Plo@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signencryptjob.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/threadedjobmixin.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/util.Plo@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/wkdlookupresult.Plo@am__quote@ # am--include-marker @@ -1133,10 +1398,15 @@ -rm -f ./$(DEPDIR)/cryptoconfig.Plo -rm -f ./$(DEPDIR)/dataprovider.Plo -rm -f ./$(DEPDIR)/debug.Plo + -rm -f ./$(DEPDIR)/decryptverifyarchivejob.Plo -rm -f ./$(DEPDIR)/defaultkeygenerationjob.Plo -rm -f ./$(DEPDIR)/dn.Plo + -rm -f ./$(DEPDIR)/encryptarchivejob.Plo + -rm -f ./$(DEPDIR)/encryptjob.Plo + -rm -f ./$(DEPDIR)/filelistdataprovider.Plo -rm -f ./$(DEPDIR)/importjob.Plo -rm -f ./$(DEPDIR)/job.Plo + -rm -f ./$(DEPDIR)/listallkeysjob.Plo -rm -f ./$(DEPDIR)/multideletejob.Plo -rm -f ./$(DEPDIR)/qgpgme_debug.Plo -rm -f ./$(DEPDIR)/qgpgmeaddexistingsubkeyjob.Plo @@ -1146,9 +1416,11 @@ -rm -f ./$(DEPDIR)/qgpgmechangeownertrustjob.Plo -rm -f ./$(DEPDIR)/qgpgmechangepasswdjob.Plo -rm -f ./$(DEPDIR)/qgpgmedecryptjob.Plo + -rm -f ./$(DEPDIR)/qgpgmedecryptverifyarchivejob.Plo -rm -f ./$(DEPDIR)/qgpgmedecryptverifyjob.Plo -rm -f ./$(DEPDIR)/qgpgmedeletejob.Plo -rm -f ./$(DEPDIR)/qgpgmedownloadjob.Plo + -rm -f ./$(DEPDIR)/qgpgmeencryptarchivejob.Plo -rm -f ./$(DEPDIR)/qgpgmeencryptjob.Plo -rm -f ./$(DEPDIR)/qgpgmeexportjob.Plo -rm -f ./$(DEPDIR)/qgpgmegpgcardjob.Plo @@ -1161,7 +1433,11 @@ -rm -f ./$(DEPDIR)/qgpgmenewcryptoconfig.Plo -rm -f ./$(DEPDIR)/qgpgmequickjob.Plo -rm -f ./$(DEPDIR)/qgpgmereceivekeysjob.Plo - -rm -f ./$(DEPDIR)/qgpgmerefreshkeysjob.Plo + -rm -f ./$(DEPDIR)/qgpgmerefreshsmimekeysjob.Plo + -rm -f ./$(DEPDIR)/qgpgmerevokekeyjob.Plo + -rm -f ./$(DEPDIR)/qgpgmesetprimaryuseridjob.Plo + -rm -f ./$(DEPDIR)/qgpgmesignarchivejob.Plo + -rm -f ./$(DEPDIR)/qgpgmesignencryptarchivejob.Plo -rm -f ./$(DEPDIR)/qgpgmesignencryptjob.Plo -rm -f ./$(DEPDIR)/qgpgmesignjob.Plo -rm -f ./$(DEPDIR)/qgpgmesignkeyjob.Plo @@ -1170,6 +1446,9 @@ -rm -f ./$(DEPDIR)/qgpgmeverifyopaquejob.Plo -rm -f ./$(DEPDIR)/qgpgmewkdlookupjob.Plo -rm -f ./$(DEPDIR)/qgpgmewkspublishjob.Plo + -rm -f ./$(DEPDIR)/signarchivejob.Plo + -rm -f ./$(DEPDIR)/signencryptarchivejob.Plo + -rm -f ./$(DEPDIR)/signencryptjob.Plo -rm -f ./$(DEPDIR)/threadedjobmixin.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f ./$(DEPDIR)/wkdlookupresult.Plo @@ -1224,10 +1503,15 @@ -rm -f ./$(DEPDIR)/cryptoconfig.Plo -rm -f ./$(DEPDIR)/dataprovider.Plo -rm -f ./$(DEPDIR)/debug.Plo + -rm -f ./$(DEPDIR)/decryptverifyarchivejob.Plo -rm -f ./$(DEPDIR)/defaultkeygenerationjob.Plo -rm -f ./$(DEPDIR)/dn.Plo + -rm -f ./$(DEPDIR)/encryptarchivejob.Plo + -rm -f ./$(DEPDIR)/encryptjob.Plo + -rm -f ./$(DEPDIR)/filelistdataprovider.Plo -rm -f ./$(DEPDIR)/importjob.Plo -rm -f ./$(DEPDIR)/job.Plo + -rm -f ./$(DEPDIR)/listallkeysjob.Plo -rm -f ./$(DEPDIR)/multideletejob.Plo -rm -f ./$(DEPDIR)/qgpgme_debug.Plo -rm -f ./$(DEPDIR)/qgpgmeaddexistingsubkeyjob.Plo @@ -1237,9 +1521,11 @@ -rm -f ./$(DEPDIR)/qgpgmechangeownertrustjob.Plo -rm -f ./$(DEPDIR)/qgpgmechangepasswdjob.Plo -rm -f ./$(DEPDIR)/qgpgmedecryptjob.Plo + -rm -f ./$(DEPDIR)/qgpgmedecryptverifyarchivejob.Plo -rm -f ./$(DEPDIR)/qgpgmedecryptverifyjob.Plo -rm -f ./$(DEPDIR)/qgpgmedeletejob.Plo -rm -f ./$(DEPDIR)/qgpgmedownloadjob.Plo + -rm -f ./$(DEPDIR)/qgpgmeencryptarchivejob.Plo -rm -f ./$(DEPDIR)/qgpgmeencryptjob.Plo -rm -f ./$(DEPDIR)/qgpgmeexportjob.Plo -rm -f ./$(DEPDIR)/qgpgmegpgcardjob.Plo @@ -1252,7 +1538,11 @@ -rm -f ./$(DEPDIR)/qgpgmenewcryptoconfig.Plo -rm -f ./$(DEPDIR)/qgpgmequickjob.Plo -rm -f ./$(DEPDIR)/qgpgmereceivekeysjob.Plo - -rm -f ./$(DEPDIR)/qgpgmerefreshkeysjob.Plo + -rm -f ./$(DEPDIR)/qgpgmerefreshsmimekeysjob.Plo + -rm -f ./$(DEPDIR)/qgpgmerevokekeyjob.Plo + -rm -f ./$(DEPDIR)/qgpgmesetprimaryuseridjob.Plo + -rm -f ./$(DEPDIR)/qgpgmesignarchivejob.Plo + -rm -f ./$(DEPDIR)/qgpgmesignencryptarchivejob.Plo -rm -f ./$(DEPDIR)/qgpgmesignencryptjob.Plo -rm -f ./$(DEPDIR)/qgpgmesignjob.Plo -rm -f ./$(DEPDIR)/qgpgmesignkeyjob.Plo @@ -1261,6 +1551,9 @@ -rm -f ./$(DEPDIR)/qgpgmeverifyopaquejob.Plo -rm -f ./$(DEPDIR)/qgpgmewkdlookupjob.Plo -rm -f ./$(DEPDIR)/qgpgmewkspublishjob.Plo + -rm -f ./$(DEPDIR)/signarchivejob.Plo + -rm -f ./$(DEPDIR)/signencryptarchivejob.Plo + -rm -f ./$(DEPDIR)/signencryptjob.Plo -rm -f ./$(DEPDIR)/threadedjobmixin.Plo -rm -f ./$(DEPDIR)/util.Plo -rm -f ./$(DEPDIR)/wkdlookupresult.Plo @@ -1309,31 +1602,50 @@ .PRECIOUS: Makefile -@HAVE_W32_SYSTEM_TRUE@QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in -@HAVE_W32_SYSTEM_TRUE@ sed -e 's|@resolved_bindir@|$(bindir)|g' < "$<" | \ -@HAVE_W32_SYSTEM_TRUE@ sed -e 's|@resolved_libdir@|$(libdir)|g' | \ -@HAVE_W32_SYSTEM_TRUE@ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ -@HAVE_W32_SYSTEM_FALSE@QGpgmeConfig.cmake: QGpgmeConfig.cmake.in -@HAVE_W32_SYSTEM_FALSE@ sed -e 's|@resolved_libdir@|$(libdir)|g' < "$<" | \ -@HAVE_W32_SYSTEM_FALSE@ sed -e 's|@libsuffix@|$(libsuffix)|g' | \ -@HAVE_W32_SYSTEM_FALSE@ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ +@HAVE_W32_SYSTEM_TRUE@@WANT_QT5_TRUE@QGpgmeConfig.cmake: QGpgmeConfig-w32.cmake.in +@HAVE_W32_SYSTEM_TRUE@@WANT_QT5_TRUE@ sed -e 's|@resolved_bindir@|$(bindir)|g' < "$<" | \ +@HAVE_W32_SYSTEM_TRUE@@WANT_QT5_TRUE@ sed -e 's|@resolved_libdir@|$(libdir)|g' | \ +@HAVE_W32_SYSTEM_TRUE@@WANT_QT5_TRUE@ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ +@HAVE_W32_SYSTEM_FALSE@@WANT_QT5_TRUE@QGpgmeConfig.cmake: QGpgmeConfig.cmake.in +@HAVE_W32_SYSTEM_FALSE@@WANT_QT5_TRUE@ sed -e 's|@resolved_libdir@|$(libdir)|g' < "$<" | \ +@HAVE_W32_SYSTEM_FALSE@@WANT_QT5_TRUE@ sed -e 's|@libsuffix@|$(libsuffix)|g' | \ +@HAVE_W32_SYSTEM_FALSE@@WANT_QT5_TRUE@ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ +@HAVE_W32_SYSTEM_TRUE@@WANT_QT6_TRUE@QGpgmeQt6Config.cmake: QGpgmeQt6Config-w32.cmake.in +@HAVE_W32_SYSTEM_TRUE@@WANT_QT6_TRUE@ sed -e 's|@resolved_bindir@|$(bindir)|g' < "$<" | \ +@HAVE_W32_SYSTEM_TRUE@@WANT_QT6_TRUE@ sed -e 's|@resolved_libdir@|$(libdir)|g' | \ +@HAVE_W32_SYSTEM_TRUE@@WANT_QT6_TRUE@ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ +@HAVE_W32_SYSTEM_FALSE@@WANT_QT6_TRUE@QGpgmeQt6Config.cmake: QGpgmeQt6Config.cmake.in +@HAVE_W32_SYSTEM_FALSE@@WANT_QT6_TRUE@ sed -e 's|@resolved_libdir@|$(libdir)|g' < "$<" | \ +@HAVE_W32_SYSTEM_FALSE@@WANT_QT6_TRUE@ sed -e 's|@libsuffix@|$(libsuffix)|g' | \ +@HAVE_W32_SYSTEM_FALSE@@WANT_QT6_TRUE@ sed -e 's|@resolved_includedir@|$(includedir)|g' > $@ $(camelcase_headers): Makefile.am echo -n "#include \"qgpgme/" > "$@" echo -n "$@" | tr ':upper:' ':lower:' >> "$@" echo ".h\"" >> "$@" -install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake - -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme - $(INSTALL) -m 644 QGpgmeConfig.cmake \ - $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake - $(INSTALL) -m 644 QGpgmeConfigVersion.cmake \ - $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake - -uninstall-cmake-files: - -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake - -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake - -rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/ +@WANT_QT5_TRUE@install-cmake-files: QGpgmeConfig.cmake QGpgmeConfigVersion.cmake +@WANT_QT5_TRUE@ -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgme +@WANT_QT5_TRUE@ $(INSTALL) -m 644 QGpgmeConfig.cmake \ +@WANT_QT5_TRUE@ $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake +@WANT_QT5_TRUE@ $(INSTALL) -m 644 QGpgmeConfigVersion.cmake \ +@WANT_QT5_TRUE@ $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake + +@WANT_QT5_TRUE@uninstall-cmake-files: +@WANT_QT5_TRUE@ -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfigVersion.cmake +@WANT_QT5_TRUE@ -rm $(DESTDIR)$(libdir)/cmake/QGpgme/QGpgmeConfig.cmake +@WANT_QT5_TRUE@ -rmdir $(DESTDIR)$(libdir)/cmake/QGpgme/ +@WANT_QT6_TRUE@install-cmake-files: QGpgmeQt6Config.cmake QGpgmeQt6ConfigVersion.cmake +@WANT_QT6_TRUE@ -$(INSTALL) -d $(DESTDIR)$(libdir)/cmake/QGpgmeQt6 +@WANT_QT6_TRUE@ $(INSTALL) -m 644 QGpgmeQt6Config.cmake \ +@WANT_QT6_TRUE@ $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake +@WANT_QT6_TRUE@ $(INSTALL) -m 644 QGpgmeQt6ConfigVersion.cmake \ +@WANT_QT6_TRUE@ $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake + +@WANT_QT6_TRUE@uninstall-cmake-files: +@WANT_QT6_TRUE@ -rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6ConfigVersion.cmake +@WANT_QT6_TRUE@ -rm $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/QGpgmeQt6Config.cmake +@WANT_QT6_TRUE@ -rmdir $(DESTDIR)$(libdir)/cmake/QGpgmeQt6/ install-data-local: install-cmake-files
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/QGpgmeQt6Config-w32.cmake.in.in
Added
@@ -0,0 +1,105 @@ +# CMake Config file for QGpgME for Qt 6 +# Copyright (C) 2016 Intevation GmbH +# +# This file is part of GPGME. +# +# QGpgME is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# QGpgME 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 General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA + +# based on a generated file from cmake. +# Generated by CMake 3.0.2 + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget QGpgmeQt6) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + +# Create imported target QGpgmeQt6 +add_library(QGpgmeQt6 SHARED IMPORTED) + +set_target_properties(QGpgmeQt6 PROPERTIES + IMPORTED_IMPLIB_RELEASE "@resolved_libdir@/libqgpgmeqt6.dll.a" + INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@" + INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt6::Core" + IMPORTED_LOCATION "@resolved_libdir@/libqgpgmeqt6-7.dll" +) + +list(APPEND _IMPORT_CHECK_TARGETS QGpgmeQt6 ) +list(APPEND _IMPORT_CHECK_FILES_FOR_QGpgmeQt6 "@resolved_libdir@/libqgpgmeqt6.dll.a" "@resolved_bindir@/libqgpgmeqt6-7.dll" ) + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") +endif() + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) + +# Gpgmepp is a requirement for QGpgME +find_package(Gpgmepp CONFIG REQUIRED)
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/QGpgmeQt6Config.cmake.in.in
Added
@@ -0,0 +1,101 @@ +# CMake Config file for QGpgME for Qt 6 +# Copyright (C) 2016 Intevation GmbH +# +# This file is part of GPGME. +# +# QGpgME is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# QGpgME 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 General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA + +# based on a generated file from cmake. +# Generated by CMake 3.0.2 + +if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5) + message(FATAL_ERROR "CMake >= 2.6.0 required") +endif() +cmake_policy(PUSH) +cmake_policy(VERSION 2.6) +#---------------------------------------------------------------- +# Generated CMake target import file. +#---------------------------------------------------------------- + +# Commands may need to know the format version. +set(CMAKE_IMPORT_FILE_VERSION 1) + +# Protect against multiple inclusion, which would fail when already imported targets are added once more. +set(_targetsDefined) +set(_targetsNotDefined) +set(_expectedTargets) +foreach(_expectedTarget QGpgmeQt6) + list(APPEND _expectedTargets ${_expectedTarget}) + if(NOT TARGET ${_expectedTarget}) + list(APPEND _targetsNotDefined ${_expectedTarget}) + endif() + if(TARGET ${_expectedTarget}) + list(APPEND _targetsDefined ${_expectedTarget}) + endif() +endforeach() +if("${_targetsDefined}" STREQUAL "${_expectedTargets}") + set(CMAKE_IMPORT_FILE_VERSION) + cmake_policy(POP) + return() +endif() +if(NOT "${_targetsDefined}" STREQUAL "") + message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_targetsDefined}\nTargets not yet defined: ${_targetsNotDefined}\n") +endif() +unset(_targetsDefined) +unset(_targetsNotDefined) +unset(_expectedTargets) + +# Create imported target QGpgmeQt6 +add_library(QGpgmeQt6 SHARED IMPORTED) + +set_target_properties(QGpgmeQt6 PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "@resolved_includedir@/qgpgme;@resolved_includedir@" + INTERFACE_LINK_LIBRARIES "Gpgmepp;Qt6::Core" + IMPORTED_LOCATION "@resolved_libdir@/libqgpgmeqt6@libsuffix@" +) + +if(CMAKE_VERSION VERSION_LESS 2.8.12) + message(FATAL_ERROR "This file relies on consumers using CMake 2.8.12 or greater.") +endif() + +# Loop over all imported files and verify that they actually exist +foreach(target ${_IMPORT_CHECK_TARGETS} ) + foreach(file ${_IMPORT_CHECK_FILES_FOR_${target}} ) + if(NOT EXISTS "${file}" ) + message(FATAL_ERROR "The imported target \"${target}\" references the file + \"${file}\" +but this file does not exist. Possible reasons include: +* The file was deleted, renamed, or moved to another location. +* An install or uninstall procedure did not complete successfully. +* The installation package was faulty and contained + \"${CMAKE_CURRENT_LIST_FILE}\" +but not all the files it references. +") + endif() + endforeach() + unset(_IMPORT_CHECK_FILES_FOR_${target}) +endforeach() +unset(_IMPORT_CHECK_TARGETS) + +# This file does not depend on other imported targets which have +# been exported from the same project but in a separate export set. + +# Commands beyond this point should not need to know the version. +set(CMAKE_IMPORT_FILE_VERSION) +cmake_policy(POP) + +# Gpgmepp is a requirement for QGpgME +find_package(Gpgmepp CONFIG REQUIRED)
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/QGpgmeQt6ConfigVersion.cmake.in
Added
@@ -0,0 +1,31 @@ +# CMake Version file for QGpgME for Qt 6 +# Copyright (C) 2016 Intevation GmbH +# +# This file is part of GPGME. +# +# QGpgME is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# QGpgME 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 General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA + +# based on a generated file from cmake. +set(PACKAGE_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_MICRO@") + +if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}" ) + set(PACKAGE_VERSION_COMPATIBLE FALSE) +else() + set(PACKAGE_VERSION_COMPATIBLE TRUE) + if("${PACKAGE_FIND_VERSION}" STREQUAL "${PACKAGE_VERSION}") + set(PACKAGE_VERSION_EXACT TRUE) + endif() +endif()
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/RevokeKeyJob
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/revokekeyjob.h"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/SetPrimaryUserIDJob
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/setprimaryuseridjob.h"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/SignArchiveJob
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/signarchivejob.h"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/SignEncryptArchiveJob
Added
@@ -0,0 +1,1 @@ +#include "qgpgme/signencryptarchivejob.h"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/changeexpiryjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/changeexpiryjob.cpp
Changed
@@ -36,27 +36,13 @@ #endif #include "changeexpiryjob.h" -#include "job_p.h" +#include "changeexpiryjob_p.h" #include <context.h> using namespace GpgME; using namespace QGpgME; -namespace -{ -struct ChangeExpiryJobPrivate : public JobPrivate -{ - ChangeExpiryJobPrivate() - { - } - - ~ChangeExpiryJobPrivate() override = default; - - ChangeExpiryJob::Options m_options = ChangeExpiryJob::Default; -}; -} - void ChangeExpiryJob::setOptions(ChangeExpiryJob::Options options) { auto d = jobPrivate<ChangeExpiryJobPrivate>(this);
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/changeexpiryjob_p.h
Added
@@ -0,0 +1,51 @@ +/* + changeexpiryjob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2021,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_CHANGEEXPIRYJOB_P_H__ +#define __QGPGME_CHANGEEXPIRYJOB_P_H__ + +#include "job_p.h" + +#include "changeexpiryjob.h" + +namespace QGpgME +{ + +struct ChangeExpiryJobPrivate : public JobPrivate +{ + ChangeExpiryJob::Options m_options = ChangeExpiryJob::Default; +}; + +} + +#endif // __QGPGME_CHANGEEXPIRYJOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/cryptoconfig.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/cryptoconfig.cpp
Changed
@@ -56,10 +56,11 @@ QGpgME::CryptoConfigEntry *CryptoConfig::entry(const QString &componentName, const QString &entryName) const { const CryptoConfigComponent *comp = component(componentName); - const QStringList groupNames = comp->groupList(); + const QStringList groupNames = comp ? comp->groupList() : QStringList(); for (const auto &groupName : groupNames) { - const CryptoConfigGroup *group = comp ? comp->group(groupName) : nullptr; - if (CryptoConfigEntry *entry = group->entry(entryName)) { + const CryptoConfigGroup *group = comp->group(groupName); + CryptoConfigEntry *entry = group ? group->entry(entryName) : nullptr; + if (entry) { return entry; } }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/dataprovider.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/dataprovider.h
Changed
@@ -25,7 +25,13 @@ #define __QGPGME_DATAPROVIDER_H__ #include "qgpgme_export.h" + +#ifdef BUILDING_QGPGME #include <interfaces/dataprovider.h> +#else +#include <gpgme++/interfaces/dataprovider.h> +#endif + #include <memory> #include <QtCore/QByteArray>
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/decryptjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/decryptjob.h
Changed
@@ -84,8 +84,6 @@ If \a plainText is non-null, the plaintext is written there. Otherwise, it will be delivered in the second argument of result(). - - \throws GpgME::Exception if starting fails */ virtual void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText = std::shared_ptr<QIODevice>()) = 0;
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/decryptverifyarchivejob.cpp
Added
@@ -0,0 +1,83 @@ +/* + decryptverifyarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "decryptverifyarchivejob.h" +#include "decryptverifyarchivejob_p.h" + +#include <engineinfo.h> + +using namespace QGpgME; + +DecryptVerifyArchiveJob::DecryptVerifyArchiveJob(QObject *parent) + : Job{parent} +{ +} + +DecryptVerifyArchiveJob::~DecryptVerifyArchiveJob() = default; + +// static +bool DecryptVerifyArchiveJob::isSupported() +{ + static const auto gpgVersion = GpgME::engineInfo(GpgME::GpgEngine).engineVersion(); + return (gpgVersion >= "2.4.1") || (gpgVersion >= "2.2.42" && gpgVersion < "2.3.0"); +} + +void DecryptVerifyArchiveJob::setInputFile(const QString &path) +{ + auto d = jobPrivate<DecryptVerifyArchiveJobPrivate>(this); + d->m_inputFilePath = path; +} + +QString DecryptVerifyArchiveJob::inputFile() const +{ + auto d = jobPrivate<DecryptVerifyArchiveJobPrivate>(this); + return d->m_inputFilePath; +} + +void DecryptVerifyArchiveJob::setOutputDirectory(const QString &outputDirectory) +{ + auto d = jobPrivate<DecryptVerifyArchiveJobPrivate>(this); + d->m_outputDirectory = outputDirectory; +} + +QString DecryptVerifyArchiveJob::outputDirectory() const +{ + auto d = jobPrivate<DecryptVerifyArchiveJobPrivate>(this); + return d->m_outputDirectory; +} + +#include "decryptverifyarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/decryptverifyarchivejob.h
Added
@@ -0,0 +1,120 @@ +/* + decryptverifyarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_DECRYPTVERIFYARCHIVEJOB_H__ +#define __QGPGME_DECRYPTVERIFYARCHIVEJOB_H__ + +#include "job.h" + +#ifdef BUILDING_QGPGME +# include "context.h" +#else +# include <gpgme++/context.h> +#endif + +namespace GpgME +{ +class Key; +} + +namespace QGpgME +{ + +/** + * Abstract base class for job for decrypting encrypted (signed) archives + */ +class QGPGME_EXPORT DecryptVerifyArchiveJob : public Job +{ + Q_OBJECT +protected: + explicit DecryptVerifyArchiveJob(QObject *parent); +public: + ~DecryptVerifyArchiveJob() override; + + static bool isSupported(); + + /** + * Sets the path of the file to read the archive from. + * + * Used if the job is started with startIt(). + */ + void setInputFile(const QString &path); + QString inputFile() const; + + /** + * Sets the directory the content of the decrypted archive shall be + * written to. + */ + void setOutputDirectory(const QString &outputDirectory); + QString outputDirectory() const; + + /** + * Starts the decryption of an encrypted (and signed) archive. + * + * Decrypts and extracts the encrypted archive in \a cipherText. If the + * archive is signed, then the signature is verified. + * If a non-empty output directory was set, then the content of the archive + * is extracted into this directory. Otherwise, it is extracted into a + * directory named \c GPGARCH_n_ (where \c n is a number). + * + * Emits result() when the job has finished. + */ + virtual GpgME::Error start(const std::shared_ptr<QIODevice> &cipherText) = 0; + +Q_SIGNALS: + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the number of files. In the scanning phase (i.e. while gpgtar checks + * which files to put into the archive), \a current is the current number of + * files and \a total is 0. In the writing phase, \a current is the number + * of processed files and \a total is the total number of files. + */ + void fileProgress(int current, int total); + + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the amount of processed data. It is only emitted in the writing phase. + * \a current is the processed amount data and \a total is the total amount + * of data to process. Both values never exceed 2^20. + */ + void dataProgress(int current, int total); + + void result(const GpgME::DecryptionResult &decryptionResult, + const GpgME::VerificationResult &verificationResult, + const QString &auditLogAsHtml = {}, + const GpgME::Error &auditLogError = {}); +}; + +} + +#endif // __QGPGME_DECRYPTVERIFYARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/decryptverifyarchivejob_p.h
Added
@@ -0,0 +1,50 @@ +/* + decryptverifyarchivejob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_DECRYPTVERIFYARCHIVEJOB_P_H__ +#define __QGPGME_DECRYPTVERIFYARCHIVEJOB_P_H__ + +#include "job_p.h" + +namespace QGpgME +{ + +struct DecryptVerifyArchiveJobPrivate : public JobPrivate +{ + QString m_inputFilePath; + QString m_outputDirectory; +}; + +} + +#endif // __QGPGME_DECRYPTVERIFYARCHIVEJOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/decryptverifyjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/decryptverifyjob.h
Changed
@@ -85,8 +85,6 @@ If \a plainText is non-null, the plaintext is written there. Otherwise, it will be delivered in the third argument of result(). - - \throws GpgME::Exception if starting fails */ virtual void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText = std::shared_ptr<QIODevice>()) = 0;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/defaultkeygenerationjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/defaultkeygenerationjob.h
Changed
@@ -54,19 +54,19 @@ GpgME::Error start(const QString &email, const QString &name); - QString auditLogAsHtml() const Q_DECL_OVERRIDE; - GpgME::Error auditLogError() const Q_DECL_OVERRIDE; + QString auditLogAsHtml() const override; + GpgME::Error auditLogError() const override; public Q_SLOTS: - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; Q_SIGNALS: void result(const GpgME::KeyGenerationResult &result, const QByteArray &pubkeyData, const QString &auditLogAsHtml, const GpgME::Error &auditLogError); protected: - bool eventFilter(QObject *watched, QEvent *event) Q_DECL_OVERRIDE; + bool eventFilter(QObject *watched, QEvent *event) override; private: class Private;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/downloadjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/downloadjob.h
Changed
@@ -38,6 +38,7 @@ #include "job.h" #include <QtCore/QByteArray> +#include <QtCore/QStringList> #include <memory> @@ -46,7 +47,6 @@ class Error; } -class QStringList; class QIODevice; class QByteArray;
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/encryptarchivejob.cpp
Added
@@ -0,0 +1,119 @@ +/* + encryptarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "encryptarchivejob.h" +#include "encryptarchivejob_p.h" + +#include <engineinfo.h> + +using namespace QGpgME; + +EncryptArchiveJob::EncryptArchiveJob(QObject *parent) + : Job{parent} +{ +} + +EncryptArchiveJob::~EncryptArchiveJob() = default; + +// static +bool EncryptArchiveJob::isSupported() +{ + static const auto gpgVersion = GpgME::engineInfo(GpgME::GpgEngine).engineVersion(); + return (gpgVersion >= "2.4.1") || (gpgVersion >= "2.2.42" && gpgVersion < "2.3.0"); +} + +void EncryptArchiveJob::setRecipients(const std::vector<GpgME::Key> &recipients) +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + d->m_recipients = recipients; +} + +std::vector<GpgME::Key> EncryptArchiveJob::recipients() const +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + return d->m_recipients; +} + +void EncryptArchiveJob::setInputPaths(const std::vector<QString> &paths) +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + d->m_inputPaths = paths; +} + +std::vector<QString> EncryptArchiveJob::inputPaths() const +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + return d->m_inputPaths; +} + +void EncryptArchiveJob::setOutputFile(const QString &path) +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + d->m_outputFilePath = path; +} + +QString EncryptArchiveJob::outputFile() const +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + return d->m_outputFilePath; +} + +void EncryptArchiveJob::setEncryptionFlags(GpgME::Context::EncryptionFlags flags) +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + d->m_encryptionFlags = static_cast<GpgME::Context::EncryptionFlags>(flags | GpgME::Context::EncryptArchive); +} + +GpgME::Context::EncryptionFlags EncryptArchiveJob::encryptionFlags() const +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + return d->m_encryptionFlags; +} + +void EncryptArchiveJob::setBaseDirectory(const QString &baseDirectory) +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + d->m_baseDirectory = baseDirectory; +} + +QString EncryptArchiveJob::baseDirectory() const +{ + auto d = jobPrivate<EncryptArchiveJobPrivate>(this); + return d->m_baseDirectory; +} + +#include "encryptarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/encryptarchivejob.h
Added
@@ -0,0 +1,155 @@ +/* + encryptarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_ENCRYPTARCHIVEJOB_H__ +#define __QGPGME_ENCRYPTARCHIVEJOB_H__ + +#include "job.h" + +#ifdef BUILDING_QGPGME +# include "context.h" +#else +# include <gpgme++/context.h> +#endif + +namespace GpgME +{ +class Key; +} + +namespace QGpgME +{ + +/** + * Abstract base class for job for creating encrypted archives + */ +class QGPGME_EXPORT EncryptArchiveJob : public Job +{ + Q_OBJECT +protected: + explicit EncryptArchiveJob(QObject *parent); +public: + ~EncryptArchiveJob() override; + + static bool isSupported(); + + /** + * Sets the keys to use for encrypting the archive. + * + * Used if the job is started with startIt(). + */ + void setRecipients(const std::vector<GpgME::Key> &recipients); + std::vector<GpgME::Key> recipients() const; + + /** + * Sets the paths of the files and folders to put into the archive. + * + * If base directory is set, then the paths must be relative to the + * base directory. + * + * Used if the job is started with startIt(). + */ + void setInputPaths(const std::vector<QString> &paths); + std::vector<QString> inputPaths() const; + + /** + * Sets the path of the file to write the created archive to. + * + * If \a path is a relative path and base directory is set, then the + * path is interpreted relative to the base directory. + * + * Used if the job is started with startIt(). + * + * \note If a file with this path exists, then the job will fail, i.e. you + * need to delete an existing file that shall be overwritten before you + * start the job. + */ + void setOutputFile(const QString &path); + QString outputFile() const; + + /** + * Sets the flags to use for encryption. Defaults to \c EncryptArchive. + * The \c EncryptArchive flag is always assumed set for this job. + * + * Used if the job is started with startIt(). + */ + void setEncryptionFlags(GpgME::Context::EncryptionFlags flags); + GpgME::Context::EncryptionFlags encryptionFlags() const; + + /** + * Sets the base directory for the relative paths of the input files and + * the output file. + */ + void setBaseDirectory(const QString &baseDirectory); + QString baseDirectory() const; + + /** + * Starts the creation of an encrypted archive. + * + * Encrypts the files and directories in \a paths into an archive for the + * keys in \a recipients. If \a recipients is empty, then symmetric + * encryption is performed. The encrypted archive is written to \a cipherText. + * + * Emits result() when the job has finished. + */ + virtual GpgME::Error start(const std::vector<GpgME::Key> &recipients, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &cipherText, + const GpgME::Context::EncryptionFlags flags) = 0; + +Q_SIGNALS: + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the number of files. In the scanning phase (i.e. while gpgtar checks + * which files to put into the archive), \a current is the current number of + * files and \a total is 0. In the writing phase, \a current is the number + * of processed files and \a total is the total number of files. + */ + void fileProgress(int current, int total); + + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the amount of processed data. It is only emitted in the writing phase. + * \a current is the processed amount data and \a total is the total amount + * of data to process. Both values never exceed 2^20. + */ + void dataProgress(int current, int total); + + void result(const GpgME::EncryptionResult &result, + const QString &auditLogAsHtml = {}, + const GpgME::Error &auditLogError = {}); +}; + +} + +#endif // __QGPGME_ENCRYPTARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/encryptarchivejob_p.h
Added
@@ -0,0 +1,53 @@ +/* + encryptarchivejob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_ENCRYPTARCHIVEJOB_P_H__ +#define __QGPGME_ENCRYPTARCHIVEJOB_P_H__ + +#include "job_p.h" + +namespace QGpgME +{ + +struct EncryptArchiveJobPrivate : public JobPrivate +{ + std::vector<GpgME::Key> m_recipients; + std::vector<QString> m_inputPaths; + QString m_outputFilePath; + QString m_baseDirectory; + GpgME::Context::EncryptionFlags m_encryptionFlags = GpgME::Context::EncryptArchive; +}; + +} + +#endif // __QGPGME_ENCRYPTARCHIVEJOB_P_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/encryptjob.cpp
Added
@@ -0,0 +1,53 @@ +/* + encryptjob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "encryptjob.h" +#include "encryptjob_p.h" + +using namespace QGpgME; + +void EncryptJob::setFileName(const QString &fileName) +{ + auto d = jobPrivate<EncryptJobPrivate>(this); + d->m_fileName = fileName; +} + +QString EncryptJob::fileName() const +{ + auto d = jobPrivate<EncryptJobPrivate>(this); + return d->m_fileName; +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/encryptjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/encryptjob.h
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -80,6 +82,9 @@ public: ~EncryptJob(); + void setFileName(const QString &fileName); + QString fileName() const; + /** Starts the encryption operation. \a recipients is the a list of keys to encrypt \a plainText to. Empty (null) keys are @@ -99,8 +104,6 @@ If \a cipherText is non-null, the ciphertext is written there. Otherwise, it will be delivered in the second argument of result(). - - \throws GpgME::Exception if starting fails */ virtual void start(const std::vector<GpgME::Key> &recipients, const std::shared_ptr<QIODevice> &plainText,
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/encryptjob_p.h
Added
@@ -0,0 +1,49 @@ +/* + encryptjob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_ENCRYPTJOB_P_H__ +#define __QGPGME_ENCRYPTJOB_P_H__ + +#include "job_p.h" + +namespace QGpgME +{ + +struct EncryptJobPrivate : public JobPrivate +{ + QString m_fileName; +}; + +} + +#endif // __QGPGME_ENCRYPTJOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/exportjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/exportjob.h
Changed
@@ -39,14 +39,13 @@ #include "job.h" #include <QtCore/QByteArray> +#include <QtCore/QStringList> namespace GpgME { class Error; } -class QStringList; - namespace QGpgME {
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/filelistdataprovider.cpp
Added
@@ -0,0 +1,98 @@ +/* + filelistdataprovider.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "filelistdataprovider.h" + +#include "dataprovider.h" + +#include <QString> + +#include <error.h> + +#include <numeric> + +using namespace QGpgME; +using namespace GpgME; + +static QByteArray encodeFilenames(const std::vector<QString> &filenames) +{ + QByteArray ret; + if (filenames.empty()) { + return ret; + } + // calculate and reserve the needed minimum size of the result + const auto addSize = (unsigned int n, const QString &s) { return n + s.size(); }; + const unsigned int minSize = filenames.size() + + std::accumulate(filenames.cbegin(), filenames.cend(), 0u, addSize); + ret.reserve(minSize); + // pack the filenames into the byte array + for (const auto &f : filenames) { + if (!f.isEmpty()) { + ret += f.toUtf8() + '\0'; + } + } + ret.chop(1); // remove the trailing nul + return ret; +} + +FileListDataProvider::FileListDataProvider(const std::vector<QString> &filenames) + : mProvider{new QByteArrayDataProvider{encodeFilenames(filenames)}} +{ +} + +FileListDataProvider::~FileListDataProvider() = default; + +ssize_t FileListDataProvider::read(void* buffer, size_t bufSize) +{ + return mProvider->read(buffer, bufSize); +} + +ssize_t FileListDataProvider::write(const void *, size_t) +{ + Error::setSystemError(GPG_ERR_EBADF); + return -1; +} + +off_t FileListDataProvider::seek(off_t offset, int whence) +{ + return mProvider->seek(offset, whence); +} + +void FileListDataProvider::release() +{ + mProvider->release(); +}
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/filelistdataprovider.h
Added
@@ -0,0 +1,79 @@ +/* + filelistdataprovider.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_FILELISTDATAPROVIDER_H__ +#define __QGPGME_FILELISTDATAPROVIDER_H__ + +#include "qgpgme_export.h" + +#ifdef BUILDING_QGPGME +#include <interfaces/dataprovider.h> +#else +#include <gpgme++/interfaces/dataprovider.h> +#endif + +#include <memory> +#include <vector> + +class QString; + +namespace QGpgME +{ + +/** + * This read-only data provider simplifies providing a nul-separated list of + * UTF-8-encoded filenames, e.g. for creating signed or encrypted archives. + */ +class QGPGME_EXPORT FileListDataProvider : public GpgME::DataProvider +{ +public: + explicit FileListDataProvider(const std::vector<QString> &filenames); + ~FileListDataProvider() override; + +private: + bool isSupported(Operation op) const override + { + return op != Operation::Write; + } + ssize_t read(void *buffer, size_t bufSize) override; + ssize_t write(const void *buffer, size_t bufSize) override; + off_t seek(off_t offset, int whence) override; + void release() override; + +private: + std::unique_ptr<GpgME::DataProvider> mProvider; +}; + +} + +#endif // __QGPGME_FILELISTDATAPROVIDER_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/gpgcardjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/gpgcardjob.h
Changed
@@ -44,24 +44,6 @@ namespace QGpgME { -/** - @short Get the best key to use for a Mailbox - - To use the keyformailboxjob, first obtain an instance from the - CryptoBackend and either exec it or start and - conncet the result() signals to a suitable slot. - The job will be automatically deleted in which - case the KeylistJob instance will have schedules it's own - destruction with a call to QObject::deleteLater(). - - The best key is defined as the key with a UID that has an - E-Mail that matches the mailbox provided. If multiple - keys are found the one with the highest validity is returned. - - After result() is emitted, the - KeyListJob will schedule it's own destruction by calling - QObject::deleteLater(). -*/ class QGPGME_EXPORT GpgCardJob: public Job { Q_OBJECT
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/hierarchicalkeylistjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/hierarchicalkeylistjob.h
Changed
@@ -94,16 +94,16 @@ The \a secretOnly parameter is ignored by HierarchicalKeyListJob and must be set to false. */ - GpgME::Error start(const QStringList &patterns, bool secretOnly = false) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns, bool secretOnly = false) override; GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, - std::vector<GpgME::Key> &keys) Q_DECL_OVERRIDE; + std::vector<GpgME::Key> &keys) override; private Q_SLOTS: void slotResult(const GpgME::KeyListResult &); void slotNextKey(const GpgME::Key &key); /* from Job */ - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; private: GpgME::Error startAJob();
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/importjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/importjob.cpp
Changed
@@ -36,29 +36,13 @@ #endif #include "importjob.h" -#include "job_p.h" +#include "importjob_p.h" #include <context.h> using namespace GpgME; using namespace QGpgME; -namespace -{ -struct ImportJobPrivate : public JobPrivate -{ - ImportJobPrivate() - { - } - - ~ImportJobPrivate() override = default; - - QString m_importFilter; - Key::Origin m_keyOrigin = Key::OriginUnknown; - QString m_keyOriginUrl; -}; -} - void QGpgME::ImportJob::setImportFilter(const QString &filter) { const auto d = jobPrivate<ImportJobPrivate>(this);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/importjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/importjob.h
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -88,6 +90,8 @@ virtual GpgME::Error start(const QByteArray &keyData) = 0; virtual GpgME::ImportResult exec(const QByteArray &keyData) = 0; + + virtual GpgME::Error startLater(const QByteArray &keyData) = 0; }; }
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/importjob_p.h
Added
@@ -0,0 +1,53 @@ +/* + importjob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2021,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_IMPORTJOB_P_H__ +#define __QGPGME_IMPORTJOB_P_H__ + +#include "job_p.h" + +#include <key.h> + +namespace QGpgME +{ + +struct ImportJobPrivate : public JobPrivate +{ + QString m_importFilter; + GpgME::Key::Origin m_keyOrigin = GpgME::Key::OriginUnknown; + QString m_keyOriginUrl; +}; + +} + +#endif // __QGPGME_IMPORTJOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/job.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/job.cpp
Changed
@@ -72,6 +72,8 @@ #include "quickjob.h" #include "gpgcardjob.h" #include "receivekeysjob.h" +#include "revokekeyjob.h" +#include "setprimaryuseridjob.h" #include <QCoreApplication> #include <QDebug> @@ -92,7 +94,12 @@ ref = std::move(d); } -QGpgME::JobPrivate *QGpgME::getJobPrivate(const Job *job) +const QGpgME::JobPrivate *QGpgME::getJobPrivate(const Job *job) +{ + return d_func()->operator(job).get(); +} + +QGpgME::JobPrivate *QGpgME::getJobPrivate(Job *job) { return d_func()->operator(job).get(); } @@ -135,6 +142,20 @@ return QGpgME::g_context_map.value (job, nullptr); } +GpgME::Error QGpgME::Job::startIt() +{ + auto d = getJobPrivate(this); + Q_ASSERT(d && "This Job class has no JobPrivate class"); + return d->startIt(); +} + +void QGpgME::Job::startNow() +{ + auto d = getJobPrivate(this); + Q_ASSERT(d && "This Job class has no JobPrivate class"); + d->startNow(); +} + #define make_job_subclass_ext(x,y) \ QGpgME::x::x( QObject * parent ) : y( parent ) {} \ QGpgME::x::~x() {} @@ -172,6 +193,8 @@ make_job_subclass(TofuPolicyJob) make_job_subclass(QuickJob) make_job_subclass(GpgCardJob) +make_job_subclass(RevokeKeyJob) +make_job_subclass(SetPrimaryUserIDJob) #undef make_job_subclass @@ -208,3 +231,5 @@ #include "quickjob.moc" #include "gpgcardjob.moc" #include "receivekeysjob.moc" +#include "revokekeyjob.moc" +#include "setprimaryuseridjob.moc"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/job.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/job.h
Changed
@@ -95,11 +95,55 @@ */ static GpgME::Context *context(Job *job); + /** Starts the job. + * + * Starts the job with the values set for the concrete job. + */ + GpgME::Error startIt(); + + /** Starts a deferred job. + * + * The job needs to have been prepared for a deferred start by calling the + * startLater() function instead of the start() function of a leaf class. + */ + void startNow(); + public Q_SLOTS: virtual void slotCancel() = 0; Q_SIGNALS: - void progress(const QString &what, int current, int total); + /** + * This signal is emitted whenever the backend sends a progress status + * message. For most jobs, \a current is the amount of processed data + * (or files) and \a total is the total amount of data (of files). If + * \a total is 0, then the total amount is unknown or not yet known. + * For GnuPG 2.1.13 and later, \a current and \a total do not exceed + * 2^20, i.e. for larger values they are scaled down and you should not + * assume that they represent absolute values. + * + * Check the documentation on progress in the GpgME manual for details. + * + * Note: Some jobs provide special progress signals, e.g. for file-count- + * or data-based progress. + */ + void jobProgress(int current, int total); + + /** + * This signal is emitted whenever the backend sends a progress status + * message. Compared to the jobProgress signal this signal also provides the + * what value and the type value reported by the backend. Usually, these + * values can safely be ignored, so that you are better off using the + * simpler jobProgress signal. + * Check the documentation on progress in the GpgME manual for details + * on what and type. + * + * Note: Some jobs provide special progress signals, so that you do not + * have to deal with what and type yourself. + */ + void rawProgress(const QString &what, int type, int current, int total); + + QGPGME_DEPRECATED void progress(const QString &what, int current, int total); + void done(); };
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/job_p.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/job_p.h
Changed
@@ -36,6 +36,8 @@ #include "job.h" +#include "qgpgme_debug.h" + #include <memory> namespace QGpgME @@ -46,25 +48,51 @@ { public: virtual ~JobPrivate() {} + + virtual GpgME::Error startIt() = 0; + + virtual void startNow() = 0; }; // Setter and getters for the externally stored pimpl instances of jobs // BCI: Add a real d-pointer to Job void setJobPrivate(const Job *job, std::unique_ptr<JobPrivate> d); -JobPrivate *getJobPrivate(const Job *job); +const JobPrivate *getJobPrivate(const Job *job); + +JobPrivate *getJobPrivate(Job *job); template <typename T> -static T *jobPrivate(const Job *job) { +static const T *jobPrivate(const Job *job) { + auto d = getJobPrivate(job); + return dynamic_cast<const T *>(d); +} + +template <typename T> +static T *jobPrivate(Job *job) { auto d = getJobPrivate(job); - if (!d) { - std::unique_ptr<T> ref{new T}; - d = ref.get(); - setJobPrivate(job, std::move(ref)); - } return dynamic_cast<T *>(d); } +// Helper for the archive job classes +template<class JobClass> +void emitArchiveProgressSignals(JobClass *job, const QString &what, int type, int current, int total) +{ + if (what != QLatin1String{"gpgtar"}) { + return; + } + switch (type) { + case 'c': + Q_EMIT job->fileProgress(current, total); + break; + case 's': + Q_EMIT job->dataProgress(current, total); + break; + default: + qCDebug(QGPGME_LOG) << job << __func__ << "Received progress for gpgtar with unknown type" << char(type); + }; +} + } #endif // __QGPGME_JOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/keyformailboxjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/keyformailboxjob.h
Changed
@@ -57,18 +57,14 @@ To use the keyformailboxjob, first obtain an instance from the CryptoBackend and either exec it or start and - conncet the result() signals to a suitable slot. - The job will be automatically deleted in which - case the KeylistJob instance will have schedules it's own - destruction with a call to QObject::deleteLater(). + connect the result() signal to a suitable slot. The best key is defined as the key with a UID that has an E-Mail that matches the mailbox provided. If multiple keys are found the one with the highest validity is returned. - After result() is emitted, the - KeyListJob will schedule it's own destruction by calling - QObject::deleteLater(). + After result() is emitted, the job will schedule it's own + destruction by calling QObject::deleteLater(). */ class QGPGME_EXPORT KeyForMailboxJob: public Job {
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/keylistjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/keylistjob.h
Changed
@@ -44,6 +44,8 @@ # include <gpgme++/key.h> #endif +#include <QtCore/QStringList> + #include <vector> namespace GpgME @@ -52,8 +54,6 @@ class KeyListResult; } -class QStringList; - namespace QGpgME { @@ -64,7 +64,7 @@ CryptoBackend implementation, connect the nextKey(), progress() and result() signals to suitable slots and then start the key listing with a call to start(). This call might fail, in which - case the KeylistJob instance will have schedules it's own + case the KeylistJob instance will have scheduled it's own destruction with a call to QObject::deleteLater(). During keylisting, you will receive new key objects through the
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/listallkeysjob.cpp
Added
@@ -0,0 +1,53 @@ +/* + listallkeysjob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "listallkeysjob.h" +#include "listallkeysjob_p.h" + +using namespace QGpgME; + +void ListAllKeysJob::setOptions(ListAllKeysJob::Options options) +{ + auto d = jobPrivate<ListAllKeysJobPrivate>(this); + d->m_options = options; +} + +ListAllKeysJob::Options ListAllKeysJob::options() const +{ + auto d = jobPrivate<ListAllKeysJobPrivate>(this); + return d->m_options; +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/listallkeysjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/listallkeysjob.h
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -74,12 +76,22 @@ class QGPGME_EXPORT ListAllKeysJob : public Job { Q_OBJECT +public: + enum Option { + Default = 0x00, + DisableAutomaticTrustDatabaseCheck = 0x01, + }; + Q_DECLARE_FLAGS(Options, Option) + protected: explicit ListAllKeysJob(QObject *parent); public: ~ListAllKeysJob(); + void setOptions(Options options); + Options options() const; + /** Starts the listallkeys operation. In general, all keys are returned (however, the backend is free to truncate the result @@ -101,6 +113,8 @@ void result(const GpgME::KeyListResult &result, const std::vector<GpgME::Key> &pub = std::vector<GpgME::Key>(), const std::vector<GpgME::Key> &sec = std::vector<GpgME::Key>(), const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error()); }; +Q_DECLARE_OPERATORS_FOR_FLAGS(ListAllKeysJob::Options) + } #endif // __KLEO_LISTALLKEYSJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/listallkeysjob_p.h
Added
@@ -0,0 +1,51 @@ +/* + listallkeysjob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_LISTALLKEYSJOB_P_H__ +#define __QGPGME_LISTALLKEYSJOB_P_H__ + +#include "job_p.h" + +#include "listallkeysjob.h" + +namespace QGpgME +{ + +struct ListAllKeysJobPrivate : public JobPrivate +{ + ListAllKeysJob::Options m_options = ListAllKeysJob::Default; +}; + +} + +#endif // __QGPGME_LISTALLKEYSJOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/multideletejob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/multideletejob.cpp
Changed
@@ -97,7 +97,13 @@ const int current = mIt - mKeys.begin(); const int total = mKeys.size(); - Q_EMIT progress(QStringLiteral("%1/%2").arg(current).arg(total), current, total); + const QString what = QStringLiteral("%1/%2").arg(current).arg(total); + Q_EMIT jobProgress(current, total); + Q_EMIT rawProgress(what, '?', current, total); + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED + Q_EMIT progress(what, current, total); + QT_WARNING_POP } GpgME::Error QGpgME::MultiDeleteJob::startAJob()
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/multideletejob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/multideletejob.h
Changed
@@ -84,7 +84,7 @@ GpgME::Error start(const std::vector<GpgME::Key> &keys, bool allowSecretKeyDeletion = false); /* from Job */ - void slotCancel() Q_DECL_OVERRIDE; + void slotCancel() override; Q_SIGNALS: void result(const GpgME::Error &result, const GpgME::Key &errorKey);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/protocol.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/protocol.h
Changed
@@ -50,13 +50,17 @@ class ExportJob; class DownloadJob; class DeleteJob; +class EncryptArchiveJob; class EncryptJob; class DecryptJob; +class SignArchiveJob; +class SignEncryptArchiveJob; class SignJob; class SignKeyJob; class VerifyDetachedJob; class VerifyOpaqueJob; class SignEncryptJob; +class DecryptVerifyArchiveJob; class DecryptVerifyJob; class RefreshKeysJob; class ChangeExpiryJob; @@ -71,6 +75,8 @@ class QuickJob; class GpgCardJob; class ReceiveKeysJob; +class RevokeKeyJob; +class SetPrimaryUserIDJob; /** The main entry point for QGpgME Comes in OpenPGP and SMIME(CMS) flavors. * @@ -127,21 +133,24 @@ virtual KeyGenerationJob *keyGenerationJob() const = 0; virtual ImportJob *importJob() const = 0; virtual ImportFromKeyserverJob *importFromKeyserverJob() const = 0; - virtual ReceiveKeysJob *receiveKeysJob() const = 0; virtual ExportJob *publicKeyExportJob(bool armor = false) const = 0; // the second parameter is ignored; the passphrase in the exported file is always utf-8 encoded virtual ExportJob *secretKeyExportJob(bool armor = false, const QString & = QString()) const = 0; - virtual ExportJob *secretSubkeyExportJob(bool armor = false) const = 0; virtual DownloadJob *downloadJob(bool armor = false) const = 0; virtual DeleteJob *deleteJob() const = 0; virtual SignEncryptJob *signEncryptJob(bool armor = false, bool textMode = false) const = 0; virtual DecryptVerifyJob *decryptVerifyJob(bool textmode = false) const = 0; + + /** + * For S/MIME keys this job performs a full validation check of the keys + * with updated CRLs. + * For OpenPGP keys, use receiveKeysJob. + */ virtual RefreshKeysJob *refreshKeysJob() const = 0; virtual ChangeExpiryJob *changeExpiryJob() const = 0; virtual SignKeyJob *signKeyJob() const = 0; virtual ChangePasswdJob *changePasswdJob() const = 0; virtual ChangeOwnerTrustJob *changeOwnerTrustJob() const = 0; - virtual AddExistingSubkeyJob *addExistingSubkeyJob() const = 0; virtual AddUserIDJob *addUserIDJob() const = 0; virtual SpecialJob *specialJob(const char *type, const QMap<QString, QVariant> &args) const = 0; @@ -161,9 +170,6 @@ /** Find the best key to use for a mailbox. */ virtual KeyForMailboxJob *keyForMailboxJob() const = 0; - /** This job looks up a key via WKD without importing it. */ - virtual WKDLookupJob *wkdLookupJob() const = 0; - /** A Job for interacting with gnupg's wks tools. */ virtual WKSPublishJob *wksPublishJob() const = 0; @@ -172,6 +178,26 @@ /** A Job for the quick commands */ virtual QuickJob *quickJob() const = 0; + + /** This job looks up a key via WKD without importing it. */ + virtual WKDLookupJob *wkdLookupJob() const = 0; + + virtual ExportJob *secretSubkeyExportJob(bool armor = false) const = 0; + virtual AddExistingSubkeyJob *addExistingSubkeyJob() const = 0; + virtual ReceiveKeysJob *receiveKeysJob() const = 0; + + virtual RevokeKeyJob *revokeKeyJob() const = 0; + + /** + * Returns a job for flagging a user ID as the primary user ID of an + * OpenPGP key. + */ + virtual SetPrimaryUserIDJob *setPrimaryUserIDJob() const = 0; + + virtual EncryptArchiveJob *encryptArchiveJob(bool armor = false) const = 0; + virtual SignArchiveJob *signArchiveJob(bool armor = false) const = 0; + virtual SignEncryptArchiveJob *signEncryptArchiveJob(bool armor = false) const = 0; + virtual DecryptVerifyArchiveJob *decryptVerifyArchiveJob() const = 0; }; /** Obtain a reference to the OpenPGP Protocol.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/protocol_p.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/protocol_p.h
Changed
@@ -41,12 +41,16 @@ #include "qgpgmekeylistjob.h" #include "qgpgmelistallkeysjob.h" #include "qgpgmedecryptjob.h" +#include "qgpgmedecryptverifyarchivejob.h" #include "qgpgmedecryptverifyjob.h" -#include "qgpgmerefreshkeysjob.h" +#include "qgpgmerefreshsmimekeysjob.h" #include "qgpgmedeletejob.h" #include "qgpgmedownloadjob.h" #include "qgpgmesignencryptjob.h" +#include "qgpgmeencryptarchivejob.h" #include "qgpgmeencryptjob.h" +#include "qgpgmesignarchivejob.h" +#include "qgpgmesignencryptarchivejob.h" #include "qgpgmesignjob.h" #include "qgpgmesignkeyjob.h" #include "qgpgmeexportjob.h" @@ -65,6 +69,8 @@ #include "qgpgmetofupolicyjob.h" #include "qgpgmequickjob.h" #include "qgpgmereceivekeysjob.h" +#include "qgpgmerevokekeyjob.h" +#include "qgpgmesetprimaryuseridjob.h" namespace { @@ -75,7 +81,7 @@ public: explicit Protocol(GpgME::Protocol proto) : mProtocol(proto) {} - QString name() const Q_DECL_OVERRIDE + QString name() const override { switch (mProtocol) { case GpgME::OpenPGP: return QStringLiteral("OpenPGP"); @@ -84,7 +90,7 @@ } } - QString displayName() const Q_DECL_OVERRIDE + QString displayName() const override { // ah (2.4.16): Where is this used and isn't this inverted // with name @@ -95,12 +101,12 @@ } } - QGpgME::SpecialJob *specialJob(const char *, const QMap<QString, QVariant> &) const Q_DECL_OVERRIDE + QGpgME::SpecialJob *specialJob(const char *, const QMap<QString, QVariant> &) const override { return nullptr; } - QGpgME::KeyListJob *keyListJob(bool remote, bool includeSigs, bool validate) const Q_DECL_OVERRIDE + QGpgME::KeyListJob *keyListJob(bool remote, bool includeSigs, bool validate) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -125,7 +131,7 @@ return new QGpgME::QGpgMEKeyListJob(context); } - QGpgME::ListAllKeysJob *listAllKeysJob(bool includeSigs, bool validate) const Q_DECL_OVERRIDE + QGpgME::ListAllKeysJob *listAllKeysJob(bool includeSigs, bool validate) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -152,7 +158,7 @@ return new QGpgME::QGpgMEListAllKeysJob(context); } - QGpgME::EncryptJob *encryptJob(bool armor, bool textmode) const Q_DECL_OVERRIDE + QGpgME::EncryptJob *encryptJob(bool armor, bool textmode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -164,7 +170,7 @@ return new QGpgME::QGpgMEEncryptJob(context); } - QGpgME::DecryptJob *decryptJob() const Q_DECL_OVERRIDE + QGpgME::DecryptJob *decryptJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -173,7 +179,7 @@ return new QGpgME::QGpgMEDecryptJob(context); } - QGpgME::SignJob *signJob(bool armor, bool textMode) const Q_DECL_OVERRIDE + QGpgME::SignJob *signJob(bool armor, bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -185,7 +191,7 @@ return new QGpgME::QGpgMESignJob(context); } - QGpgME::VerifyDetachedJob *verifyDetachedJob(bool textMode) const Q_DECL_OVERRIDE + QGpgME::VerifyDetachedJob *verifyDetachedJob(bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -196,7 +202,7 @@ return new QGpgME::QGpgMEVerifyDetachedJob(context); } - QGpgME::VerifyOpaqueJob *verifyOpaqueJob(bool textMode) const Q_DECL_OVERRIDE + QGpgME::VerifyOpaqueJob *verifyOpaqueJob(bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -207,7 +213,7 @@ return new QGpgME::QGpgMEVerifyOpaqueJob(context); } - QGpgME::KeyGenerationJob *keyGenerationJob() const Q_DECL_OVERRIDE + QGpgME::KeyGenerationJob *keyGenerationJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -216,7 +222,7 @@ return new QGpgME::QGpgMEKeyGenerationJob(context); } - QGpgME::ImportJob *importJob() const Q_DECL_OVERRIDE + QGpgME::ImportJob *importJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -225,7 +231,7 @@ return new QGpgME::QGpgMEImportJob(context); } - QGpgME::ImportFromKeyserverJob *importFromKeyserverJob() const Q_DECL_OVERRIDE + QGpgME::ImportFromKeyserverJob *importFromKeyserverJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -247,7 +253,7 @@ return new QGpgME::QGpgMEReceiveKeysJob{context}; } - QGpgME::ExportJob *publicKeyExportJob(bool armor) const Q_DECL_OVERRIDE + QGpgME::ExportJob *publicKeyExportJob(bool armor) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -258,7 +264,7 @@ return new QGpgME::QGpgMEExportJob(context); } - QGpgME::ExportJob *secretKeyExportJob(bool armor, const QString &) const Q_DECL_OVERRIDE + QGpgME::ExportJob *secretKeyExportJob(bool armor, const QString &) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -269,7 +275,7 @@ return new QGpgME::QGpgMEExportJob(context, GpgME::Context::ExportSecret); } - QGpgME::ExportJob *secretSubkeyExportJob(bool armor) const Q_DECL_OVERRIDE + QGpgME::ExportJob *secretSubkeyExportJob(bool armor) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -280,17 +286,16 @@ return new QGpgME::QGpgMEExportJob(context, GpgME::Context::ExportSecretSubkey); } - QGpgME::RefreshKeysJob *refreshKeysJob() const Q_DECL_OVERRIDE + QGpgME::RefreshKeysJob *refreshKeysJob() const override { - if (mProtocol != GpgME::CMS) { // fixme: add support for gpg, too + if (mProtocol != GpgME::CMS) { return nullptr; } - // this operation is not supported by gpgme, so we have to call gpgsm ourselves: - return new QGpgME::QGpgMERefreshKeysJob(); + return new QGpgME::QGpgMERefreshSMIMEKeysJob; } - QGpgME::DownloadJob *downloadJob(bool armor) const Q_DECL_OVERRIDE + QGpgME::DownloadJob *downloadJob(bool armor) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -303,7 +308,7 @@ return new QGpgME::QGpgMEDownloadJob(context); } - QGpgME::DeleteJob *deleteJob() const Q_DECL_OVERRIDE + QGpgME::DeleteJob *deleteJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -312,7 +317,7 @@ return new QGpgME::QGpgMEDeleteJob(context); } - QGpgME::SignEncryptJob *signEncryptJob(bool armor, bool textMode) const Q_DECL_OVERRIDE + QGpgME::SignEncryptJob *signEncryptJob(bool armor, bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -324,7 +329,7 @@ return new QGpgME::QGpgMESignEncryptJob(context); } - QGpgME::DecryptVerifyJob *decryptVerifyJob(bool textMode) const Q_DECL_OVERRIDE + QGpgME::DecryptVerifyJob *decryptVerifyJob(bool textMode) const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -335,7 +340,7 @@ return new QGpgME::QGpgMEDecryptVerifyJob(context); } - QGpgME::ChangeExpiryJob *changeExpiryJob() const Q_DECL_OVERRIDE + QGpgME::ChangeExpiryJob *changeExpiryJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg @@ -348,7 +353,7 @@ return new QGpgME::QGpgMEChangeExpiryJob(context); } - QGpgME::ChangePasswdJob *changePasswdJob() const Q_DECL_OVERRIDE + QGpgME::ChangePasswdJob *changePasswdJob() const override { if (!GpgME::hasFeature(GpgME::PasswdFeature, 0)) { return nullptr; @@ -360,7 +365,7 @@ return new QGpgME::QGpgMEChangePasswdJob(context); } - QGpgME::SignKeyJob *signKeyJob() const Q_DECL_OVERRIDE + QGpgME::SignKeyJob *signKeyJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg @@ -373,7 +378,7 @@ return new QGpgME::QGpgMESignKeyJob(context); } - QGpgME::ChangeOwnerTrustJob *changeOwnerTrustJob() const Q_DECL_OVERRIDE + QGpgME::ChangeOwnerTrustJob *changeOwnerTrustJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg @@ -399,7 +404,7 @@ return new QGpgME::QGpgMEAddExistingSubkeyJob{context}; } - QGpgME::AddUserIDJob *addUserIDJob() const Q_DECL_OVERRIDE + QGpgME::AddUserIDJob *addUserIDJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; // only supported by gpg @@ -412,7 +417,7 @@ return new QGpgME::QGpgMEAddUserIDJob(context); } - QGpgME::KeyListJob *locateKeysJob() const Q_DECL_OVERRIDE + QGpgME::KeyListJob *locateKeysJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; @@ -421,11 +426,11 @@ if (!context) { return nullptr; } - context->setKeyListMode(GpgME::Extern | GpgME::Local | GpgME::Signatures | GpgME::Validate); + context->setKeyListMode(GpgME::Locate | GpgME::Signatures | GpgME::Validate); return new QGpgME::QGpgMEKeyListJob(context); } - QGpgME::KeyForMailboxJob *keyForMailboxJob() const Q_DECL_OVERRIDE + QGpgME::KeyForMailboxJob *keyForMailboxJob() const override { GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); if (!context) { @@ -434,7 +439,7 @@ return new QGpgME::QGpgMEKeyForMailboxJob(context); } - QGpgME::WKDLookupJob *wkdLookupJob() const Q_DECL_OVERRIDE + QGpgME::WKDLookupJob *wkdLookupJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; @@ -446,7 +451,7 @@ return new QGpgME::QGpgMEWKDLookupJob(context.release()); } - QGpgME::WKSPublishJob *wksPublishJob() const Q_DECL_OVERRIDE + QGpgME::WKSPublishJob *wksPublishJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; @@ -458,7 +463,7 @@ return new QGpgME::QGpgMEWKSPublishJob(context.release()); } - QGpgME::TofuPolicyJob *tofuPolicyJob() const Q_DECL_OVERRIDE + QGpgME::TofuPolicyJob *tofuPolicyJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; @@ -470,7 +475,7 @@ return new QGpgME::QGpgMETofuPolicyJob(context); } - QGpgME::QuickJob *quickJob() const Q_DECL_OVERRIDE + QGpgME::QuickJob *quickJob() const override { if (mProtocol != GpgME::OpenPGP) { return nullptr; @@ -481,6 +486,77 @@ } return new QGpgME::QGpgMEQuickJob(context); } + + QGpgME::RevokeKeyJob *revokeKeyJob() const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; + } + GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); + if (!context) { + return nullptr; + } + return new QGpgME::QGpgMERevokeKeyJob(context); + } + + QGpgME::SetPrimaryUserIDJob *setPrimaryUserIDJob() const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; + } + GpgME::Context *context = GpgME::Context::createForProtocol(mProtocol); + if (!context) { + return nullptr; + } + return new QGpgME::QGpgMESetPrimaryUserIDJob{context}; + } + + QGpgME::EncryptArchiveJob *encryptArchiveJob(bool armor) const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; + } + if (auto context = GpgME::Context::createForProtocol(mProtocol)) { + context->setArmor(armor); + return new QGpgME::QGpgMEEncryptArchiveJob{context}; + } + return nullptr; + } + + QGpgME::SignArchiveJob *signArchiveJob(bool armor) const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; + } + if (auto context = GpgME::Context::createForProtocol(mProtocol)) { + context->setArmor(armor); + return new QGpgME::QGpgMESignArchiveJob{context}; + } + return nullptr; + } + + QGpgME::SignEncryptArchiveJob *signEncryptArchiveJob(bool armor) const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; + } + if (auto context = GpgME::Context::createForProtocol(mProtocol)) { + context->setArmor(armor); + return new QGpgME::QGpgMESignEncryptArchiveJob{context}; + } + return nullptr; + } + + QGpgME::DecryptVerifyArchiveJob *decryptVerifyArchiveJob() const override + { + if (mProtocol != GpgME::OpenPGP) { + return nullptr; + } + if (auto context = GpgME::Context::createForProtocol(mProtocol)) { + return new QGpgME::QGpgMEDecryptVerifyArchiveJob{context}; + } + return nullptr; + } }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeaddexistingsubkeyjob.cpp
Changed
@@ -64,7 +64,8 @@ std::unique_ptr<GpgAddExistingSubkeyEditInteractor> interactor{new GpgAddExistingSubkeyEditInteractor{subkey.keyGrip()}}; if (!subkey.neverExpires()) { - const auto expiry = QDateTime::fromSecsSinceEpoch(subkey.expirationTime(), Qt::UTC).toString(u"yyyyMMdd'T'hhmmss").toStdString(); + const auto expiry = QDateTime::fromSecsSinceEpoch(uint_least32_t(subkey.expirationTime()), + Qt::UTC).toString(u"yyyyMMdd'T'hhmmss").toStdString(); interactor->setExpiry(expiry); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeadduseridjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeadduseridjob.h
Changed
@@ -59,7 +59,7 @@ ~QGpgMEAddUserIDJob(); /* from AddUserIDJob */ - GpgME::Error start(const GpgME::Key &key, const QString &name, const QString &email, const QString &comment) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, const QString &name, const QString &email, const QString &comment) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmechangeexpiryjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmechangeexpiryjob.cpp
Changed
@@ -5,7 +5,7 @@ Copyright (c) 2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH - Copyright (c) 2021 g10 Code GmbH + Copyright (c) 2021,2023 g10 Code GmbH Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or @@ -40,6 +40,8 @@ #include "qgpgmechangeexpiryjob.h" +#include "changeexpiryjob_p.h" + #include "context.h" #include "key.h" @@ -48,9 +50,40 @@ using namespace QGpgME; using namespace GpgME; +namespace +{ + +class QGpgMEChangeExpiryJobPrivate : public ChangeExpiryJobPrivate +{ + QGpgMEChangeExpiryJob *q = nullptr; + +public: + QGpgMEChangeExpiryJobPrivate(QGpgMEChangeExpiryJob *qq) + : q{qq} + { + } + + ~QGpgMEChangeExpiryJobPrivate() override = default; + +private: + GpgME::Error startIt() override + { + Q_ASSERT(!"Not supported by this Job class."); + return Error::fromCode(GPG_ERR_NOT_SUPPORTED); + } + + void startNow() override + { + q->run(); + } +}; + +} + QGpgMEChangeExpiryJob::QGpgMEChangeExpiryJob(Context *context) : mixin_type(context) { + setJobPrivate(this, std::unique_ptr<QGpgMEChangeExpiryJobPrivate>{new QGpgMEChangeExpiryJobPrivate{this}}); lateInitialization(); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmechangeexpiryjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmechangeexpiryjob.h
Changed
@@ -59,11 +59,11 @@ ~QGpgMEChangeExpiryJob(); /* from ChangeExpiryJob */ - GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry) override; /* from ChangeExpiryJob */ GpgME::Error start(const GpgME::Key &key, const QDateTime &expiry, - const std::vector<GpgME::Subkey> &subkeys) Q_DECL_OVERRIDE; + const std::vector<GpgME::Subkey> &subkeys) override; };
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmechangeownertrustjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmechangeownertrustjob.h
Changed
@@ -59,7 +59,7 @@ ~QGpgMEChangeOwnerTrustJob(); /* from ChangeOwnerTrustJob */ - GpgME::Error start(const GpgME::Key &key, GpgME::Key::OwnerTrust trust) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, GpgME::Key::OwnerTrust trust) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmechangepasswdjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmechangepasswdjob.h
Changed
@@ -59,7 +59,7 @@ ~QGpgMEChangePasswdJob(); /* from ChangePasswdJob */ - GpgME::Error start(const GpgME::Key &key) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmedecryptjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedecryptjob.cpp
Changed
@@ -71,7 +71,10 @@ const _detail::ToThreadMover ptMover(plainText, thread); QGpgME::QIODeviceDataProvider in(cipherText); - const Data indata(&in); + Data indata(&in); + if (!cipherText->isSequential()) { + indata.setSizeHint(cipherText->size()); + } if (!plainText) { QGpgME::QByteArrayDataProvider out;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmedecryptjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedecryptjob.h
Changed
@@ -65,17 +65,17 @@ ~QGpgMEDecryptJob(); /* from DecryptJob */ - GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &cipherText) override; /* from DecryptJob */ - void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) override; /* from DecryptJob */ GpgME::DecryptionResult exec(const QByteArray &cipherText, - QByteArray &plainText) Q_DECL_OVERRIDE; + QByteArray &plainText) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::DecryptionResult mResult;
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedecryptverifyarchivejob.cpp
Added
@@ -0,0 +1,158 @@ +/* + qgpgmedecryptverifyarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmedecryptverifyarchivejob.h" + +#include "dataprovider.h" +#include "decryptverifyarchivejob_p.h" + +#include <QFile> + +#include <data.h> + +using namespace QGpgME; +using namespace GpgME; + +namespace +{ + +class QGpgMEDecryptVerifyArchiveJobPrivate : public DecryptVerifyArchiveJobPrivate +{ + QGpgMEDecryptVerifyArchiveJob *q = nullptr; + +public: + QGpgMEDecryptVerifyArchiveJobPrivate(QGpgMEDecryptVerifyArchiveJob *qq) + : q{qq} + { + } + + ~QGpgMEDecryptVerifyArchiveJobPrivate() override = default; + +private: + GpgME::Error startIt() override; + + void startNow() override + { + q->run(); + } +}; + +} + +QGpgMEDecryptVerifyArchiveJob::QGpgMEDecryptVerifyArchiveJob(Context *context) + : mixin_type{context} +{ + setJobPrivate(this, std::unique_ptr<QGpgMEDecryptVerifyArchiveJobPrivate>{new QGpgMEDecryptVerifyArchiveJobPrivate{this}}); + lateInitialization(); + connect(this, &Job::rawProgress, this, this(const QString &what, int type, int current, int total) { + emitArchiveProgressSignals(this, what, type, current, total); + }); +} + +static QGpgMEDecryptVerifyArchiveJob::result_type decrypt_verify(Context *ctx, + const GpgME::Data &indata, + const QString &outputDirectory) +{ + Data outdata; + if (!outputDirectory.isEmpty()) { + outdata.setFileName(outputDirectory.toStdString()); + } + + const auto res = ctx->decryptAndVerify(indata, outdata, Context::DecryptArchive); + Error ae; + const QString log = _detail::audit_log_as_html(ctx, ae); + return std::make_tuple(res.first, res.second, log, ae); +} + +static QGpgMEDecryptVerifyArchiveJob::result_type decrypt_verify_from_io_device(Context *ctx, + QThread *thread, + const std::weak_ptr<QIODevice> &cipherText_, + const QString &outputDirectory) +{ + const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); + const _detail::ToThreadMover ctMover(cipherText, thread); + QGpgME::QIODeviceDataProvider in{cipherText}; + Data indata(&in); + if (!cipherText->isSequential()) { + indata.setSizeHint(cipherText->size()); + } + + return decrypt_verify(ctx, indata, outputDirectory); +} + +static QGpgMEDecryptVerifyArchiveJob::result_type decrypt_verify_from_file_name(Context *ctx, + const QString &inputFile, + const QString &outputDirectory) +{ + Data indata; + indata.setFileName(QFile::encodeName(inputFile).constData()); + + return decrypt_verify(ctx, indata, outputDirectory); +} + +GpgME::Error QGpgMEDecryptVerifyArchiveJob::start(const std::shared_ptr<QIODevice> &cipherText) +{ + if (!cipherText) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + run(std::bind(&decrypt_verify_from_io_device, + std::placeholders::_1, + std::placeholders::_2, + std::placeholders::_3, + outputDirectory()), + cipherText); + return {}; +} + +GpgME::Error QGpgMEDecryptVerifyArchiveJobPrivate::startIt() +{ + if (m_inputFilePath.isEmpty()) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + q->run(=(Context *ctx) { + return decrypt_verify_from_file_name(ctx, m_inputFilePath, m_outputDirectory); + }); + + return {}; +} + +#include "qgpgmedecryptverifyarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedecryptverifyarchivejob.h
Added
@@ -0,0 +1,68 @@ +/* + qgpgmedecryptverifyarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMEDECRYPTVERIFYARCHIVEJOB_H__ +#define __QGPGME_QGPGMEDECRYPTVERIFYARCHIVEJOB_H__ + +#include "decryptverifyarchivejob.h" + +#include "threadedjobmixin.h" + +#include <decryptionresult.h> +#include <verificationresult.h> + +namespace QGpgME +{ + +class QGpgMEDecryptVerifyArchiveJob +#ifdef Q_MOC_RUN + : public DecryptVerifyArchiveJob +#else + : public _detail::ThreadedJobMixin<DecryptVerifyArchiveJob, std::tuple<GpgME::DecryptionResult, GpgME::VerificationResult, QString, GpgME::Error>> +#endif +{ + Q_OBJECT +#ifdef Q_MOC_RUN +public Q_SLOTS: + void slotFinished(); +#endif +public: + explicit QGpgMEDecryptVerifyArchiveJob(GpgME::Context *context); + ~QGpgMEDecryptVerifyArchiveJob() = default; + + GpgME::Error start(const std::shared_ptr<QIODevice> &cipherText) override; +}; + +} + +#endif // __QGPGME_QGPGMEDECRYPTVERIFYARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmedecryptverifyjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedecryptverifyjob.cpp
Changed
@@ -67,8 +67,7 @@ const std::weak_ptr<QIODevice> &cipherText_, const std::weak_ptr<QIODevice> &plainText_) { - - qCDebug(QGPGME_LOG); + qCDebug(QGPGME_LOG) << __func__; const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); const std::shared_ptr<QIODevice> plainText = plainText_.lock(); @@ -77,7 +76,10 @@ const _detail::ToThreadMover ptMover(plainText, thread); QGpgME::QIODeviceDataProvider in(cipherText); - const Data indata(&in); + Data indata(&in); + if (!cipherText->isSequential()) { + indata.setSizeHint(cipherText->size()); + } if (!plainText) { QGpgME::QByteArrayDataProvider out; @@ -86,7 +88,7 @@ const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - qCDebug(QGPGME_LOG) << "End no plainText. Error: " << ae; + qCDebug(QGPGME_LOG) << __func__ << "- End no plainText. Error:" << ae.asString(); return std::make_tuple(res.first, res.second, out.data(), log, ae); } else { QGpgME::QIODeviceDataProvider out(plainText); @@ -95,10 +97,9 @@ const std::pair<DecryptionResult, VerificationResult> res = ctx->decryptAndVerify(indata, outdata); Error ae; const QString log = _detail::audit_log_as_html(ctx, ae); - qCDebug(QGPGME_LOG) << "End plainText. Error: " << ae; + qCDebug(QGPGME_LOG) << __func__ << "- End plainText. Error:" << ae.asString(); return std::make_tuple(res.first, res.second, QByteArray(), log, ae); } - } static QGpgMEDecryptVerifyJob::result_type decrypt_verify_qba(Context *ctx, const QByteArray &cipherText)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmedecryptverifyjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedecryptverifyjob.h
Changed
@@ -70,17 +70,17 @@ ~QGpgMEDecryptVerifyJob(); /* from DecryptVerifyJob */ - GpgME::Error start(const QByteArray &cipherText) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &cipherText) override; /* from DecryptVerifyJob */ - void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &cipherText, const std::shared_ptr<QIODevice> &plainText) override; /* from DecryptVerifyJob */ std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> - exec(const QByteArray &cipherText, QByteArray &plainText) Q_DECL_OVERRIDE; + exec(const QByteArray &cipherText, QByteArray &plainText) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: std::pair<GpgME::DecryptionResult, GpgME::VerificationResult> mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmedeletejob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedeletejob.h
Changed
@@ -64,7 +64,7 @@ ~QGpgMEDeleteJob(); /* from DeleteJob */ - GpgME::Error start(const GpgME::Key &key, bool allowSecretKeyDeletion) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key, bool allowSecretKeyDeletion) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmedownloadjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmedownloadjob.h
Changed
@@ -59,10 +59,10 @@ ~QGpgMEDownloadJob(); /* from DownloadJob */ - GpgME::Error start(const QStringList &fingerprints) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &fingerprints) override; /* from DownloadJob */ - GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr<QIODevice> &keyData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &fingerprint, const std::shared_ptr<QIODevice> &keyData) override; }; }
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeencryptarchivejob.cpp
Added
@@ -0,0 +1,173 @@ +/* + qgpgmeencryptarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmeencryptarchivejob.h" + +#include "dataprovider.h" +#include "encryptarchivejob_p.h" +#include "filelistdataprovider.h" + +#include <QFile> + +#include <data.h> + +using namespace QGpgME; +using namespace GpgME; + +namespace +{ + +class QGpgMEEncryptArchiveJobPrivate : public EncryptArchiveJobPrivate +{ + QGpgMEEncryptArchiveJob *q = nullptr; + +public: + QGpgMEEncryptArchiveJobPrivate(QGpgMEEncryptArchiveJob *qq) + : q{qq} + { + } + + ~QGpgMEEncryptArchiveJobPrivate() override = default; + +private: + GpgME::Error startIt() override; + + void startNow() override + { + q->run(); + } +}; + +} + +QGpgMEEncryptArchiveJob::QGpgMEEncryptArchiveJob(Context *context) + : mixin_type{context} +{ + setJobPrivate(this, std::unique_ptr<QGpgMEEncryptArchiveJobPrivate>{new QGpgMEEncryptArchiveJobPrivate{this}}); + lateInitialization(); + connect(this, &Job::rawProgress, this, this(const QString &what, int type, int current, int total) { + emitArchiveProgressSignals(this, what, type, current, total); + }); +} + +static QGpgMEEncryptArchiveJob::result_type encrypt(Context *ctx, + const std::vector<Key> &recipients, + const std::vector<QString> &paths, + GpgME::Data &outdata, + Context::EncryptionFlags flags, + const QString &baseDirectory) +{ + QGpgME::FileListDataProvider in{paths}; + Data indata(&in); + if (!baseDirectory.isEmpty()) { + indata.setFileName(baseDirectory.toStdString()); + } + + flags = static_cast<Context::EncryptionFlags>(flags | Context::EncryptArchive); + const EncryptionResult res = ctx->encrypt(recipients, indata, outdata, flags); + Error ae; + const QString log = _detail::audit_log_as_html(ctx, ae); + return std::make_tuple(res, log, ae); +} + +static QGpgMEEncryptArchiveJob::result_type encrypt_to_io_device(Context *ctx, + QThread *thread, + const std::vector<Key> &recipients, + const std::vector<QString> &paths, + const std::weak_ptr<QIODevice> &cipherText_, + Context::EncryptionFlags flags, + const QString &baseDirectory) +{ + const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); + const _detail::ToThreadMover ctMover(cipherText, thread); + QGpgME::QIODeviceDataProvider out{cipherText}; + Data outdata(&out); + + return encrypt(ctx, recipients, paths, outdata, flags, baseDirectory); +} + +static QGpgMEEncryptArchiveJob::result_type encrypt_to_filename(Context *ctx, + const std::vector<Key> &recipients, + const std::vector<QString> &paths, + const QString &outputFile, + Context::EncryptionFlags flags, + const QString &baseDirectory) +{ + Data outdata; + outdata.setFileName(QFile::encodeName(outputFile).constData()); + + return encrypt(ctx, recipients, paths, outdata, flags, baseDirectory); +} + +GpgME::Error QGpgMEEncryptArchiveJob::start(const std::vector<GpgME::Key> &recipients, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &cipherText, + const GpgME::Context::EncryptionFlags flags) +{ + if (!cipherText) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + run(std::bind(&encrypt_to_io_device, + std::placeholders::_1, + std::placeholders::_2, + recipients, + paths, + std::placeholders::_3, + flags, + baseDirectory()), + cipherText); + return {}; +} + +GpgME::Error QGpgMEEncryptArchiveJobPrivate::startIt() +{ + if (m_outputFilePath.isEmpty()) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + q->run(=(Context *ctx) { + return encrypt_to_filename(ctx, m_recipients, m_inputPaths, m_outputFilePath, m_encryptionFlags, m_baseDirectory); + }); + + return {}; +} + +#include "qgpgmeencryptarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeencryptarchivejob.h
Added
@@ -0,0 +1,70 @@ +/* + qgpgmeencryptarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMEENCRYPTARCHIVEJOB_H__ +#define __QGPGME_QGPGMEENCRYPTARCHIVEJOB_H__ + +#include "encryptarchivejob.h" + +#include "threadedjobmixin.h" + +#include <encryptionresult.h> + +namespace QGpgME +{ + +class QGpgMEEncryptArchiveJob +#ifdef Q_MOC_RUN + : public EncryptArchiveJob +#else + : public _detail::ThreadedJobMixin<EncryptArchiveJob, std::tuple<GpgME::EncryptionResult, QString, GpgME::Error>> +#endif +{ + Q_OBJECT +#ifdef Q_MOC_RUN +public Q_SLOTS: + void slotFinished(); +#endif +public: + explicit QGpgMEEncryptArchiveJob(GpgME::Context *context); + ~QGpgMEEncryptArchiveJob() = default; + + GpgME::Error start(const std::vector<GpgME::Key> &recipients, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &cipherText, + const GpgME::Context::EncryptionFlags flags) override; +}; + +} + +#endif // __QGPGME_QGPGMEENCRYPTARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeencryptjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeencryptjob.cpp
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -38,6 +40,8 @@ #include "qgpgmeencryptjob.h" +#include "encryptjob_p.h" + #include "dataprovider.h" #include "context.h" @@ -45,17 +49,48 @@ #include "data.h" #include <QBuffer> - +#include <QFileInfo> #include <cassert> using namespace QGpgME; using namespace GpgME; +namespace +{ + +class QGpgMEEncryptJobPrivate : public EncryptJobPrivate +{ + QGpgMEEncryptJob *q = nullptr; + +public: + QGpgMEEncryptJobPrivate(QGpgMEEncryptJob *qq) + : q{qq} + { + } + + ~QGpgMEEncryptJobPrivate() override = default; + +private: + GpgME::Error startIt() override + { + Q_ASSERT(!"Not supported by this Job class."); + return Error::fromCode(GPG_ERR_NOT_SUPPORTED); + } + + void startNow() override + { + q->run(); + } +}; + +} + QGpgMEEncryptJob::QGpgMEEncryptJob(Context *context) : mixin_type(context), mOutputIsBase64Encoded(false) { + setJobPrivate(this, std::unique_ptr<QGpgMEEncryptJobPrivate>{new QGpgMEEncryptJobPrivate{this}}); lateInitialization(); } @@ -71,7 +106,8 @@ const std::weak_ptr<QIODevice> &plainText_, const std::weak_ptr<QIODevice> &cipherText_, const Context::EncryptionFlags eflags, - bool outputIsBsse64Encoded) + bool outputIsBsse64Encoded, + const QString &fileName) { const std::shared_ptr<QIODevice> plainText = plainText_.lock(); @@ -81,7 +117,15 @@ const _detail::ToThreadMover ptMover(plainText, thread); QGpgME::QIODeviceDataProvider in(plainText); - const Data indata(&in); + Data indata(&in); + if (!plainText->isSequential()) { + indata.setSizeHint(plainText->size()); + } + + const auto pureFileName = QFileInfo{fileName}.fileName().toStdString(); + if (!pureFileName.empty()) { + indata.setFileName(pureFileName.c_str()); + } if (!cipherText) { QGpgME::QByteArrayDataProvider out; @@ -111,20 +155,20 @@ } -static QGpgMEEncryptJob::result_type encrypt_qba(Context *ctx, const std::vector<Key> &recipients, const QByteArray &plainText, const Context::EncryptionFlags eflags, bool outputIsBsse64Encoded) +static QGpgMEEncryptJob::result_type encrypt_qba(Context *ctx, const std::vector<Key> &recipients, const QByteArray &plainText, const Context::EncryptionFlags eflags, bool outputIsBsse64Encoded, const QString &fileName) { const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(plainText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return encrypt(ctx, nullptr, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded); + return encrypt(ctx, nullptr, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded, fileName); } Error QGpgMEEncryptJob::start(const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) { run(std::bind(&encrypt_qba, std::placeholders::_1, recipients, plainText, - alwaysTrust ? Context::AlwaysTrust : Context::None, mOutputIsBase64Encoded)); + alwaysTrust ? Context::AlwaysTrust : Context::None, mOutputIsBase64Encoded, fileName())); return Error(); } @@ -136,14 +180,15 @@ recipients, std::placeholders::_3, std::placeholders::_4, eflags, - mOutputIsBase64Encoded), + mOutputIsBase64Encoded, + fileName()), plainText, cipherText); } EncryptionResult QGpgMEEncryptJob::exec(const std::vector<Key> &recipients, const QByteArray &plainText, const Context::EncryptionFlags eflags, QByteArray &cipherText) { - const result_type r = encrypt_qba(context(), recipients, plainText, eflags, mOutputIsBase64Encoded); + const result_type r = encrypt_qba(context(), recipients, plainText, eflags, mOutputIsBase64Encoded, fileName()); cipherText = std::get<1>(r); resultHook(r); return mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeencryptjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeencryptjob.h
Changed
@@ -71,34 +71,34 @@ /* from EncryptJob */ GpgME::Error start(const std::vector<GpgME::Key> &recipients, - const QByteArray &plainText, bool alwaysTrust) Q_DECL_OVERRIDE; + const QByteArray &plainText, bool alwaysTrust) override; /* from EncryptJob */ void start(const std::vector<GpgME::Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, - bool alwaysTrust) Q_DECL_OVERRIDE; + bool alwaysTrust) override; /* from EncryptJob */ GpgME::EncryptionResult exec(const std::vector<GpgME::Key> &recipients, const QByteArray &plainText, bool alwaysTrust, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; /* from EncryptJob */ void start(const std::vector<GpgME::Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, - const GpgME::Context::EncryptionFlags flags) Q_DECL_OVERRIDE; + const GpgME::Context::EncryptionFlags flags) override; /* from EncryptJob */ GpgME::EncryptionResult exec(const std::vector<GpgME::Key> &recipients, const QByteArray &plainText, const GpgME::Context::EncryptionFlags flags, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; /* from EncryptJob */ - void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; + void setOutputIsBase64Encoded(bool on) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: bool mOutputIsBase64Encoded;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeexportjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeexportjob.h
Changed
@@ -62,13 +62,13 @@ // export mode flags set with @p exportMode cannot be overridden with // setExportFlags. explicit QGpgMEExportJob(GpgME::Context *context, unsigned int exportMode); - ~QGpgMEExportJob() Q_DECL_OVERRIDE; + ~QGpgMEExportJob() override; /* from ExportJob */ - void setExportFlags(unsigned int flags) Q_DECL_OVERRIDE; + void setExportFlags(unsigned int flags) override; /* from ExportJob */ - GpgME::Error start(const QStringList &patterns) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns) override; private: unsigned int m_exportMode;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmegpgcardjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmegpgcardjob.h
Changed
@@ -54,9 +54,9 @@ explicit QGpgMEGpgCardJob(); ~QGpgMEGpgCardJob(); - GpgME::Error start(const QStringList &cmds) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &cmds) override; - GpgME::Error exec(const QStringList &cmds, QString &std_out, QString &std_err, int &exitCode) Q_DECL_OVERRIDE; + GpgME::Error exec(const QStringList &cmds, QString &std_out, QString &std_err, int &exitCode) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeimportfromkeyserverjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeimportfromkeyserverjob.h
Changed
@@ -65,13 +65,13 @@ ~QGpgMEImportFromKeyserverJob(); /* from ImportFromKeyserverJob */ - GpgME::Error start(const std::vector<GpgME::Key> &keys) Q_DECL_OVERRIDE; + GpgME::Error start(const std::vector<GpgME::Key> &keys) override; /* from ImportFromKeyserverJob */ - GpgME::ImportResult exec(const std::vector<GpgME::Key> &keys) Q_DECL_OVERRIDE; + GpgME::ImportResult exec(const std::vector<GpgME::Key> &keys) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::ImportResult mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeimportjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeimportjob.cpp
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -38,6 +40,8 @@ #include "qgpgmeimportjob.h" +#include "importjob_p.h" + #include "dataprovider.h" #include <context.h> @@ -47,9 +51,40 @@ using namespace QGpgME; using namespace GpgME; +namespace +{ + +class QGpgMEImportJobPrivate : public ImportJobPrivate +{ + QGpgMEImportJob *q = nullptr; + +public: + QGpgMEImportJobPrivate(QGpgMEImportJob *qq) + : q{qq} + { + } + + ~QGpgMEImportJobPrivate() override = default; + +private: + GpgME::Error startIt() override + { + Q_ASSERT(!"Not supported by this Job class."); + return Error::fromCode(GPG_ERR_NOT_SUPPORTED); + } + + void startNow() override + { + q->run(); + } +}; + +} + QGpgMEImportJob::QGpgMEImportJob(Context *context) : mixin_type(context) { + setJobPrivate(this, std::unique_ptr<QGpgMEImportJobPrivate>{new QGpgMEImportJobPrivate{this}}); lateInitialization(); } @@ -125,6 +160,12 @@ return mResult; } +Error QGpgMEImportJob::startLater(const QByteArray &certData) +{ + setWorkerFunction(std::bind(&import_qba, std::placeholders::_1, certData, importFilter(), keyOrigin(), keyOriginUrl())); + return {}; +} + // PENDING(marc) implement showErrorDialog() void QGpgME::QGpgMEImportJob::resultHook(const result_type &tuple)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeimportjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeimportjob.h
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -65,13 +67,15 @@ ~QGpgMEImportJob(); /* from ImportJob */ - GpgME::Error start(const QByteArray &keyData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &keyData) override; /* from ImportJob */ - GpgME::ImportResult exec(const QByteArray &keyData) Q_DECL_OVERRIDE; + GpgME::ImportResult exec(const QByteArray &keyData) override; + + GpgME::Error startLater(const QByteArray &keyData) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::ImportResult mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmekeyformailboxjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmekeyformailboxjob.cpp
Changed
@@ -71,7 +71,7 @@ static QGpgMEKeyForMailboxJob::result_type do_work(Context *ctx, const QString &mailbox, bool canEncrypt) { /* Do a Keylisting. */ - ctx->setKeyListMode(GpgME::Extern | GpgME::Local | GpgME::Signatures | GpgME::Validate); + ctx->setKeyListMode(GpgME::Locate | GpgME::Signatures | GpgME::Validate); std::vector<Key> keys; QGpgMEKeyListJob *keylist = new QGpgMEKeyListJob(ctx);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmekeyformailboxjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmekeyformailboxjob.h
Changed
@@ -76,9 +76,9 @@ usage are returned. Use this if you need to select a key for signing. */ - GpgME::Error start(const QString &mailbox, bool canEncrypt = true) Q_DECL_OVERRIDE; + GpgME::Error start(const QString &mailbox, bool canEncrypt = true) override; - GpgME::KeyListResult exec(const QString &mailbox, bool canEncrypt, GpgME::Key &key, GpgME::UserID &uid) Q_DECL_OVERRIDE; + GpgME::KeyListResult exec(const QString &mailbox, bool canEncrypt, GpgME::Key &key, GpgME::UserID &uid) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmekeygenerationjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmekeygenerationjob.h
Changed
@@ -65,7 +65,7 @@ ~QGpgMEKeyGenerationJob(); /* from KeygenerationJob */ - GpgME::Error start(const QString ¶meters) Q_DECL_OVERRIDE; + GpgME::Error start(const QString ¶meters) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmekeylistjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmekeylistjob.h
Changed
@@ -70,15 +70,15 @@ ~QGpgMEKeyListJob(); /* from KeyListJob */ - GpgME::Error start(const QStringList &patterns, bool secretOnly) Q_DECL_OVERRIDE; + GpgME::Error start(const QStringList &patterns, bool secretOnly) override; /* from KeyListJob */ - GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector<GpgME::Key> &keys) Q_DECL_OVERRIDE; + GpgME::KeyListResult exec(const QStringList &patterns, bool secretOnly, std::vector<GpgME::Key> &keys) override; - void addMode(GpgME::KeyListMode mode) Q_DECL_OVERRIDE; + void addMode(GpgME::KeyListMode mode) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &result) Q_DECL_OVERRIDE; + void resultHook(const result_type &result) override; private: GpgME::KeyListResult mResult; bool mSecretOnly;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmelistallkeysjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmelistallkeysjob.cpp
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -38,11 +40,15 @@ #include "qgpgmelistallkeysjob.h" +#include "listallkeysjob_p.h" + +#include "debug.h" #include "key.h" #include "context.h" #include "engineinfo.h" #include "global.h" #include "keylistresult.h" +#include "qgpgme_debug.h" #include <gpg-error.h> @@ -55,10 +61,41 @@ using namespace QGpgME; using namespace GpgME; +namespace +{ + +class QGpgMEListAllKeysJobPrivate : public ListAllKeysJobPrivate +{ + QGpgMEListAllKeysJob *q = nullptr; + +public: + QGpgMEListAllKeysJobPrivate(QGpgMEListAllKeysJob *qq) + : q{qq} + { + } + + ~QGpgMEListAllKeysJobPrivate() override = default; + +private: + GpgME::Error startIt() override + { + Q_ASSERT(!"Not supported by this Job class."); + return Error::fromCode(GPG_ERR_NOT_SUPPORTED); + } + + void startNow() override + { + q->run(); + } +}; + +} + QGpgMEListAllKeysJob::QGpgMEListAllKeysJob(Context *context) : mixin_type(context), mResult() { + setJobPrivate(this, std::unique_ptr<QGpgMEListAllKeysJobPrivate>{new QGpgMEListAllKeysJobPrivate{this}}); lateInitialization(); } @@ -162,12 +199,20 @@ return result; } -static QGpgMEListAllKeysJob::result_type list_keys(Context *ctx, bool mergeKeys) +static QGpgMEListAllKeysJob::result_type list_keys(Context *ctx, bool mergeKeys, ListAllKeysJob::Options options) { if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.0") { return list_keys_legacy(ctx, mergeKeys); } + if (options & ListAllKeysJob::DisableAutomaticTrustDatabaseCheck) { + auto err = ctx->setFlag("no-auto-check-trustdb", "1"); + if (err) { + // ignore error, but log a warning + qCWarning(QGPGME_LOG) << "Setting context flag no-auto-check-trustdb failed:" << err; + } + } + std::vector<Key> keys; KeyListResult r = do_list_keys(ctx, keys); std::sort(keys.begin(), keys.end(), ByFingerprint<std::less>()); @@ -182,13 +227,13 @@ Error QGpgMEListAllKeysJob::start(bool mergeKeys) { - run(std::bind(&list_keys, std::placeholders::_1, mergeKeys)); + run(std::bind(&list_keys, std::placeholders::_1, mergeKeys, options())); return Error(); } KeyListResult QGpgMEListAllKeysJob::exec(std::vector<Key> &pub, std::vector<Key> &sec, bool mergeKeys) { - const result_type r = list_keys(context(), mergeKeys); + const result_type r = list_keys(context(), mergeKeys, options()); resultHook(r); pub = std::get<1>(r); sec = std::get<2>(r);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmelistallkeysjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmelistallkeysjob.h
Changed
@@ -70,13 +70,13 @@ ~QGpgMEListAllKeysJob(); /* from ListAllKeysJob */ - GpgME::Error start(bool mergeKeys) Q_DECL_OVERRIDE; + GpgME::Error start(bool mergeKeys) override; /* from ListAllKeysJob */ - GpgME::KeyListResult exec(std::vector<GpgME::Key> &pub, std::vector<GpgME::Key> &sec, bool mergeKeys) Q_DECL_OVERRIDE; + GpgME::KeyListResult exec(std::vector<GpgME::Key> &pub, std::vector<GpgME::Key> &sec, bool mergeKeys) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &result) Q_DECL_OVERRIDE; + void resultHook(const result_type &result) override; private: GpgME::KeyListResult mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmenewcryptoconfig.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmenewcryptoconfig.cpp
Changed
@@ -59,22 +59,6 @@ using namespace GpgME; using namespace GpgME::Configuration; -namespace -{ -struct Select1St { - template <typename U, typename V> - const U &operator()(const std::pair<U, V> &p) const - { - return p.first; - } - template <typename U, typename V> - const U &operator()(const QPair<U, V> &p) const - { - return p.first; - } -}; -} - // Just for the Q_ASSERT in the dtor. Not thread-safe, but who would // have 2 threads talking to gpgconf anyway? :) static bool s_duringClear = false; @@ -660,7 +644,7 @@ if (str.isEmpty() && !isOptional()) { m_option.resetToDefaultValue(); } else if (type == FilenameType) { - m_option.setNewValue(m_option.createStringArgument(QDir::toNativeSeparators(url.toLocalFile()).toUtf8().constData())); + m_option.setNewValue(m_option.createStringArgument(url.toLocalFile().toUtf8().constData())); } else { m_option.setNewValue(m_option.createStringArgument(str.toUtf8().constData())); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmenewcryptoconfig.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmenewcryptoconfig.h
Changed
@@ -63,36 +63,36 @@ QGpgMENewCryptoConfigEntry(const std::shared_ptr<QGpgMENewCryptoConfigGroup> &group, const GpgME::Configuration::Option &option); ~QGpgMENewCryptoConfigEntry(); - QString name() const Q_DECL_OVERRIDE; - QString description() const Q_DECL_OVERRIDE; - QString path() const Q_DECL_OVERRIDE; - bool isOptional() const Q_DECL_OVERRIDE; - bool isReadOnly() const Q_DECL_OVERRIDE; - bool isList() const Q_DECL_OVERRIDE; - bool isRuntime() const Q_DECL_OVERRIDE; - Level level() const Q_DECL_OVERRIDE; - ArgType argType() const Q_DECL_OVERRIDE; - bool isSet() const Q_DECL_OVERRIDE; - bool boolValue() const Q_DECL_OVERRIDE; - QString stringValue() const Q_DECL_OVERRIDE; - int intValue() const Q_DECL_OVERRIDE; - unsigned int uintValue() const Q_DECL_OVERRIDE; - QUrl urlValue() const Q_DECL_OVERRIDE; - unsigned int numberOfTimesSet() const Q_DECL_OVERRIDE; - std::vector<int> intValueList() const Q_DECL_OVERRIDE; - std::vector<unsigned int> uintValueList() const Q_DECL_OVERRIDE; - QList<QUrl> urlValueList() const Q_DECL_OVERRIDE; - void resetToDefault() Q_DECL_OVERRIDE; - void setBoolValue(bool) Q_DECL_OVERRIDE; - void setStringValue(const QString &) Q_DECL_OVERRIDE; - void setIntValue(int) Q_DECL_OVERRIDE; - void setUIntValue(unsigned int) Q_DECL_OVERRIDE; - void setURLValue(const QUrl &) Q_DECL_OVERRIDE; - void setNumberOfTimesSet(unsigned int) Q_DECL_OVERRIDE; - void setIntValueList(const std::vector<int> &) Q_DECL_OVERRIDE; - void setUIntValueList(const std::vector<unsigned int> &) Q_DECL_OVERRIDE; - void setURLValueList(const QList<QUrl> &) Q_DECL_OVERRIDE; - bool isDirty() const Q_DECL_OVERRIDE; + QString name() const override; + QString description() const override; + QString path() const override; + bool isOptional() const override; + bool isReadOnly() const override; + bool isList() const override; + bool isRuntime() const override; + Level level() const override; + ArgType argType() const override; + bool isSet() const override; + bool boolValue() const override; + QString stringValue() const override; + int intValue() const override; + unsigned int uintValue() const override; + QUrl urlValue() const override; + unsigned int numberOfTimesSet() const override; + std::vector<int> intValueList() const override; + std::vector<unsigned int> uintValueList() const override; + QList<QUrl> urlValueList() const override; + void resetToDefault() override; + void setBoolValue(bool) override; + void setStringValue(const QString &) override; + void setIntValue(int) override; + void setUIntValue(unsigned int) override; + void setURLValue(const QUrl &) override; + void setNumberOfTimesSet(unsigned int) override; + void setIntValueList(const std::vector<int> &) override; + void setUIntValueList(const std::vector<unsigned int> &) override; + void setURLValueList(const QList<QUrl> &) override; + bool isDirty() const override; QStringList stringValueList() const; QVariant defaultValue() const; @@ -117,16 +117,16 @@ QGpgMENewCryptoConfigGroup(const std::shared_ptr<QGpgMENewCryptoConfigComponent> &parent, const GpgME::Configuration::Option &option); ~QGpgMENewCryptoConfigGroup(); - QString name() const Q_DECL_OVERRIDE; - QString iconName() const Q_DECL_OVERRIDE + QString name() const override; + QString iconName() const override { return QString(); } - QString description() const Q_DECL_OVERRIDE; - QString path() const Q_DECL_OVERRIDE; - QGpgME::CryptoConfigEntry::Level level() const Q_DECL_OVERRIDE; - QStringList entryList() const Q_DECL_OVERRIDE; - QGpgMENewCryptoConfigEntry *entry(const QString &name) const Q_DECL_OVERRIDE; + QString description() const override; + QString path() const override; + QGpgME::CryptoConfigEntry::Level level() const override; + QStringList entryList() const override; + QGpgMENewCryptoConfigEntry *entry(const QString &name) const override; private: friend class QGpgMENewCryptoConfigComponent; // it adds the entries @@ -145,14 +145,14 @@ void setComponent(const GpgME::Configuration::Component &component); - QString name() const Q_DECL_OVERRIDE; - QString iconName() const Q_DECL_OVERRIDE + QString name() const override; + QString iconName() const override { return name(); } - QString description() const Q_DECL_OVERRIDE; - QStringList groupList() const Q_DECL_OVERRIDE; - QGpgMENewCryptoConfigGroup *group(const QString &name) const Q_DECL_OVERRIDE; + QString description() const override; + QStringList groupList() const override; + QGpgMENewCryptoConfigGroup *group(const QString &name) const override; void sync(bool runtime); @@ -174,12 +174,12 @@ QGpgMENewCryptoConfig(); ~QGpgMENewCryptoConfig(); - QStringList componentList() const Q_DECL_OVERRIDE; + QStringList componentList() const override; - QGpgMENewCryptoConfigComponent *component(const QString &name) const Q_DECL_OVERRIDE; + QGpgMENewCryptoConfigComponent *component(const QString &name) const override; - void clear() Q_DECL_OVERRIDE; - void sync(bool runtime) Q_DECL_OVERRIDE; + void clear() override; + void sync(bool runtime) override; private: /// @param showErrors if true, a messagebox will be shown if e.g. gpgconf wasn't found
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmequickjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmequickjob.h
Changed
@@ -63,14 +63,14 @@ const char *algo, const QDateTime &expires = QDateTime(), const GpgME::Key &key = GpgME::Key(), - unsigned int flags = 0) Q_DECL_OVERRIDE; - void startAddUid(const GpgME::Key &key, const QString &uid) Q_DECL_OVERRIDE; - void startRevUid(const GpgME::Key &key, const QString &uid) Q_DECL_OVERRIDE; + unsigned int flags = 0) override; + void startAddUid(const GpgME::Key &key, const QString &uid) override; + void startRevUid(const GpgME::Key &key, const QString &uid) override; void startAddSubkey(const GpgME::Key &key, const char *algo, const QDateTime &expires = QDateTime(), - unsigned int flags = 0) Q_DECL_OVERRIDE; + unsigned int flags = 0) override; void startRevokeSignature(const GpgME::Key &key, const GpgME::Key &signingKey, - const std::vector<GpgME::UserID> &userIds = std::vector<GpgME::UserID>()) Q_DECL_OVERRIDE; + const std::vector<GpgME::UserID> &userIds = std::vector<GpgME::UserID>()) override; }; }
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmerefreshsmimekeysjob.cpp
Added
@@ -0,0 +1,256 @@ +/* + qgpgmerefreshsmimekeysjob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2004 Klarävdalens Datakonsult AB + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#define MAX_CMD_LENGTH 32768 + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmerefreshsmimekeysjob.h" +#include "util.h" + +#include <QDebug> +#include "qgpgme_debug.h" + +#include "context.h" +#include <key.h> + +#include <QByteArray> +#include <QMetaObject> +#include <QProcess> +#include <QStringList> + +#include <gpg-error.h> + +#include <assert.h> + +using namespace QGpgME; + +QGpgMERefreshSMIMEKeysJob::QGpgMERefreshSMIMEKeysJob() + : RefreshKeysJob(nullptr), + mProcess(nullptr), + mError(0) +{ + +} + +QGpgMERefreshSMIMEKeysJob::~QGpgMERefreshSMIMEKeysJob() +{ + +} + +GpgME::Error QGpgMERefreshSMIMEKeysJob::start(const QStringList &patterns) +{ + assert(mPatternsToDo.empty()); + + mPatternsToDo = patterns; + if (mPatternsToDo.empty()) { + mPatternsToDo.push_back(QStringLiteral(" ")); // empty list means all -> mae + } + // sure to fail the first + // startAProcess() guard clause + + return startAProcess(); +} + +GpgME::Error QGpgMERefreshSMIMEKeysJob::start(const std::vector<GpgME::Key> &keys) +{ + if (keys.empty()) { + QMetaObject::invokeMethod(this, this() { + Q_EMIT slotProcessExited(0, QProcess::NormalExit); + }, Qt::QueuedConnection); + return {}; + } + + const bool gotWrongKeys = std::any_of(std::begin(keys), std::end(keys), (const GpgME::Key &k) { + return k.protocol() != GpgME::CMS; + }); + if (gotWrongKeys) { + qCDebug(QGPGME_LOG) << "Error: At least one of the keys is not an S/MIME key"; + return GpgME::Error::fromCode(GPG_ERR_INV_VALUE); + } + + return start(toFingerprints(keys)); +} + +#if MAX_CMD_LENGTH < 65 + 128 +#error MAX_CMD_LENGTH is too low +#endif + +GpgME::Error QGpgMERefreshSMIMEKeysJob::startAProcess() +{ + if (mPatternsToDo.empty()) { + return GpgME::Error(); + } + // create and start gpgsm process: + mProcess = new QProcess(this); + mProcess->setObjectName(QStringLiteral("gpgsm -k --with-validation --force-crl-refresh --enable-crl-checks")); + + // FIXME: obbtain the path to gpgsm from gpgme, so we use the same instance. + mProcess->setProgram(QStringLiteral("gpgsm")); + QStringList arguments; + arguments << QStringLiteral("-k") + << QStringLiteral("--with-validation") + << QStringLiteral("--force-crl-refresh") + << QStringLiteral("--enable-crl-checks"); + unsigned int commandLineLength = MAX_CMD_LENGTH; + commandLineLength -= + strlen("gpgsm") + 1 + strlen("-k") + 1 + + strlen("--with-validation") + 1 + strlen("--force-crl-refresh") + 1 + + strlen("--enable-crl-checks") + 1; + while (!mPatternsToDo.empty()) { + const QByteArray pat = mPatternsToDo.front().toUtf8().trimmed(); + const unsigned int patLength = pat.length(); + if (patLength >= commandLineLength) { + break; + } + mPatternsToDo.pop_front(); + if (pat.isEmpty()) { + continue; + } + arguments << QLatin1String(pat); + commandLineLength -= patLength + 1; + } + + mProcess->setArguments(arguments); + + connect(mProcess, SIGNAL(finished(int,QProcess::ExitStatus)), + SLOT(slotProcessExited(int,QProcess::ExitStatus))); + connect(mProcess, &QProcess::readyReadStandardOutput, this, this() { + qCDebug(QGPGME_LOG) << "stdout:" << mProcess->readAllStandardOutput(); + }); + connect(mProcess, &QProcess::readyReadStandardError, this, this() { + qCDebug(QGPGME_LOG) << "stderr:" << mProcess->readAllStandardError(); + }); + + mProcess->start(); + if (!mProcess->waitForStarted()) { + mError = GpgME::Error::fromCode(GPG_ERR_ENOENT, GPG_ERR_SOURCE_GPGSM); // what else? + deleteLater(); + return mError; + } else { + return GpgME::Error(); + } +} + +void QGpgMERefreshSMIMEKeysJob::slotCancel() +{ + if (mProcess) { + mProcess->kill(); + } + mProcess = nullptr; + mError = GpgME::Error::fromCode(GPG_ERR_CANCELED, GPG_ERR_SOURCE_GPGSM); +} + +void QGpgMERefreshSMIMEKeysJob::slotStatus(QProcess *proc, const QString &type, const QStringList &args) +{ + if (proc != mProcess) { + return; + } + QStringList::const_iterator it = args.begin(); + bool ok = false; + + if (type == QLatin1String("ERROR")) { + + if (args.size() < 2) { + qCDebug(QGPGME_LOG) << "not recognising ERROR with < 2 args!"; + return; + } + const int source = (*++it).toInt(&ok); + if (!ok) { + qCDebug(QGPGME_LOG) << "expected number for first ERROR arg, got something else"; + return; + } + ok = false; + const int code = (*++it).toInt(&ok); + if (!ok) { + qCDebug(QGPGME_LOG) << "expected number for second ERROR arg, got something else"; + return; + } + mError = GpgME::Error::fromCode(code, source); + + } else if (type == QLatin1String("PROGRESS")) { + + if (args.size() < 4) { + qCDebug(QGPGME_LOG) << "not recognising PROGRESS with < 4 args!"; + return; + } + const QString what = *++it; + ok = false; + const int type = (*++it).toInt(&ok); + if (!ok) { + qCDebug(QGPGME_LOG) << "expected number for \"type\", got something else"; + return; + } + ok = false; + const int cur = (*++it).toInt(&ok); + if (!ok) { + qCDebug(QGPGME_LOG) << "expected number for \"cur\", got something else"; + return; + } + ok = false; + const int total = (*++it).toInt(&ok); + if (!ok) { + qCDebug(QGPGME_LOG) << "expected number for \"total\", got something else"; + return; + } + Q_EMIT jobProgress(cur, total); + Q_EMIT rawProgress(what, type, cur, total); + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED + Q_EMIT progress(what, cur, total); + QT_WARNING_POP + } +} + +void QGpgMERefreshSMIMEKeysJob::slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus) +{ + if (!mError && !mPatternsToDo.empty()) { + if (const GpgME::Error err = startAProcess()) { + mError = err; + } else { + return; + } + } + + Q_EMIT done(); + if (!mError && + (exitStatus != QProcess::NormalExit || exitCode != 0)) { + mError = GpgME::Error::fromCode(GPG_ERR_GENERAL, GPG_ERR_SOURCE_GPGSM); + } + Q_EMIT result(mError); + deleteLater(); +} +#include "qgpgmerefreshsmimekeysjob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmerefreshsmimekeysjob.h
Added
@@ -0,0 +1,81 @@ +/* + qgpgmerefreshsmimekeysjob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2004 Klarälvdalens Datakonsult AB + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ +#define __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__ + +#include "refreshkeysjob.h" +#ifdef BUILDING_QGPGME +# include "context.h" +#else +#include "gpgme++/context.h" +#endif + +#include <QStringList> +#include <QProcess> + +namespace QGpgME +{ + +class QGpgMERefreshSMIMEKeysJob : public RefreshKeysJob +{ + Q_OBJECT +public: + QGpgMERefreshSMIMEKeysJob(); + ~QGpgMERefreshSMIMEKeysJob(); + + /* from RefreshKeysJob */ + GpgME::Error start(const QStringList &patterns) override; + + GpgME::Error start(const std::vector<GpgME::Key> &keys) override; + +private Q_SLOTS: + /* from Job */ + void slotCancel() override; + + void slotStatus(QProcess *, const QString &, const QStringList &); + void slotProcessExited(int exitCode, QProcess::ExitStatus exitStatus); + +private: + GpgME::Error startAProcess(); + +private: + QProcess *mProcess; + GpgME::Error mError; + QStringList mPatternsToDo; +}; + +} + +#endif // __QGPGME_QGPGMEREFRESHSMIMEKEYSJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmerevokekeyjob.cpp
Added
@@ -0,0 +1,128 @@ +/* + qgpgmerevokekeyjob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmerevokekeyjob.h" + +#include "dataprovider.h" + +#include <context.h> +#include <data.h> +#include <gpgrevokekeyeditinteractor.h> +#include <key.h> + +#include <gpg-error.h> + +#include "qgpgme_debug.h" + +using namespace QGpgME; +using namespace GpgME; + +QGpgMERevokeKeyJob::QGpgMERevokeKeyJob(Context *context) + : mixin_type{context} +{ + lateInitialization(); +} + +QGpgMERevokeKeyJob::~QGpgMERevokeKeyJob() = default; + + +static Error check_arguments(const Key &key, + RevocationReason reason, + const std::vector<std::string> &description) +{ + if (key.isNull()) { + qWarning(QGPGME_LOG) << "Error: Key is null key"; + return Error::fromCode(GPG_ERR_INV_ARG); + } + if (reason < RevocationReason::Unspecified || reason > RevocationReason::NoLongerUsed) { + qWarning(QGPGME_LOG) << "Error: Invalid revocation reason" << static_cast<int>(reason); + return Error::fromCode(GPG_ERR_INV_VALUE); + } + if (std::any_of(std::begin(description), std::end(description), + (const std::string &line) { + return line.empty() || line.find('\n') != std::string::npos; + })) { + qWarning(QGPGME_LOG) << "Error: Revocation description contains empty lines or lines with endline characters"; + return Error::fromCode(GPG_ERR_INV_VALUE); + } + return {}; +} + +static QGpgMERevokeKeyJob::result_type revoke_key(Context *ctx, const Key &key, + RevocationReason reason, + const std::vector<std::string> &description) +{ + std::unique_ptr<GpgRevokeKeyEditInteractor> interactor{new GpgRevokeKeyEditInteractor}; + interactor->setReason(reason, description); + + QGpgME::QByteArrayDataProvider dp; + Data outData(&dp); + assert(!outData.isNull()); + + ctx->setFlag("extended-edit", "1"); + + const Error err = ctx->edit(key, std::unique_ptr<EditInteractor>(interactor.release()), outData); + Error ae; + const QString log = _detail::audit_log_as_html(ctx, ae); + return std::make_tuple(err, log, ae); +} + +Error QGpgMERevokeKeyJob::start(const GpgME::Key &key, + GpgME::RevocationReason reason, + const std::vector<std::string> &description) +{ + Error err = check_arguments(key, reason, description); + if (!err) { + run(std::bind(&revoke_key, std::placeholders::_1, key, reason, description)); + } + return err; +} + +Error QGpgMERevokeKeyJob::exec(const GpgME::Key &key, + GpgME::RevocationReason reason, + const std::vector<std::string> &description) +{ + Error err = check_arguments(key, reason, description); + if (!err) { + const result_type r = revoke_key(context(), key, reason, description); + resultHook(r); + err = std::get<0>(r); + } + return err; +} + +#include "qgpgmerevokekeyjob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmerevokekeyjob.h
Added
@@ -0,0 +1,70 @@ +/* + qgpgmerevokekeyjob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMEREVOKEKEYJOB_H__ +#define __QGPGME_QGPGMEREVOKEKEYJOB_H__ + +#include "threadedjobmixin.h" +#include "revokekeyjob.h" + +namespace QGpgME +{ + +class QGpgMERevokeKeyJob +#ifdef Q_MOC_RUN + : public RevokeKeyJob +#else + : public _detail::ThreadedJobMixin<RevokeKeyJob> +#endif +{ + Q_OBJECT +#ifdef Q_MOC_RUN +public Q_SLOTS: + void slotFinished(); +#endif +public: + explicit QGpgMERevokeKeyJob(GpgME::Context *context); + ~QGpgMERevokeKeyJob() override; + + GpgME::Error start(const GpgME::Key &key, + GpgME::RevocationReason reason = GpgME::RevocationReason::Unspecified, + const std::vector<std::string> &description = {}) override; + + GpgME::Error exec(const GpgME::Key &key, + GpgME::RevocationReason reason = GpgME::RevocationReason::Unspecified, + const std::vector<std::string> &description = {}) override; +}; + +} + +#endif // __QGPGME_QGPGMEREVOKEKEYJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesetprimaryuseridjob.cpp
Added
@@ -0,0 +1,75 @@ +/* + qgpgmesetprimaryuseridjob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmesetprimaryuseridjob.h" + +#include "util.h" + +#include <engineinfo.h> + +using namespace QGpgME; +using namespace GpgME; + +static bool quickSetPrimayUidSupportsUidHash() +{ + return GpgME::engineInfo(GpgME::GpgEngine).engineVersion() >= "2.3.8"; +} + +static QGpgMESetPrimaryUserIDJob::result_type set_primary_userid(Context *ctx, const GpgME::UserID &userId) +{ + auto err = ctx->setPrimaryUid(userId.parent(), quickSetPrimayUidSupportsUidHash() ? userId.uidhash() : userId.id()); + return std::make_tuple(err, QString(), Error()); +} + +QGpgMESetPrimaryUserIDJob::QGpgMESetPrimaryUserIDJob(Context *context) + : mixin_type{context} +{ + lateInitialization(); +} + +QGpgMESetPrimaryUserIDJob::~QGpgMESetPrimaryUserIDJob() = default; + +GpgME::Error QGpgMESetPrimaryUserIDJob::start(const GpgME::UserID &userId) +{ + if (userId.isNull()) { + return Error{make_error(GPG_ERR_INV_ARG)}; + } + run(userId(Context *ctx) { return set_primary_userid(ctx, userId); }); + return {}; +} + +#include "qgpgmesetprimaryuseridjob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesetprimaryuseridjob.h
Added
@@ -0,0 +1,64 @@ +/* + qgpgmesetprimaryuseridjob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMESETPRIMARYUSERIDJOB_H__ +#define __QGPGME_QGPGMESETPRIMARYUSERIDJOB_H__ + +#include "setprimaryuseridjob.h" +#include "threadedjobmixin.h" + +namespace QGpgME +{ + +class QGpgMESetPrimaryUserIDJob +#ifdef Q_MOC_RUN + : public SetPrimaryUserIDJob +#else + : public _detail::ThreadedJobMixin<SetPrimaryUserIDJob> +#endif +{ + Q_OBJECT +#ifdef Q_MOC_RUN +public Q_SLOTS: + void slotFinished(); +#endif +public: + explicit QGpgMESetPrimaryUserIDJob(GpgME::Context *context); + ~QGpgMESetPrimaryUserIDJob() override; + + GpgME::Error start(const GpgME::UserID &userId) override; +}; + +} + +#endif // __QGPGME_QGPGMESETPRIMARYUSERIDJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignarchivejob.cpp
Added
@@ -0,0 +1,177 @@ +/* + qgpgmesignarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmesignarchivejob.h" + +#include "dataprovider.h" +#include "signarchivejob_p.h" +#include "filelistdataprovider.h" + +#include <QFile> + +#include <data.h> + +using namespace QGpgME; +using namespace GpgME; + +namespace +{ + +class QGpgMESignArchiveJobPrivate : public SignArchiveJobPrivate +{ + QGpgMESignArchiveJob *q = nullptr; + +public: + QGpgMESignArchiveJobPrivate(QGpgMESignArchiveJob *qq) + : q{qq} + { + } + + ~QGpgMESignArchiveJobPrivate() override = default; + +private: + GpgME::Error startIt() override; + + void startNow() override + { + q->run(); + } +}; + +} + +QGpgMESignArchiveJob::QGpgMESignArchiveJob(Context *context) + : mixin_type{context} +{ + setJobPrivate(this, std::unique_ptr<QGpgMESignArchiveJobPrivate>{new QGpgMESignArchiveJobPrivate{this}}); + lateInitialization(); + connect(this, &Job::rawProgress, this, this(const QString &what, int type, int current, int total) { + emitArchiveProgressSignals(this, what, type, current, total); + }); +} + +static QGpgMESignArchiveJob::result_type sign(Context *ctx, + const std::vector<Key> &signers, + const std::vector<QString> &paths, + GpgME::Data &outdata, + const QString &baseDirectory) +{ + QGpgME::FileListDataProvider in{paths}; + Data indata(&in); + if (!baseDirectory.isEmpty()) { + indata.setFileName(baseDirectory.toStdString()); + } + + ctx->clearSigningKeys(); + for (const Key &signer : signers) { + if (!signer.isNull()) { + if (const Error err = ctx->addSigningKey(signer)) { + return std::make_tuple(SigningResult{err}, QString{}, Error{}); + } + } + } + + const SigningResult res = ctx->sign(indata, outdata, GpgME::SignArchive); + Error ae; + const QString log = _detail::audit_log_as_html(ctx, ae); + return std::make_tuple(res, log, ae); +} + +static QGpgMESignArchiveJob::result_type sign_to_io_device(Context *ctx, + QThread *thread, + const std::vector<Key> &signers, + const std::vector<QString> &paths, + const std::weak_ptr<QIODevice> &output_, + const QString &baseDirectory) +{ + const std::shared_ptr<QIODevice> output = output_.lock(); + const _detail::ToThreadMover ctMover(output, thread); + QGpgME::QIODeviceDataProvider out{output}; + Data outdata(&out); + + return sign(ctx, signers, paths, outdata, baseDirectory); +} + +static QGpgMESignArchiveJob::result_type sign_to_filename(Context *ctx, + const std::vector<Key> &signers, + const std::vector<QString> &paths, + const QString &outputFile, + const QString &baseDirectory) +{ + Data outdata; + outdata.setFileName(QFile::encodeName(outputFile).constData()); + + return sign(ctx, signers, paths, outdata, baseDirectory); +} + +GpgME::Error QGpgMESignArchiveJob::start(const std::vector<GpgME::Key> &signers, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &output) +{ + if (!output) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + run(std::bind(&sign_to_io_device, + std::placeholders::_1, + std::placeholders::_2, + signers, + paths, + std::placeholders::_3, + baseDirectory()), + output); + return {}; +} + + +GpgME::Error QGpgMESignArchiveJobPrivate::startIt() +{ + if (m_outputFilePath.isEmpty()) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + q->run(=(Context *ctx) { + return sign_to_filename(ctx, m_signers, m_inputPaths, m_outputFilePath, m_baseDirectory); + }); + + return {}; +} + +#include "qgpgmesignarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignarchivejob.h
Added
@@ -0,0 +1,69 @@ +/* + qgpgmesignarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMESIGNARCHIVEJOB_H__ +#define __QGPGME_QGPGMESIGNARCHIVEJOB_H__ + +#include "signarchivejob.h" + +#include "threadedjobmixin.h" + +#include <signingresult.h> + +namespace QGpgME +{ + +class QGpgMESignArchiveJob +#ifdef Q_MOC_RUN + : public SignArchiveJob +#else + : public _detail::ThreadedJobMixin<SignArchiveJob, std::tuple<GpgME::SigningResult, QString, GpgME::Error>> +#endif +{ + Q_OBJECT +#ifdef Q_MOC_RUN +public Q_SLOTS: + void slotFinished(); +#endif +public: + explicit QGpgMESignArchiveJob(GpgME::Context *context); + ~QGpgMESignArchiveJob() = default; + + GpgME::Error start(const std::vector<GpgME::Key> &signers, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &output) override; +}; + +} + +#endif // __QGPGME_QGPGMESIGNARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignencryptarchivejob.cpp
Added
@@ -0,0 +1,187 @@ +/* + qgpgmesignencryptarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2004,2007,2008 Klarälvdalens Datakonsult AB + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "qgpgmesignencryptarchivejob.h" + +#include "dataprovider.h" +#include "signencryptarchivejob_p.h" +#include "filelistdataprovider.h" + +#include <QFile> + +#include <data.h> + +using namespace QGpgME; +using namespace GpgME; + +namespace +{ + +class QGpgMESignEncryptArchiveJobPrivate : public SignEncryptArchiveJobPrivate +{ + QGpgMESignEncryptArchiveJob *q = nullptr; + +public: + QGpgMESignEncryptArchiveJobPrivate(QGpgMESignEncryptArchiveJob *qq) + : q{qq} + { + } + + ~QGpgMESignEncryptArchiveJobPrivate() override = default; + +private: + GpgME::Error startIt() override; + + void startNow() override + { + q->run(); + } +}; + +} + +QGpgMESignEncryptArchiveJob::QGpgMESignEncryptArchiveJob(Context *context) + : mixin_type{context} +{ + setJobPrivate(this, std::unique_ptr<QGpgMESignEncryptArchiveJobPrivate>{new QGpgMESignEncryptArchiveJobPrivate{this}}); + lateInitialization(); + connect(this, &Job::rawProgress, this, this(const QString &what, int type, int current, int total) { + emitArchiveProgressSignals(this, what, type, current, total); + }); +} + +static QGpgMESignEncryptArchiveJob::result_type sign_encrypt(Context *ctx, + const std::vector<GpgME::Key> &signers, + const std::vector<Key> &recipients, + const std::vector<QString> &paths, + GpgME::Data &outdata, + Context::EncryptionFlags encryptionFlags, + const QString &baseDirectory) +{ + QGpgME::FileListDataProvider in{paths}; + Data indata(&in); + if (!baseDirectory.isEmpty()) { + indata.setFileName(baseDirectory.toStdString()); + } + + ctx->clearSigningKeys(); + for (const Key &signer : signers) { + if (!signer.isNull()) { + if (const Error err = ctx->addSigningKey(signer)) { + return std::make_tuple(SigningResult{err}, EncryptionResult{}, QString{}, Error{}); + } + } + } + + encryptionFlags = static_cast<Context::EncryptionFlags>(encryptionFlags | Context::EncryptArchive); + const auto res = ctx->signAndEncrypt(recipients, indata, outdata, encryptionFlags); + Error ae; + const QString log = _detail::audit_log_as_html(ctx, ae); + return std::make_tuple(res.first, res.second, log, ae); +} + +static QGpgMESignEncryptArchiveJob::result_type sign_encrypt_to_io_device(Context *ctx, + QThread *thread, + const std::vector<GpgME::Key> &signers, + const std::vector<Key> &recipients, + const std::vector<QString> &paths, + const std::weak_ptr<QIODevice> &cipherText_, + Context::EncryptionFlags encryptionFlags, + const QString &baseDirectory) +{ + const std::shared_ptr<QIODevice> cipherText = cipherText_.lock(); + const _detail::ToThreadMover ctMover(cipherText, thread); + QGpgME::QIODeviceDataProvider out{cipherText}; + Data outdata(&out); + + return sign_encrypt(ctx, signers, recipients, paths, outdata, encryptionFlags, baseDirectory); +} + +static QGpgMESignEncryptArchiveJob::result_type sign_encrypt_to_filename(Context *ctx, + const std::vector<GpgME::Key> &signers, + const std::vector<Key> &recipients, + const std::vector<QString> &paths, + const QString &outputFile, + Context::EncryptionFlags encryptionFlags, + const QString &baseDirectory) +{ + Data outdata; + outdata.setFileName(QFile::encodeName(outputFile).constData()); + + return sign_encrypt(ctx, signers, recipients, paths, outdata, encryptionFlags, baseDirectory); +} + +GpgME::Error QGpgMESignEncryptArchiveJob::start(const std::vector<GpgME::Key> &signers, + const std::vector<GpgME::Key> &recipients, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &cipherText, + const GpgME::Context::EncryptionFlags encryptionFlags) +{ + if (!cipherText) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + run(std::bind(&sign_encrypt_to_io_device, + std::placeholders::_1, + std::placeholders::_2, + signers, + recipients, + paths, + std::placeholders::_3, + encryptionFlags, + baseDirectory()), + cipherText); + return {}; +} + +GpgME::Error QGpgMESignEncryptArchiveJobPrivate::startIt() +{ + if (m_outputFilePath.isEmpty()) { + return Error::fromCode(GPG_ERR_INV_VALUE); + } + + q->run(=(Context *ctx) { + return sign_encrypt_to_filename(ctx, m_signers, m_recipients, m_inputPaths, m_outputFilePath, m_encryptionFlags, m_baseDirectory); + }); + + return {}; +} + +#include "qgpgmesignencryptarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignencryptarchivejob.h
Added
@@ -0,0 +1,72 @@ +/* + qgpgmesignencryptarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_QGPGMESIGNENCRYPTARCHIVEJOB_H__ +#define __QGPGME_QGPGMESIGNENCRYPTARCHIVEJOB_H__ + +#include "signencryptarchivejob.h" + +#include "threadedjobmixin.h" + +#include <encryptionresult.h> +#include <signingresult.h> + +namespace QGpgME +{ + +class QGpgMESignEncryptArchiveJob +#ifdef Q_MOC_RUN + : public SignEncryptArchiveJob +#else + : public _detail::ThreadedJobMixin<SignEncryptArchiveJob, std::tuple<GpgME::SigningResult, GpgME::EncryptionResult, QString, GpgME::Error>> +#endif +{ + Q_OBJECT +#ifdef Q_MOC_RUN +public Q_SLOTS: + void slotFinished(); +#endif +public: + explicit QGpgMESignEncryptArchiveJob(GpgME::Context *context); + ~QGpgMESignEncryptArchiveJob() = default; + + GpgME::Error start(const std::vector<GpgME::Key> &signers, + const std::vector<GpgME::Key> &recipients, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &cipherText, + const GpgME::Context::EncryptionFlags flags) override; +}; + +} + +#endif // __QGPGME_QGPGMESIGNENCRYPTARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmesignencryptjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignencryptjob.cpp
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -38,6 +40,8 @@ #include "qgpgmesignencryptjob.h" +#include "signencryptjob_p.h" + #include "dataprovider.h" #include "context.h" @@ -46,17 +50,48 @@ #include "exception.h" #include <QBuffer> - +#include <QFileInfo> #include <cassert> using namespace QGpgME; using namespace GpgME; +namespace +{ + +class QGpgMESignEncryptJobPrivate : public SignEncryptJobPrivate +{ + QGpgMESignEncryptJob *q = nullptr; + +public: + QGpgMESignEncryptJobPrivate(QGpgMESignEncryptJob *qq) + : q{qq} + { + } + + ~QGpgMESignEncryptJobPrivate() override = default; + +private: + GpgME::Error startIt() override + { + Q_ASSERT(!"Not supported by this Job class."); + return Error::fromCode(GPG_ERR_NOT_SUPPORTED); + } + + void startNow() override + { + q->run(); + } +}; + +} + QGpgMESignEncryptJob::QGpgMESignEncryptJob(Context *context) : mixin_type(context), mOutputIsBase64Encoded(false) { + setJobPrivate(this, std::unique_ptr<QGpgMESignEncryptJobPrivate>{new QGpgMESignEncryptJobPrivate{this}}); lateInitialization(); } @@ -69,7 +104,7 @@ static QGpgMESignEncryptJob::result_type sign_encrypt(Context *ctx, QThread *thread, const std::vector<Key> &signers, const std::vector<Key> &recipients, const std::weak_ptr<QIODevice> &plainText_, - const std::weak_ptr<QIODevice> &cipherText_, const Context::EncryptionFlags eflags, bool outputIsBsse64Encoded) + const std::weak_ptr<QIODevice> &cipherText_, const Context::EncryptionFlags eflags, bool outputIsBsse64Encoded, const QString &fileName) { const std::shared_ptr<QIODevice> &plainText = plainText_.lock(); const std::shared_ptr<QIODevice> &cipherText = cipherText_.lock(); @@ -78,7 +113,15 @@ const _detail::ToThreadMover ptMover(plainText, thread); QGpgME::QIODeviceDataProvider in(plainText); - const Data indata(&in); + Data indata(&in); + if (!plainText->isSequential()) { + indata.setSizeHint(plainText->size()); + } + + const auto pureFileName = QFileInfo{fileName}.fileName().toStdString(); + if (!pureFileName.empty()) { + indata.setFileName(pureFileName.c_str()); + } ctx->clearSigningKeys(); Q_FOREACH (const Key &signer, signers) @@ -116,26 +159,26 @@ } static QGpgMESignEncryptJob::result_type sign_encrypt_qba(Context *ctx, const std::vector<Key> &signers, - const std::vector<Key> &recipients, const QByteArray &plainText, const Context::EncryptionFlags eflags, bool outputIsBsse64Encoded) + const std::vector<Key> &recipients, const QByteArray &plainText, const Context::EncryptionFlags eflags, bool outputIsBsse64Encoded, const QString &fileName) { const std::shared_ptr<QBuffer> buffer(new QBuffer); buffer->setData(plainText); if (!buffer->open(QIODevice::ReadOnly)) { assert(!"This should never happen: QBuffer::open() failed"); } - return sign_encrypt(ctx, nullptr, signers, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded); + return sign_encrypt(ctx, nullptr, signers, recipients, buffer, std::shared_ptr<QIODevice>(), eflags, outputIsBsse64Encoded, fileName); } Error QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, bool alwaysTrust) { - run(std::bind(&sign_encrypt_qba, std::placeholders::_1, signers, recipients, plainText, alwaysTrust ? Context::AlwaysTrust : Context::None, mOutputIsBase64Encoded)); + run(std::bind(&sign_encrypt_qba, std::placeholders::_1, signers, recipients, plainText, alwaysTrust ? Context::AlwaysTrust : Context::None, mOutputIsBase64Encoded, fileName())); return Error(); } void QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, const Context::EncryptionFlags eflags) { - run(std::bind(&sign_encrypt, std::placeholders::_1, std::placeholders::_2, signers, recipients, std::placeholders::_3, std::placeholders::_4, eflags, mOutputIsBase64Encoded), plainText, cipherText); + run(std::bind(&sign_encrypt, std::placeholders::_1, std::placeholders::_2, signers, recipients, std::placeholders::_3, std::placeholders::_4, eflags, mOutputIsBase64Encoded, fileName()), plainText, cipherText); } void QGpgMESignEncryptJob::start(const std::vector<Key> &signers, const std::vector<Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, bool alwaysTrust) @@ -145,7 +188,7 @@ std::pair<SigningResult, EncryptionResult> QGpgMESignEncryptJob::exec(const std::vector<Key> &signers, const std::vector<Key> &recipients, const QByteArray &plainText, const Context::EncryptionFlags eflags, QByteArray &cipherText) { - const result_type r = sign_encrypt_qba(context(), signers, recipients, plainText, eflags, mOutputIsBase64Encoded); + const result_type r = sign_encrypt_qba(context(), signers, recipients, plainText, eflags, mOutputIsBase64Encoded, fileName()); cipherText = std::get<2>(r); resultHook(r); return mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmesignencryptjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignencryptjob.h
Changed
@@ -79,38 +79,38 @@ /* from SignEncryptJob */ GpgME::Error start(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, - const QByteArray &plainText, bool alwaysTrust) Q_DECL_OVERRIDE; + const QByteArray &plainText, bool alwaysTrust) override; /* from SignEncryptJob */ void start(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, - bool alwaysTrust) Q_DECL_OVERRIDE; + bool alwaysTrust) override; void start(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &cipherText, - const GpgME::Context::EncryptionFlags flags) Q_DECL_OVERRIDE; + const GpgME::Context::EncryptionFlags flags) override; std::pair<GpgME::SigningResult, GpgME::EncryptionResult> exec(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, const QByteArray &plainText, bool alwaysTrust, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; std::pair<GpgME::SigningResult, GpgME::EncryptionResult> exec(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients, const QByteArray &plainText, const GpgME::Context::EncryptionFlags flags, - QByteArray &cipherText) Q_DECL_OVERRIDE; + QByteArray &cipherText) override; /* from SignEncryptJob */ - void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; + void setOutputIsBase64Encoded(bool on) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: bool mOutputIsBase64Encoded;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmesignjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignjob.cpp
Changed
@@ -81,7 +81,10 @@ const _detail::ToThreadMover sgMover(signature, thread); QGpgME::QIODeviceDataProvider in(plainText); - const Data indata(&in); + Data indata(&in); + if (!plainText->isSequential()) { + indata.setSizeHint(plainText->size()); + } ctx->clearSigningKeys(); Q_FOREACH (const Key &signer, signers)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmesignjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignjob.h
Changed
@@ -72,25 +72,25 @@ /* from SignJob */ GpgME::Error start(const std::vector<GpgME::Key> &signers, const QByteArray &plainText, - GpgME::SignatureMode mode) Q_DECL_OVERRIDE; + GpgME::SignatureMode mode) override; /* from SignJob */ void start(const std::vector<GpgME::Key> &signers, const std::shared_ptr<QIODevice> &plainText, const std::shared_ptr<QIODevice> &signature, - GpgME::SignatureMode mode) Q_DECL_OVERRIDE; + GpgME::SignatureMode mode) override; /* from SignJob */ GpgME::SigningResult exec(const std::vector<GpgME::Key> &signers, const QByteArray &plainText, GpgME::SignatureMode mode, - QByteArray &signature) Q_DECL_OVERRIDE; + QByteArray &signature) override; /* from SignJob */ - void setOutputIsBase64Encoded(bool on) Q_DECL_OVERRIDE; + void setOutputIsBase64Encoded(bool on) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::SigningResult mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmesignkeyjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignkeyjob.cpp
Changed
@@ -57,6 +57,15 @@ namespace { struct TrustSignatureProperties { + TrustSignatureProperties() = default; + // needed for C++11 because until C++14 "aggregate initialization requires + // class type, that has no default member initializers" + TrustSignatureProperties(TrustSignatureTrust trust_, unsigned int depth_, const QString &scope_) + : trust{trust_} + , depth{depth_} + , scope{scope_} + {} + TrustSignatureTrust trust = TrustSignatureTrust::None; unsigned int depth = 0; QString scope; @@ -127,11 +136,11 @@ if (expirationDate.isValid()) { // on 2106-02-07, the Unix time will reach 0xFFFFFFFF; since gpg uses uint32 internally - // for the expiration date clip it at 2106-02-06 - static const QDate maxAllowedDate{2106, 2, 6}; + // for the expiration date clip it at 2106-02-05 to avoid problems with negative time zones + static const QDate maxAllowedDate{2106, 2, 5}; const auto clippedExpirationDate = expirationDate <= maxAllowedDate ? expirationDate : maxAllowedDate; if (clippedExpirationDate != expirationDate) { - qCWarning(QGPGME_LOG) << "Expiration of certification has been changed to" << clippedExpirationDate; + qCDebug(QGPGME_LOG) << "Expiration of certification has been changed to" << clippedExpirationDate; } // use the "days from now" format to specify the expiration date of the certification; // this format is the most appropriate regardless of the local timezone
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmesignkeyjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmesignkeyjob.h
Changed
@@ -61,31 +61,31 @@ ~QGpgMESignKeyJob(); /* from SignKeyJob */ - GpgME::Error start(const GpgME::Key &key) Q_DECL_OVERRIDE; + GpgME::Error start(const GpgME::Key &key) override; /* from SignKeyJob */ - void setUserIDsToSign(const std::vector<unsigned int> &idsToSign) Q_DECL_OVERRIDE; + void setUserIDsToSign(const std::vector<unsigned int> &idsToSign) override; /* from SignKeyJob */ - void setCheckLevel(unsigned int checkLevel) Q_DECL_OVERRIDE; + void setCheckLevel(unsigned int checkLevel) override; /* from SignKeyJob */ - void setExportable(bool exportable) Q_DECL_OVERRIDE; + void setExportable(bool exportable) override; /* from SignKeyJob */ - void setSigningKey(const GpgME::Key &key) Q_DECL_OVERRIDE; + void setSigningKey(const GpgME::Key &key) override; /* from SignKeyJob */ - void setNonRevocable(bool nonRevocable) Q_DECL_OVERRIDE; + void setNonRevocable(bool nonRevocable) override; /* from SignKeyJob */ - void setRemark(const QString &remark) Q_DECL_OVERRIDE; + void setRemark(const QString &remark) override; /* from SignKeyJob */ - void setDupeOk(bool value) Q_DECL_OVERRIDE; + void setDupeOk(bool value) override; /* from SignKeyJob */ - void setTrustSignature(GpgME::TrustSignatureTrust trust, unsigned short depth, const QString &scope) Q_DECL_OVERRIDE; + void setTrustSignature(GpgME::TrustSignatureTrust trust, unsigned short depth, const QString &scope) override; void setExpirationDate(const QDate &expiration) override;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmetofupolicyjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmetofupolicyjob.h
Changed
@@ -57,8 +57,8 @@ explicit QGpgMETofuPolicyJob(GpgME::Context *context); ~QGpgMETofuPolicyJob(); - void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) Q_DECL_OVERRIDE; - GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) Q_DECL_OVERRIDE; + void start(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) override; + GpgME::Error exec(const GpgME::Key &key, GpgME::TofuInfo::Policy policy) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeverifydetachedjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeverifydetachedjob.cpp
Changed
@@ -71,6 +71,9 @@ QGpgME::QIODeviceDataProvider dataDP(signedData); Data data(&dataDP); + if (!signedData->isSequential()) { + data.setSizeHint(signedData->size()); + } const VerificationResult res = ctx->verifyDetachedSignature(sig, data); Error ae;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeverifydetachedjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeverifydetachedjob.h
Changed
@@ -65,17 +65,17 @@ ~QGpgMEVerifyDetachedJob(); /* from VerifyDetachedJob */ - GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) override; /* from VerifyDetachedJob */ - void start(const std::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signedData) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signedData) override; /* from VerifyDetachedJob */ GpgME::VerificationResult exec(const QByteArray &signature, - const QByteArray &signedData) Q_DECL_OVERRIDE; + const QByteArray &signedData) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::VerificationResult mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeverifyopaquejob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeverifyopaquejob.cpp
Changed
@@ -70,7 +70,10 @@ const _detail::ToThreadMover sdMover(signedData, thread); QGpgME::QIODeviceDataProvider in(signedData); - const Data indata(&in); + Data indata(&in); + if (!signedData->isSequential()) { + indata.setSizeHint(signedData->size()); + } if (!plainText) { QGpgME::QByteArrayDataProvider out;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmeverifyopaquejob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmeverifyopaquejob.h
Changed
@@ -65,16 +65,16 @@ ~QGpgMEVerifyOpaqueJob(); /* from VerifyOpaqueJob */ - GpgME::Error start(const QByteArray &signedData) Q_DECL_OVERRIDE; + GpgME::Error start(const QByteArray &signedData) override; /* from VerifyOpaqueJob */ - void start(const std::shared_ptr<QIODevice> &signedData, const std::shared_ptr<QIODevice> &plainText) Q_DECL_OVERRIDE; + void start(const std::shared_ptr<QIODevice> &signedData, const std::shared_ptr<QIODevice> &plainText) override; /* form VerifyOpaqueJob */ - GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) Q_DECL_OVERRIDE; + GpgME::VerificationResult exec(const QByteArray &signedData, QByteArray &plainData) override; /* from ThreadedJobMixin */ - void resultHook(const result_type &r) Q_DECL_OVERRIDE; + void resultHook(const result_type &r) override; private: GpgME::VerificationResult mResult;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmewkdlookupjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmewkdlookupjob.h
Changed
@@ -59,10 +59,10 @@ ~QGpgMEWKDLookupJob(); /* from WKDLookupJob */ - GpgME::Error start(const QString &email) Q_DECL_OVERRIDE; + GpgME::Error start(const QString &email) override; /* from WKDLookupJob */ - WKDLookupResult exec(const QString &email) Q_DECL_OVERRIDE; + WKDLookupResult exec(const QString &email) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/qgpgmewkspublishjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/qgpgmewkspublishjob.h
Changed
@@ -61,9 +61,9 @@ explicit QGpgMEWKSPublishJob(GpgME::Context *context); ~QGpgMEWKSPublishJob(); - void startCheck(const QString &mailbox) Q_DECL_OVERRIDE; - void startCreate(const char *fpr, const QString &mailbox) Q_DECL_OVERRIDE; - void startReceive(const QByteArray &response) Q_DECL_OVERRIDE; + void startCheck(const QString &mailbox) override; + void startCreate(const char *fpr, const QString &mailbox) override; + void startReceive(const QByteArray &response) override; }; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/refreshkeysjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/refreshkeysjob.h
Changed
@@ -38,6 +38,8 @@ #include "job.h" #include "qgpgme_export.h" +#include <QtCore/QStringList> + #include <vector> namespace GpgME @@ -46,8 +48,6 @@ class Key; } -class QStringList; - namespace QGpgME { @@ -61,7 +61,7 @@ RefreshKeysJob instance will have scheduled its own destruction with a call to QObject::deleteLater(). - After result() is emitted, the KeyListJob will schedule it's own + After result() is emitted, the job will schedule it's own destruction by calling QObject::deleteLater(). */ class QGPGME_EXPORT RefreshKeysJob : public Job @@ -73,21 +73,22 @@ ~RefreshKeysJob(); /** - Starts the keylist operation. \a pattern is a list of patterns + Starts the refresh operation. \a pattern is a list of patterns used to restrict the list of keys returned. Empty patterns are ignored. If \a pattern is empty or contains only empty strings, - all keys are returned (however, the backend is free to truncate - the result and should do so; when this happens, it will be - reported by the reult object). + all keys are refreshed. - If \a secretOnly is true, only keys for which the secret key is - also available are returned. Use this if you need to select a - key for signing. + Only implemented for S/MIME. */ virtual GpgME::Error start(const QStringList &patterns) = 0; + /** + Starts a refresh of the \a keys. + */ + virtual GpgME::Error start(const std::vector<GpgME::Key> &keys) = 0; + Q_SIGNALS: - void result(const GpgME::Error &error); + void result(const GpgME::Error &result); }; }
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/revokekeyjob.h
Added
@@ -0,0 +1,86 @@ +/* + revokekeyjob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_REVOKEKEYJOB_H__ +#define __QGPGME_REVOKEKEYJOB_H__ + +#include "job.h" +#include "qgpgme_export.h" + +class QString; + +namespace GpgME +{ +class Error; +class Key; +} + +namespace QGpgME +{ + +class QGPGME_EXPORT RevokeKeyJob : public Job +{ + Q_OBJECT +protected: + explicit RevokeKeyJob(QObject *parent); + +public: + ~RevokeKeyJob(); + + /** + Starts the operation. \a key is the key to revoke with reason \a reason and + optional description \a description. The individual elements of \a description + must be non-empty strings and they must not contain any endline characters. + + The job deletes itself after it has completed the operation. + */ + virtual GpgME::Error start(const GpgME::Key &key, + GpgME::RevocationReason reason = GpgME::RevocationReason::Unspecified, + const std::vector<std::string> &description = {}) = 0; + + /** + Runs the operation. \a key is the key to revoke with reason \a reason and + optional description \a description. The individual elements of \a description + must be non-empty strings and they must not contain any endline characters. + */ + virtual GpgME::Error exec(const GpgME::Key &key, + GpgME::RevocationReason reason = GpgME::RevocationReason::Unspecified, + const std::vector<std::string> &description = {}) = 0; + +Q_SIGNALS: + void result(const GpgME::Error &result, const QString &auditLogAsHtml = {}, const GpgME::Error &auditLogError = {}); +}; + +} + +#endif // __QGPGME_REVOKEKEYJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/setprimaryuseridjob.h
Added
@@ -0,0 +1,69 @@ +/* + setprimaryuseridjob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_SETPRIMARYUSERIDJOB_H__ +#define __QGPGME_SETPRIMARYUSERIDJOB_H__ + +#include "job.h" + +#include "qgpgme_export.h" + +namespace GpgME +{ +class Error; +class UserID; +} + +namespace QGpgME +{ + +class QGPGME_EXPORT SetPrimaryUserIDJob : public Job +{ + Q_OBJECT +public: + explicit SetPrimaryUserIDJob(QObject *parent); + ~SetPrimaryUserIDJob() override; + + /** + * Starts setting user ID \a userId as the primary user ID. + */ + virtual GpgME::Error start(const GpgME::UserID &userId) = 0; + +Q_SIGNALS: + void result(const GpgME::Error &error, + const QString &auditLogAsHtml = QString(), const GpgME::Error &auditLogError = GpgME::Error()); +}; + +} + +#endif // __QGPGME_SETPRIMARYUSERIDJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signarchivejob.cpp
Added
@@ -0,0 +1,107 @@ +/* + signarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "signarchivejob.h" +#include "signarchivejob_p.h" + +#include <engineinfo.h> + +using namespace QGpgME; + +SignArchiveJob::SignArchiveJob(QObject *parent) + : Job{parent} +{ +} + +SignArchiveJob::~SignArchiveJob() = default; + +// static +bool SignArchiveJob::isSupported() +{ + static const auto gpgVersion = GpgME::engineInfo(GpgME::GpgEngine).engineVersion(); + return (gpgVersion >= "2.4.1") || (gpgVersion >= "2.2.42" && gpgVersion < "2.3.0"); +} + +void SignArchiveJob::setSigners(const std::vector<GpgME::Key> &signers) +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + d->m_signers = signers; +} + +std::vector<GpgME::Key> SignArchiveJob::signers() const +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + return d->m_signers; +} + +void SignArchiveJob::setInputPaths(const std::vector<QString> &paths) +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + d->m_inputPaths = paths; +} + +std::vector<QString> SignArchiveJob::inputPaths() const +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + return d->m_inputPaths; +} + +void SignArchiveJob::setOutputFile(const QString &path) +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + d->m_outputFilePath = path; +} + +QString SignArchiveJob::outputFile() const +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + return d->m_outputFilePath; +} + +void SignArchiveJob::setBaseDirectory(const QString &baseDirectory) +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + d->m_baseDirectory = baseDirectory; +} + +QString SignArchiveJob::baseDirectory() const +{ + auto d = jobPrivate<SignArchiveJobPrivate>(this); + return d->m_baseDirectory; +} + +#include "signarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signarchivejob.h
Added
@@ -0,0 +1,145 @@ +/* + signarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_SIGNARCHIVEJOB_H__ +#define __QGPGME_SIGNARCHIVEJOB_H__ + +#include "job.h" + +#ifdef BUILDING_QGPGME +# include "context.h" +#else +# include <gpgme++/context.h> +#endif + +namespace GpgME +{ +class Key; +} + +namespace QGpgME +{ + +/** + * Abstract base class for job for creating signed archives + */ +class QGPGME_EXPORT SignArchiveJob : public Job +{ + Q_OBJECT +protected: + explicit SignArchiveJob(QObject *parent); +public: + ~SignArchiveJob() override; + + static bool isSupported(); + + /** + * Sets the keys to use for signing the archive. + * + * Used if the job is started with startIt(). + */ + void setSigners(const std::vector<GpgME::Key> &signers); + std::vector<GpgME::Key> signers() const; + + /** + * Sets the paths of the files and folders to put into the archive. + * + * If base directory is set, then the paths must be relative to the + * base directory. + * + * Used if the job is started with startIt(). + */ + void setInputPaths(const std::vector<QString> &paths); + std::vector<QString> inputPaths() const; + + /** + * Sets the path of the file to write the created archive to. + * + * If \a path is a relative path and base directory is set, then the + * path is interpreted relative to the base directory. + * + * Used if the job is started with startIt(). + * + * \note If a file with this path exists, then the job will fail, i.e. you + * need to delete an existing file that shall be overwritten before you + * start the job. + */ + void setOutputFile(const QString &path); + QString outputFile() const; + + /** + * Sets the base directory for the relative paths of the input files and + * the output file. + */ + void setBaseDirectory(const QString &baseDirectory); + QString baseDirectory() const; + + /** + * Starts the creation of a signed archive. + * + * Creates a signed archive with the files and directories in \a paths. + * The archive is signed with the keys in \a signers or with the default + * key, if \a signers is empty. The signed archive is written to \a output. + * + * Emits result() when the job has finished. + */ + virtual GpgME::Error start(const std::vector<GpgME::Key> &signers, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &output) = 0; + +Q_SIGNALS: + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the number of files. In the scanning phase (i.e. while gpgtar checks + * which files to put into the archive), \a current is the current number of + * files and \a total is 0. In the writing phase, \a current is the number + * of processed files and \a total is the total number of files. + */ + void fileProgress(int current, int total); + + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the amount of processed data. It is only emitted in the writing phase. + * \a current is the processed amount data and \a total is the total amount + * of data to process. Both values never exceed 2^20. + */ + void dataProgress(int current, int total); + + void result(const GpgME::SigningResult &result, + const QString &auditLogAsHtml = {}, + const GpgME::Error &auditLogError = {}); +}; + +} + +#endif // __QGPGME_SIGNARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signarchivejob_p.h
Added
@@ -0,0 +1,52 @@ +/* + signarchivejob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_SIGNARCHIVEJOB_P_H__ +#define __QGPGME_SIGNARCHIVEJOB_P_H__ + +#include "job_p.h" + +namespace QGpgME +{ + +struct SignArchiveJobPrivate : public JobPrivate +{ + std::vector<GpgME::Key> m_signers; + std::vector<QString> m_inputPaths; + QString m_outputFilePath; + QString m_baseDirectory; +}; + +} + +#endif // __QGPGME_SIGNARCHIVEJOB_P_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signencryptarchivejob.cpp
Added
@@ -0,0 +1,131 @@ +/* + signencryptarchivejob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "signencryptarchivejob.h" +#include "signencryptarchivejob_p.h" + +#include <engineinfo.h> + +using namespace QGpgME; + +SignEncryptArchiveJob::SignEncryptArchiveJob(QObject *parent) + : Job{parent} +{ +} + +SignEncryptArchiveJob::~SignEncryptArchiveJob() = default; + +// static +bool SignEncryptArchiveJob::isSupported() +{ + static const auto gpgVersion = GpgME::engineInfo(GpgME::GpgEngine).engineVersion(); + return (gpgVersion >= "2.4.1") || (gpgVersion >= "2.2.42" && gpgVersion < "2.3.0"); +} + +void SignEncryptArchiveJob::setSigners(const std::vector<GpgME::Key> &signers) +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + d->m_signers = signers; +} + +std::vector<GpgME::Key> SignEncryptArchiveJob::signers() const +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + return d->m_signers; +} + +void SignEncryptArchiveJob::setRecipients(const std::vector<GpgME::Key> &recipients) +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + d->m_recipients = recipients; +} + +std::vector<GpgME::Key> SignEncryptArchiveJob::recipients() const +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + return d->m_recipients; +} + +void SignEncryptArchiveJob::setInputPaths(const std::vector<QString> &paths) +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + d->m_inputPaths = paths; +} + +std::vector<QString> SignEncryptArchiveJob::inputPaths() const +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + return d->m_inputPaths; +} + +void SignEncryptArchiveJob::setOutputFile(const QString &path) +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + d->m_outputFilePath = path; +} + +QString SignEncryptArchiveJob::outputFile() const +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + return d->m_outputFilePath; +} + +void SignEncryptArchiveJob::setEncryptionFlags(GpgME::Context::EncryptionFlags flags) +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + d->m_encryptionFlags = static_cast<GpgME::Context::EncryptionFlags>(flags | GpgME::Context::EncryptArchive); +} + +GpgME::Context::EncryptionFlags SignEncryptArchiveJob::encryptionFlags() const +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + return d->m_encryptionFlags; +} + +void SignEncryptArchiveJob::setBaseDirectory(const QString &baseDirectory) +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + d->m_baseDirectory = baseDirectory; +} + +QString SignEncryptArchiveJob::baseDirectory() const +{ + auto d = jobPrivate<SignEncryptArchiveJobPrivate>(this); + return d->m_baseDirectory; +} + +#include "signencryptarchivejob.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signencryptarchivejob.h
Added
@@ -0,0 +1,169 @@ +/* + signencryptarchivejob.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_SIGNENCRYPTARCHIVEJOB_H__ +#define __QGPGME_SIGNENCRYPTARCHIVEJOB_H__ + +#include "job.h" + +#ifdef BUILDING_QGPGME +# include "context.h" +#else +# include <gpgme++/context.h> +#endif + +namespace GpgME +{ +class Key; +} + +namespace QGpgME +{ + +/** + * Abstract base class for job for creating encrypted signed archives + */ +class QGPGME_EXPORT SignEncryptArchiveJob : public Job +{ + Q_OBJECT +protected: + explicit SignEncryptArchiveJob(QObject *parent); +public: + ~SignEncryptArchiveJob() override; + + static bool isSupported(); + + /** + * Sets the keys to use for signing the archive. + * + * Used if the job is started with startIt(). + */ + void setSigners(const std::vector<GpgME::Key> &signers); + std::vector<GpgME::Key> signers() const; + + /** + * Sets the keys to use for encrypting the archive. + * + * Used if the job is started with startIt(). + */ + void setRecipients(const std::vector<GpgME::Key> &recipients); + std::vector<GpgME::Key> recipients() const; + + /** + * Sets the paths of the files and folders to put into the archive. + * + * If base directory is set, then the paths must be relative to the + * base directory. + * + * Used if the job is started with startIt(). + */ + void setInputPaths(const std::vector<QString> &paths); + std::vector<QString> inputPaths() const; + + /** + * Sets the path of the file to write the created archive to. + * + * If \a path is a relative path and base directory is set, then the + * path is interpreted relative to the base directory. + * + * Used if the job is started with startIt(). + * + * \note If a file with this path exists, then the job will fail, i.e. you + * need to delete an existing file that shall be overwritten before you + * start the job. + */ + void setOutputFile(const QString &path); + QString outputFile() const; + + /** + * Sets the flags to use for encryption. Defaults to \c EncryptArchive. + * The \c EncryptArchive flag is always assumed set for this job. + * + * Used if the job is started with startIt(). + */ + void setEncryptionFlags(GpgME::Context::EncryptionFlags flags); + GpgME::Context::EncryptionFlags encryptionFlags() const; + + /** + * Sets the base directory for the relative paths of the input files and + * the output file. + */ + void setBaseDirectory(const QString &baseDirectory); + QString baseDirectory() const; + + /** + * Starts the creation of an encrypted signed archive. + * + * Creates an encrypted signed archive with the files and directories in + * \a paths. + * The archive is signed with the keys in \a signers or with the default + * key, if \a signers is empty. Then the archive is encrypted for the + * keys in \a recipients. If \a recipients is empty, then symmetric + * encryption is performed. The encrypted signed archive is written to + * \a cipherText. + * + * Emits result() when the job has finished. + */ + virtual GpgME::Error start(const std::vector<GpgME::Key> &signers, + const std::vector<GpgME::Key> &recipients, + const std::vector<QString> &paths, + const std::shared_ptr<QIODevice> &cipherText, + const GpgME::Context::EncryptionFlags flags) = 0; + +Q_SIGNALS: + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the number of files. In the scanning phase (i.e. while gpgtar checks + * which files to put into the archive), \a current is the current number of + * files and \a total is 0. In the writing phase, \a current is the number + * of processed files and \a total is the total number of files. + */ + void fileProgress(int current, int total); + + /** + * This signal is emitted whenever gpgtar sends a progress status update for + * the amount of processed data. It is only emitted in the writing phase. + * \a current is the processed amount data and \a total is the total amount + * of data to process. Both values never exceed 2^20. + */ + void dataProgress(int current, int total); + + void result(const GpgME::SigningResult &signingResult, + const GpgME::EncryptionResult &encryptionResult, + const QString &auditLogAsHtml = {}, + const GpgME::Error &auditLogError = {}); +}; + +} + +#endif // __QGPGME_SIGNENCRYPTARCHIVEJOB_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signencryptarchivejob_p.h
Added
@@ -0,0 +1,54 @@ +/* + signencryptarchivejob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_SIGNENCRYPTARCHIVEJOB_P_H__ +#define __QGPGME_SIGNENCRYPTARCHIVEJOB_P_H__ + +#include "job_p.h" + +namespace QGpgME +{ + +struct SignEncryptArchiveJobPrivate : public JobPrivate +{ + std::vector<GpgME::Key> m_signers; + std::vector<GpgME::Key> m_recipients; + std::vector<QString> m_inputPaths; + QString m_outputFilePath; + QString m_baseDirectory; + GpgME::Context::EncryptionFlags m_encryptionFlags = GpgME::Context::EncryptArchive; +}; + +} + +#endif // __QGPGME_SIGNENCRYPTARCHIVEJOB_P_H__
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signencryptjob.cpp
Added
@@ -0,0 +1,53 @@ +/* + signencryptjob.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "signencryptjob.h" +#include "signencryptjob_p.h" + +using namespace QGpgME; + +void SignEncryptJob::setFileName(const QString &fileName) +{ + auto d = jobPrivate<SignEncryptJobPrivate>(this); + d->m_fileName = fileName; +} + +QString SignEncryptJob::fileName() const +{ + auto d = jobPrivate<SignEncryptJobPrivate>(this); + return d->m_fileName; +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/signencryptjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signencryptjob.h
Changed
@@ -5,6 +5,8 @@ Copyright (c) 2004, 2007 Klarälvdalens Datakonsult AB Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik Software engineering by Intevation GmbH + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> QGpgME is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -85,6 +87,9 @@ public: ~SignEncryptJob(); + void setFileName(const QString &fileName); + QString fileName() const; + /** Starts the combined signing and encrypting operation. \a signers is the list of keys to sign \a plainText with. \a recipients is @@ -106,8 +111,6 @@ If \a cipherText is non-null, the ciphertext is written there. Otherwise, it will be delivered in the third argument of result(). - - \throws GpgME::Exception if starting fails */ virtual void start(const std::vector<GpgME::Key> &signers, const std::vector<GpgME::Key> &recipients,
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signencryptjob_p.h
Added
@@ -0,0 +1,49 @@ +/* + signencryptjob_p.h + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022,2023 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifndef __QGPGME_SIGNENCRYPTJOB_P_H__ +#define __QGPGME_SIGNENCRYPTJOB_P_H__ + +#include "job_p.h" + +namespace QGpgME +{ + +struct SignEncryptJobPrivate : public JobPrivate +{ + QString m_fileName; +}; + +} + +#endif // __QGPGME_SIGNENCRYPTJOB_P_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/signjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signjob.h
Changed
@@ -95,8 +95,6 @@ If \a signature is non-null the signature is written there. Otherwise, it will be delivered in the second argument of result(). - - \throws GpgME::Exception if starting fails */ virtual void start(const std::vector<GpgME::Key> &signers, const std::shared_ptr<QIODevice> &plainText,
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/signkeyjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/signkeyjob.h
Changed
@@ -149,7 +149,7 @@ * Sets the expiration date of the key signature to @a expiration. By default, * key signatures do not expire. * - * Note: Expiration dates after 2106-02-06 will be set to 2106-02-06. + * Note: Expiration dates after 2106-02-05 will be set to 2106-02-05. * * Not pure virtual for ABI compatibility. **/
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/threadedjobmixin.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/threadedjobmixin.h
Changed
@@ -103,6 +103,12 @@ m_function = function; } + bool hasFunction() + { + const QMutexLocker locker(&m_mutex); + return static_cast<bool>(m_function); + } + T_result result() const { const QMutexLocker locker(&m_mutex); @@ -110,7 +116,7 @@ } private: - void run() Q_DECL_OVERRIDE { + void run() override { const QMutexLocker locker(&m_mutex); m_result = m_function(); } @@ -127,6 +133,12 @@ typedef ThreadedJobMixin<T_base, T_result> mixin_type; typedef T_result result_type; + void run() + { + Q_ASSERT(m_thread.hasFunction() && "Call setWorkerFunction() before run()"); + m_thread.start(); + } + protected: static_assert(std::tuple_size<T_result>::value > 2, "Result tuple too small"); @@ -167,6 +179,13 @@ } template <typename T_binder> + void setWorkerFunction(const T_binder &func) + { + m_thread.setFunction(this, func() { return func(this->context()); }); + } + +public: + template <typename T_binder> void run(const T_binder &func) { m_thread.setFunction(std::bind(func, this->context())); @@ -201,6 +220,8 @@ m_thread.setFunction(std::bind(func, this->context(), this->thread(), std::weak_ptr<QIODevice>(io1), std::weak_ptr<QIODevice>(io2))); m_thread.start(); } + +protected: GpgME::Context *context() const { return m_ctx.get(); @@ -218,31 +239,35 @@ doEmitResult(r); this->deleteLater(); } - void slotCancel() Q_DECL_OVERRIDE { + void slotCancel() override { if (m_ctx) { m_ctx->cancelPendingOperation(); } } - QString auditLogAsHtml() const Q_DECL_OVERRIDE + QString auditLogAsHtml() const override { return m_auditLog; } - GpgME::Error auditLogError() const Q_DECL_OVERRIDE + GpgME::Error auditLogError() const override { return m_auditLogError; } - void showProgress(const char * /*what*/, - int /*type*/, int current, int total) Q_DECL_OVERRIDE { - // will be called from the thread exec'ing the operation, so - // just bounce everything to the owning thread: - // ### hope this is thread-safe (meta obj is const, and - // ### portEvent is thread-safe, so should be ok) - QMetaObject::invokeMethod(this, "progress", Qt::QueuedConnection, - // TODO port - Q_ARG(QString, QString()), - Q_ARG(int, current), - Q_ARG(int, total)); + void showProgress(const char *what, + int type, int current, int total) override { + QMetaObject::invokeMethod(this, this, current, total() { + Q_EMIT this->jobProgress(current, total); + }, Qt::QueuedConnection); + const QString what_ = QString::fromUtf8(what); + QMetaObject::invokeMethod(this, this, what_, type, current, total() { + Q_EMIT this->rawProgress(what_, type, current, total); + }, Qt::QueuedConnection); + QMetaObject::invokeMethod(this, this, what_, current, total() { + QT_WARNING_PUSH + QT_WARNING_DISABLE_DEPRECATED + Q_EMIT this->progress(what_, current, total); + QT_WARNING_POP + }, Qt::QueuedConnection); } private: template <typename T1, typename T2>
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/util.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/util.cpp
Changed
@@ -31,9 +31,15 @@ your version. */ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + #include "util.h" -#include <QStringList> +#include <key.h> + +#include <algorithm> #include <functional> std::vector<std::string> toStrings(const QStringList &l) @@ -45,3 +51,13 @@ std::mem_fn(&QString::toStdString)); return v; } + +QStringList toFingerprints(const std::vector<GpgME::Key> &keys) +{ + QStringList fprs; + fprs.reserve(keys.size()); + std::transform(std::begin(keys), std::end(keys), std::back_inserter(fprs), (const GpgME::Key &k) { + return QString::fromLatin1(k.primaryFingerprint()); + }); + return fprs; +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/util.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/util.h
Changed
@@ -34,12 +34,18 @@ #ifndef __QGPGME_UTIL_H__ #define __QGPGME_UTIL_H__ +#include <QStringList> + #include <gpgme.h> +#include <sstream> #include <string> #include <vector> -class QStringList; +namespace GpgME +{ +class Key; +} static inline gpgme_error_t make_error(gpgme_err_code_t code) { @@ -48,4 +54,14 @@ std::vector<std::string> toStrings(const QStringList &l); +QStringList toFingerprints(const std::vector<GpgME::Key> &keys); + +template<class Result> +std::string toLogString(const Result &result) +{ + std::stringstream stream; + stream << result; + return stream.str(); +} + #endif // __QGPGME_UTIL_H__
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/verifydetachedjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/verifydetachedjob.h
Changed
@@ -81,11 +81,6 @@ virtual GpgME::Error start(const QByteArray &signature, const QByteArray &signedData) = 0; - /*! - \overload - - \throws GpgME::Exception if starting fails. - */ virtual void start(const std::shared_ptr<QIODevice> &signature, const std::shared_ptr<QIODevice> &signedData) = 0; virtual GpgME::VerificationResult exec(const QByteArray &signature,
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/verifyopaquejob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/verifyopaquejob.h
Changed
@@ -85,8 +85,6 @@ If \a plainText is non-null, the plaintext is written there. Otherwise, it will be delivered in the second argument of result(). - - \throws GpgME::Exception if starting fails */ virtual void start(const std::shared_ptr<QIODevice> &signedData, const std::shared_ptr<QIODevice> &plainText = std::shared_ptr<QIODevice>()) = 0;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/src/wkspublishjob.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/src/wkspublishjob.h
Changed
@@ -52,11 +52,9 @@ * The workflow is to call startCreate, check for errors and then * send the RFC822 mail returned in returnedData. * - * When the response is received start a startRecieve with the + * When the response is received call startReceive with the * RFC822 mail received as parameter response. Check for errors - * and then send again send the result from returnedData back to - * the server. - * + * and then send the result from returnedData back to the server. */ class QGPGME_EXPORT WKSPublishJob: public Job { @@ -66,7 +64,6 @@ public: ~WKSPublishJob(); - /** Start a check if WKS Publishing is supported. As this involves * an HTTP Query it might take a while. Returns GPG_ERR_NOT_SUPPORED * result if GnuPG is too old or the required tools are not installed.
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/Makefile.am
Changed
@@ -28,34 +28,51 @@ the_tests = \ t-addexistingsubkey \ + t-decryptverify \ t-keylist t-keylocate t-ownertrust t-tofuinfo \ t-encrypt t-verify t-various t-config t-remarks t-trustsignatures \ - t-changeexpiryjob t-wkdlookup t-import + t-changeexpiryjob t-wkdlookup t-import t-revokekey t-setprimaryuserid TESTS = initial.test $(the_tests) final.test moc_files = \ t-addexistingsubkey.moc \ + t-decryptverify.moc \ t-keylist.moc t-keylocate.moc t-ownertrust.moc t-tofuinfo.moc \ t-encrypt.moc t-support.hmoc t-wkspublish.moc t-verify.moc \ t-various.moc t-config.moc t-remarks.moc t-trustsignatures.moc \ - t-changeexpiryjob.moc t-wkdlookup.moc t-import.moc + t-changeexpiryjob.moc t-wkdlookup.moc t-import.moc t-revokekey.moc \ + t-setprimaryuserid.moc AM_LDFLAGS = -no-install +if WANT_QT5 LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ - ../../../src/libgpgme.la @GPGME_QT_LIBS@ @GPG_ERROR_LIBS@ \ - @GPGME_QTTEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ + ../../../src/libgpgme.la @GPGME_QT5_LIBS@ @GPG_ERROR_LIBS@ \ + @GPGME_QT5TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ - @GPG_ERROR_CFLAGS@ @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ \ - @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ -DBUILDING_QGPGME \ + @GPG_ERROR_CFLAGS@ @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ \ + @LIBASSUAN_CFLAGS@ @GPGME_QT5TEST_CFLAGS@ -DBUILDING_QGPGME \ -I$(top_srcdir)/lang/qt/src \ -DTOP_SRCDIR="$(top_srcdir)" +endif +if WANT_QT6 +LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgmeqt6.la \ + ../../../src/libgpgme.la @GPGME_QT6_LIBS@ @GPG_ERROR_LIBS@ \ + @GPGME_QT6TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ + +AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ + @GPG_ERROR_CFLAGS@ @GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ \ + @LIBASSUAN_CFLAGS@ @GPGME_QT6TEST_CFLAGS@ -DBUILDING_QGPGME \ + -I$(top_srcdir)/lang/qt/src \ + -DTOP_SRCDIR="$(top_srcdir)" +endif support_src = t-support.h t-support.cpp t_addexistingsubkey_SOURCES = t-addexistingsubkey.cpp $(support_src) +t_decryptverify_SOURCES = t-decryptverify.cpp $(support_src) t_keylist_SOURCES = t-keylist.cpp $(support_src) t_keylocate_SOURCES = t-keylocate.cpp $(support_src) t_ownertrust_SOURCES = t-ownertrust.cpp $(support_src) @@ -70,10 +87,16 @@ t_changeexpiryjob_SOURCES = t-changeexpiryjob.cpp $(support_src) t_wkdlookup_SOURCES = t-wkdlookup.cpp $(support_src) t_import_SOURCES = t-import.cpp $(support_src) +t_revokekey_SOURCES = t-revokekey.cpp $(support_src) +t_setprimaryuserid_SOURCES = t-setprimaryuserid.cpp $(support_src) +run_decryptverifyarchivejob_SOURCES = run-decryptverifyarchivejob.cpp +run_encryptarchivejob_SOURCES = run-encryptarchivejob.cpp run_exportjob_SOURCES = run-exportjob.cpp run_importjob_SOURCES = run-importjob.cpp run_keyformailboxjob_SOURCES = run-keyformailboxjob.cpp run_receivekeysjob_SOURCES = run-receivekeysjob.cpp +run_refreshkeysjob_SOURCES = run-refreshkeysjob.cpp +run_signarchivejob_SOURCES = run-signarchivejob.cpp nodist_t_keylist_SOURCES = $(moc_files) @@ -81,10 +104,16 @@ noinst_PROGRAMS = \ t-addexistingsubkey \ + t-decryptverify \ t-keylist t-keylocate t-ownertrust t-tofuinfo t-encrypt \ run-keyformailboxjob t-wkspublish t-verify t-various t-config t-remarks \ - t-trustsignatures t-changeexpiryjob t-wkdlookup t-import run-importjob \ - run-exportjob run-receivekeysjob + t-trustsignatures t-changeexpiryjob t-wkdlookup t-import t-revokekey \ + t-setprimaryuserid \ + run-decryptverifyarchivejob \ + run-encryptarchivejob \ + run-importjob run-exportjob run-receivekeysjob run-refreshkeysjob \ + run-signarchivejob + CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ gpg-agent.conf pubring.kbx~ S.gpg-agent gpg.conf pubring.gpg~ \ @@ -107,6 +136,7 @@ $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \ --passphrase "abc" \ --import $(top_srcdir)/tests/gpg/secdemo.asc + -$(TESTS_ENVIRONMENT) gpgconf --kill all touch pubring-stamp .cpp.moc:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/Makefile.in
Changed
@@ -108,17 +108,23 @@ build_triplet = @build@ host_triplet = @host@ TESTS = initial.test $(am__EXEEXT_1) final.test -noinst_PROGRAMS = t-addexistingsubkey$(EXEEXT) t-keylist$(EXEEXT) \ +noinst_PROGRAMS = t-addexistingsubkey$(EXEEXT) \ + t-decryptverify$(EXEEXT) t-keylist$(EXEEXT) \ t-keylocate$(EXEEXT) t-ownertrust$(EXEEXT) t-tofuinfo$(EXEEXT) \ t-encrypt$(EXEEXT) run-keyformailboxjob$(EXEEXT) \ t-wkspublish$(EXEEXT) t-verify$(EXEEXT) t-various$(EXEEXT) \ t-config$(EXEEXT) t-remarks$(EXEEXT) \ t-trustsignatures$(EXEEXT) t-changeexpiryjob$(EXEEXT) \ - t-wkdlookup$(EXEEXT) t-import$(EXEEXT) run-importjob$(EXEEXT) \ - run-exportjob$(EXEEXT) run-receivekeysjob$(EXEEXT) + t-wkdlookup$(EXEEXT) t-import$(EXEEXT) t-revokekey$(EXEEXT) \ + t-setprimaryuserid$(EXEEXT) \ + run-decryptverifyarchivejob$(EXEEXT) \ + run-encryptarchivejob$(EXEEXT) run-importjob$(EXEEXT) \ + run-exportjob$(EXEEXT) run-receivekeysjob$(EXEEXT) \ + run-refreshkeysjob$(EXEEXT) run-signarchivejob$(EXEEXT) subdir = lang/qt/tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -127,8 +133,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -137,112 +144,270 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = PROGRAMS = $(noinst_PROGRAMS) -am_run_exportjob_OBJECTS = run-exportjob.$(OBJEXT) -run_exportjob_OBJECTS = $(am_run_exportjob_OBJECTS) -run_exportjob_LDADD = $(LDADD) -run_exportjob_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +am_run_decryptverifyarchivejob_OBJECTS = \ + run-decryptverifyarchivejob.$(OBJEXT) +run_decryptverifyarchivejob_OBJECTS = \ + $(am_run_decryptverifyarchivejob_OBJECTS) +run_decryptverifyarchivejob_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_decryptverifyarchivejob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_decryptverifyarchivejob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent am__v_lt_1 = +am_run_encryptarchivejob_OBJECTS = run-encryptarchivejob.$(OBJEXT) +run_encryptarchivejob_OBJECTS = $(am_run_encryptarchivejob_OBJECTS) +run_encryptarchivejob_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_encryptarchivejob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_encryptarchivejob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la +am_run_exportjob_OBJECTS = run-exportjob.$(OBJEXT) +run_exportjob_OBJECTS = $(am_run_exportjob_OBJECTS) +run_exportjob_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_exportjob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_exportjob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_run_importjob_OBJECTS = run-importjob.$(OBJEXT) run_importjob_OBJECTS = $(am_run_importjob_OBJECTS) run_importjob_LDADD = $(LDADD) -run_importjob_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_importjob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_importjob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_run_keyformailboxjob_OBJECTS = run-keyformailboxjob.$(OBJEXT) run_keyformailboxjob_OBJECTS = $(am_run_keyformailboxjob_OBJECTS) run_keyformailboxjob_LDADD = $(LDADD) -run_keyformailboxjob_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_keyformailboxjob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_keyformailboxjob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_run_receivekeysjob_OBJECTS = run-receivekeysjob.$(OBJEXT) run_receivekeysjob_OBJECTS = $(am_run_receivekeysjob_OBJECTS) run_receivekeysjob_LDADD = $(LDADD) -run_receivekeysjob_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_receivekeysjob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_receivekeysjob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la +am_run_refreshkeysjob_OBJECTS = run-refreshkeysjob.$(OBJEXT) +run_refreshkeysjob_OBJECTS = $(am_run_refreshkeysjob_OBJECTS) +run_refreshkeysjob_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_refreshkeysjob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_refreshkeysjob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la +am_run_signarchivejob_OBJECTS = run-signarchivejob.$(OBJEXT) +run_signarchivejob_OBJECTS = $(am_run_signarchivejob_OBJECTS) +run_signarchivejob_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@run_signarchivejob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@run_signarchivejob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am__objects_1 = t-support.$(OBJEXT) am_t_addexistingsubkey_OBJECTS = t-addexistingsubkey.$(OBJEXT) \ $(am__objects_1) t_addexistingsubkey_OBJECTS = $(am_t_addexistingsubkey_OBJECTS) t_addexistingsubkey_LDADD = $(LDADD) -t_addexistingsubkey_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_addexistingsubkey_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_addexistingsubkey_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_t_changeexpiryjob_OBJECTS = t-changeexpiryjob.$(OBJEXT) \ $(am__objects_1) t_changeexpiryjob_OBJECTS = $(am_t_changeexpiryjob_OBJECTS) t_changeexpiryjob_LDADD = $(LDADD) -t_changeexpiryjob_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_changeexpiryjob_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_changeexpiryjob_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_t_config_OBJECTS = t-config.$(OBJEXT) $(am__objects_1) t_config_OBJECTS = $(am_t_config_OBJECTS) t_config_LDADD = $(LDADD) -t_config_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_config_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_config_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la +am_t_decryptverify_OBJECTS = t-decryptverify.$(OBJEXT) \ + $(am__objects_1) +t_decryptverify_OBJECTS = $(am_t_decryptverify_OBJECTS) +t_decryptverify_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_decryptverify_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_decryptverify_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_t_encrypt_OBJECTS = t-encrypt.$(OBJEXT) $(am__objects_1) t_encrypt_OBJECTS = $(am_t_encrypt_OBJECTS) t_encrypt_LDADD = $(LDADD) -t_encrypt_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_encrypt_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_encrypt_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_import_OBJECTS = t-import.$(OBJEXT) $(am__objects_1) t_import_OBJECTS = $(am_t_import_OBJECTS) t_import_LDADD = $(LDADD) -t_import_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_import_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_import_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_keylist_OBJECTS = t-keylist.$(OBJEXT) $(am__objects_1) am__objects_2 = nodist_t_keylist_OBJECTS = $(am__objects_2) t_keylist_OBJECTS = $(am_t_keylist_OBJECTS) \ $(nodist_t_keylist_OBJECTS) t_keylist_LDADD = $(LDADD) -t_keylist_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_keylist_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_keylist_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_keylocate_OBJECTS = t-keylocate.$(OBJEXT) $(am__objects_1) t_keylocate_OBJECTS = $(am_t_keylocate_OBJECTS) t_keylocate_LDADD = $(LDADD) -t_keylocate_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_keylocate_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_keylocate_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_ownertrust_OBJECTS = t-ownertrust.$(OBJEXT) $(am__objects_1) t_ownertrust_OBJECTS = $(am_t_ownertrust_OBJECTS) t_ownertrust_LDADD = $(LDADD) -t_ownertrust_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_ownertrust_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_ownertrust_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_t_remarks_OBJECTS = t-remarks.$(OBJEXT) $(am__objects_1) t_remarks_OBJECTS = $(am_t_remarks_OBJECTS) t_remarks_LDADD = $(LDADD) -t_remarks_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_remarks_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_remarks_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la +am_t_revokekey_OBJECTS = t-revokekey.$(OBJEXT) $(am__objects_1) +t_revokekey_OBJECTS = $(am_t_revokekey_OBJECTS) +t_revokekey_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_revokekey_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_revokekey_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la +am_t_setprimaryuserid_OBJECTS = t-setprimaryuserid.$(OBJEXT) \ + $(am__objects_1) +t_setprimaryuserid_OBJECTS = $(am_t_setprimaryuserid_OBJECTS) +t_setprimaryuserid_LDADD = $(LDADD) +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_setprimaryuserid_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_setprimaryuserid_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_t_tofuinfo_OBJECTS = t-tofuinfo.$(OBJEXT) $(am__objects_1) t_tofuinfo_OBJECTS = $(am_t_tofuinfo_OBJECTS) t_tofuinfo_LDADD = $(LDADD) -t_tofuinfo_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_tofuinfo_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_tofuinfo_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_trustsignatures_OBJECTS = t-trustsignatures.$(OBJEXT) \ $(am__objects_1) t_trustsignatures_OBJECTS = $(am_t_trustsignatures_OBJECTS) t_trustsignatures_LDADD = $(LDADD) -t_trustsignatures_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_trustsignatures_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_trustsignatures_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la am_t_various_OBJECTS = t-various.$(OBJEXT) $(am__objects_1) t_various_OBJECTS = $(am_t_various_OBJECTS) t_various_LDADD = $(LDADD) -t_various_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_various_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_various_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_verify_OBJECTS = t-verify.$(OBJEXT) $(am__objects_1) t_verify_OBJECTS = $(am_t_verify_OBJECTS) t_verify_LDADD = $(LDADD) -t_verify_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_verify_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_verify_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_wkdlookup_OBJECTS = t-wkdlookup.$(OBJEXT) $(am__objects_1) t_wkdlookup_OBJECTS = $(am_t_wkdlookup_OBJECTS) t_wkdlookup_LDADD = $(LDADD) -t_wkdlookup_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_wkdlookup_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_wkdlookup_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_TRUE@ ../src/libqgpgme.la ../../../src/libgpgme.la am_t_wkspublish_OBJECTS = t-wkspublish.$(OBJEXT) $(am__objects_1) t_wkspublish_OBJECTS = $(am_t_wkspublish_OBJECTS) t_wkspublish_LDADD = $(LDADD) -t_wkspublish_DEPENDENCIES = ../../cpp/src/libgpgmepp.la \ - ../src/libqgpgme.la ../../../src/libgpgme.la +@WANT_QT5_FALSE@@WANT_QT6_TRUE@t_wkspublish_DEPENDENCIES = \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../cpp/src/libgpgmepp.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../src/libqgpgmeqt6.la \ +@WANT_QT5_FALSE@@WANT_QT6_TRUE@ ../../../src/libgpgme.la +@WANT_QT5_TRUE@t_wkspublish_DEPENDENCIES = \ +@WANT_QT5_TRUE@ ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -258,19 +423,23 @@ DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/conf depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__maybe_remake_depfiles = depfiles -am__depfiles_remade = ./$(DEPDIR)/run-exportjob.Po \ - ./$(DEPDIR)/run-importjob.Po \ +am__depfiles_remade = ./$(DEPDIR)/run-decryptverifyarchivejob.Po \ + ./$(DEPDIR)/run-encryptarchivejob.Po \ + ./$(DEPDIR)/run-exportjob.Po ./$(DEPDIR)/run-importjob.Po \ ./$(DEPDIR)/run-keyformailboxjob.Po \ ./$(DEPDIR)/run-receivekeysjob.Po \ + ./$(DEPDIR)/run-refreshkeysjob.Po \ + ./$(DEPDIR)/run-signarchivejob.Po \ ./$(DEPDIR)/t-addexistingsubkey.Po \ ./$(DEPDIR)/t-changeexpiryjob.Po ./$(DEPDIR)/t-config.Po \ - ./$(DEPDIR)/t-encrypt.Po ./$(DEPDIR)/t-import.Po \ - ./$(DEPDIR)/t-keylist.Po ./$(DEPDIR)/t-keylocate.Po \ - ./$(DEPDIR)/t-ownertrust.Po ./$(DEPDIR)/t-remarks.Po \ - ./$(DEPDIR)/t-support.Po ./$(DEPDIR)/t-tofuinfo.Po \ - ./$(DEPDIR)/t-trustsignatures.Po ./$(DEPDIR)/t-various.Po \ - ./$(DEPDIR)/t-verify.Po ./$(DEPDIR)/t-wkdlookup.Po \ - ./$(DEPDIR)/t-wkspublish.Po + ./$(DEPDIR)/t-decryptverify.Po ./$(DEPDIR)/t-encrypt.Po \ + ./$(DEPDIR)/t-import.Po ./$(DEPDIR)/t-keylist.Po \ + ./$(DEPDIR)/t-keylocate.Po ./$(DEPDIR)/t-ownertrust.Po \ + ./$(DEPDIR)/t-remarks.Po ./$(DEPDIR)/t-revokekey.Po \ + ./$(DEPDIR)/t-setprimaryuserid.Po ./$(DEPDIR)/t-support.Po \ + ./$(DEPDIR)/t-tofuinfo.Po ./$(DEPDIR)/t-trustsignatures.Po \ + ./$(DEPDIR)/t-various.Po ./$(DEPDIR)/t-verify.Po \ + ./$(DEPDIR)/t-wkdlookup.Po ./$(DEPDIR)/t-wkspublish.Po am__mv = mv -f CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) @@ -308,25 +477,34 @@ am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = -SOURCES = $(run_exportjob_SOURCES) $(run_importjob_SOURCES) \ - $(run_keyformailboxjob_SOURCES) $(run_receivekeysjob_SOURCES) \ - $(t_addexistingsubkey_SOURCES) $(t_changeexpiryjob_SOURCES) \ - $(t_config_SOURCES) $(t_encrypt_SOURCES) $(t_import_SOURCES) \ - $(t_keylist_SOURCES) $(nodist_t_keylist_SOURCES) \ - $(t_keylocate_SOURCES) $(t_ownertrust_SOURCES) \ - $(t_remarks_SOURCES) $(t_tofuinfo_SOURCES) \ - $(t_trustsignatures_SOURCES) $(t_various_SOURCES) \ - $(t_verify_SOURCES) $(t_wkdlookup_SOURCES) \ - $(t_wkspublish_SOURCES) -DIST_SOURCES = $(run_exportjob_SOURCES) $(run_importjob_SOURCES) \ - $(run_keyformailboxjob_SOURCES) $(run_receivekeysjob_SOURCES) \ - $(t_addexistingsubkey_SOURCES) $(t_changeexpiryjob_SOURCES) \ - $(t_config_SOURCES) $(t_encrypt_SOURCES) $(t_import_SOURCES) \ - $(t_keylist_SOURCES) $(t_keylocate_SOURCES) \ +SOURCES = $(run_decryptverifyarchivejob_SOURCES) \ + $(run_encryptarchivejob_SOURCES) $(run_exportjob_SOURCES) \ + $(run_importjob_SOURCES) $(run_keyformailboxjob_SOURCES) \ + $(run_receivekeysjob_SOURCES) $(run_refreshkeysjob_SOURCES) \ + $(run_signarchivejob_SOURCES) $(t_addexistingsubkey_SOURCES) \ + $(t_changeexpiryjob_SOURCES) $(t_config_SOURCES) \ + $(t_decryptverify_SOURCES) $(t_encrypt_SOURCES) \ + $(t_import_SOURCES) $(t_keylist_SOURCES) \ + $(nodist_t_keylist_SOURCES) $(t_keylocate_SOURCES) \ $(t_ownertrust_SOURCES) $(t_remarks_SOURCES) \ + $(t_revokekey_SOURCES) $(t_setprimaryuserid_SOURCES) \ $(t_tofuinfo_SOURCES) $(t_trustsignatures_SOURCES) \ $(t_various_SOURCES) $(t_verify_SOURCES) \ $(t_wkdlookup_SOURCES) $(t_wkspublish_SOURCES) +DIST_SOURCES = $(run_decryptverifyarchivejob_SOURCES) \ + $(run_encryptarchivejob_SOURCES) $(run_exportjob_SOURCES) \ + $(run_importjob_SOURCES) $(run_keyformailboxjob_SOURCES) \ + $(run_receivekeysjob_SOURCES) $(run_refreshkeysjob_SOURCES) \ + $(run_signarchivejob_SOURCES) $(t_addexistingsubkey_SOURCES) \ + $(t_changeexpiryjob_SOURCES) $(t_config_SOURCES) \ + $(t_decryptverify_SOURCES) $(t_encrypt_SOURCES) \ + $(t_import_SOURCES) $(t_keylist_SOURCES) \ + $(t_keylocate_SOURCES) $(t_ownertrust_SOURCES) \ + $(t_remarks_SOURCES) $(t_revokekey_SOURCES) \ + $(t_setprimaryuserid_SOURCES) $(t_tofuinfo_SOURCES) \ + $(t_trustsignatures_SOURCES) $(t_various_SOURCES) \ + $(t_verify_SOURCES) $(t_wkdlookup_SOURCES) \ + $(t_wkspublish_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ @@ -373,12 +551,13 @@ std='m'; \ fi; \ } -am__EXEEXT_1 = t-addexistingsubkey$(EXEEXT) t-keylist$(EXEEXT) \ - t-keylocate$(EXEEXT) t-ownertrust$(EXEEXT) t-tofuinfo$(EXEEXT) \ - t-encrypt$(EXEEXT) t-verify$(EXEEXT) t-various$(EXEEXT) \ - t-config$(EXEEXT) t-remarks$(EXEEXT) \ +am__EXEEXT_1 = t-addexistingsubkey$(EXEEXT) t-decryptverify$(EXEEXT) \ + t-keylist$(EXEEXT) t-keylocate$(EXEEXT) t-ownertrust$(EXEEXT) \ + t-tofuinfo$(EXEEXT) t-encrypt$(EXEEXT) t-verify$(EXEEXT) \ + t-various$(EXEEXT) t-config$(EXEEXT) t-remarks$(EXEEXT) \ t-trustsignatures$(EXEEXT) t-changeexpiryjob$(EXEEXT) \ - t-wkdlookup$(EXEEXT) t-import$(EXEEXT) + t-wkdlookup$(EXEEXT) t-import$(EXEEXT) t-revokekey$(EXEEXT) \ + t-setprimaryuserid$(EXEEXT) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp \ $(top_srcdir)/build-aux/mkinstalldirs @@ -432,10 +611,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -445,6 +629,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -587,30 +772,44 @@ EXTRA_DIST = initial.test final.test the_tests = \ t-addexistingsubkey \ + t-decryptverify \ t-keylist t-keylocate t-ownertrust t-tofuinfo \ t-encrypt t-verify t-various t-config t-remarks t-trustsignatures \ - t-changeexpiryjob t-wkdlookup t-import + t-changeexpiryjob t-wkdlookup t-import t-revokekey t-setprimaryuserid moc_files = \ t-addexistingsubkey.moc \ + t-decryptverify.moc \ t-keylist.moc t-keylocate.moc t-ownertrust.moc t-tofuinfo.moc \ t-encrypt.moc t-support.hmoc t-wkspublish.moc t-verify.moc \ t-various.moc t-config.moc t-remarks.moc t-trustsignatures.moc \ - t-changeexpiryjob.moc t-wkdlookup.moc t-import.moc + t-changeexpiryjob.moc t-wkdlookup.moc t-import.moc t-revokekey.moc \ + t-setprimaryuserid.moc AM_LDFLAGS = -no-install -LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ - ../../../src/libgpgme.la @GPGME_QT_LIBS@ @GPG_ERROR_LIBS@ \ - @GPGME_QTTEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ - -AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ - @GPG_ERROR_CFLAGS@ @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ \ - @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ -DBUILDING_QGPGME \ - -I$(top_srcdir)/lang/qt/src \ - -DTOP_SRCDIR="$(top_srcdir)" +@WANT_QT5_TRUE@LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgme.la \ +@WANT_QT5_TRUE@ ../../../src/libgpgme.la @GPGME_QT5_LIBS@ @GPG_ERROR_LIBS@ \ +@WANT_QT5_TRUE@ @GPGME_QT5TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ + +@WANT_QT6_TRUE@LDADD = ../../cpp/src/libgpgmepp.la ../src/libqgpgmeqt6.la \ +@WANT_QT6_TRUE@ ../../../src/libgpgme.la @GPGME_QT6_LIBS@ @GPG_ERROR_LIBS@ \ +@WANT_QT6_TRUE@ @GPGME_QT6TEST_LIBS@ @LDADD_FOR_TESTS_KLUDGE@ -lstdc++ + +@WANT_QT5_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ +@WANT_QT5_TRUE@ @GPG_ERROR_CFLAGS@ @GPGME_QT5_CFLAGS@ @GPG_ERROR_CFLAGS@ \ +@WANT_QT5_TRUE@ @LIBASSUAN_CFLAGS@ @GPGME_QT5TEST_CFLAGS@ -DBUILDING_QGPGME \ +@WANT_QT5_TRUE@ -I$(top_srcdir)/lang/qt/src \ +@WANT_QT5_TRUE@ -DTOP_SRCDIR="$(top_srcdir)" + +@WANT_QT6_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \ +@WANT_QT6_TRUE@ @GPG_ERROR_CFLAGS@ @GPGME_QT6_CFLAGS@ @GPG_ERROR_CFLAGS@ \ +@WANT_QT6_TRUE@ @LIBASSUAN_CFLAGS@ @GPGME_QT6TEST_CFLAGS@ -DBUILDING_QGPGME \ +@WANT_QT6_TRUE@ -I$(top_srcdir)/lang/qt/src \ +@WANT_QT6_TRUE@ -DTOP_SRCDIR="$(top_srcdir)" support_src = t-support.h t-support.cpp t_addexistingsubkey_SOURCES = t-addexistingsubkey.cpp $(support_src) +t_decryptverify_SOURCES = t-decryptverify.cpp $(support_src) t_keylist_SOURCES = t-keylist.cpp $(support_src) t_keylocate_SOURCES = t-keylocate.cpp $(support_src) t_ownertrust_SOURCES = t-ownertrust.cpp $(support_src) @@ -625,10 +824,16 @@ t_changeexpiryjob_SOURCES = t-changeexpiryjob.cpp $(support_src) t_wkdlookup_SOURCES = t-wkdlookup.cpp $(support_src) t_import_SOURCES = t-import.cpp $(support_src) +t_revokekey_SOURCES = t-revokekey.cpp $(support_src) +t_setprimaryuserid_SOURCES = t-setprimaryuserid.cpp $(support_src) +run_decryptverifyarchivejob_SOURCES = run-decryptverifyarchivejob.cpp +run_encryptarchivejob_SOURCES = run-encryptarchivejob.cpp run_exportjob_SOURCES = run-exportjob.cpp run_importjob_SOURCES = run-importjob.cpp run_keyformailboxjob_SOURCES = run-keyformailboxjob.cpp run_receivekeysjob_SOURCES = run-receivekeysjob.cpp +run_refreshkeysjob_SOURCES = run-refreshkeysjob.cpp +run_signarchivejob_SOURCES = run-signarchivejob.cpp nodist_t_keylist_SOURCES = $(moc_files) BUILT_SOURCES = $(moc_files) pubring-stamp CLEANFILES = secring.gpg pubring.gpg pubring.kbx trustdb.gpg dirmngr.conf \ @@ -680,6 +885,14 @@ echo " rm -f" $$list; \ rm -f $$list +run-decryptverifyarchivejob$(EXEEXT): $(run_decryptverifyarchivejob_OBJECTS) $(run_decryptverifyarchivejob_DEPENDENCIES) $(EXTRA_run_decryptverifyarchivejob_DEPENDENCIES) + @rm -f run-decryptverifyarchivejob$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(run_decryptverifyarchivejob_OBJECTS) $(run_decryptverifyarchivejob_LDADD) $(LIBS) + +run-encryptarchivejob$(EXEEXT): $(run_encryptarchivejob_OBJECTS) $(run_encryptarchivejob_DEPENDENCIES) $(EXTRA_run_encryptarchivejob_DEPENDENCIES) + @rm -f run-encryptarchivejob$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(run_encryptarchivejob_OBJECTS) $(run_encryptarchivejob_LDADD) $(LIBS) + run-exportjob$(EXEEXT): $(run_exportjob_OBJECTS) $(run_exportjob_DEPENDENCIES) $(EXTRA_run_exportjob_DEPENDENCIES) @rm -f run-exportjob$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(run_exportjob_OBJECTS) $(run_exportjob_LDADD) $(LIBS) @@ -696,6 +909,14 @@ @rm -f run-receivekeysjob$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(run_receivekeysjob_OBJECTS) $(run_receivekeysjob_LDADD) $(LIBS) +run-refreshkeysjob$(EXEEXT): $(run_refreshkeysjob_OBJECTS) $(run_refreshkeysjob_DEPENDENCIES) $(EXTRA_run_refreshkeysjob_DEPENDENCIES) + @rm -f run-refreshkeysjob$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(run_refreshkeysjob_OBJECTS) $(run_refreshkeysjob_LDADD) $(LIBS) + +run-signarchivejob$(EXEEXT): $(run_signarchivejob_OBJECTS) $(run_signarchivejob_DEPENDENCIES) $(EXTRA_run_signarchivejob_DEPENDENCIES) + @rm -f run-signarchivejob$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(run_signarchivejob_OBJECTS) $(run_signarchivejob_LDADD) $(LIBS) + t-addexistingsubkey$(EXEEXT): $(t_addexistingsubkey_OBJECTS) $(t_addexistingsubkey_DEPENDENCIES) $(EXTRA_t_addexistingsubkey_DEPENDENCIES) @rm -f t-addexistingsubkey$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t_addexistingsubkey_OBJECTS) $(t_addexistingsubkey_LDADD) $(LIBS) @@ -708,6 +929,10 @@ @rm -f t-config$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t_config_OBJECTS) $(t_config_LDADD) $(LIBS) +t-decryptverify$(EXEEXT): $(t_decryptverify_OBJECTS) $(t_decryptverify_DEPENDENCIES) $(EXTRA_t_decryptverify_DEPENDENCIES) + @rm -f t-decryptverify$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(t_decryptverify_OBJECTS) $(t_decryptverify_LDADD) $(LIBS) + t-encrypt$(EXEEXT): $(t_encrypt_OBJECTS) $(t_encrypt_DEPENDENCIES) $(EXTRA_t_encrypt_DEPENDENCIES) @rm -f t-encrypt$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t_encrypt_OBJECTS) $(t_encrypt_LDADD) $(LIBS) @@ -732,6 +957,14 @@ @rm -f t-remarks$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t_remarks_OBJECTS) $(t_remarks_LDADD) $(LIBS) +t-revokekey$(EXEEXT): $(t_revokekey_OBJECTS) $(t_revokekey_DEPENDENCIES) $(EXTRA_t_revokekey_DEPENDENCIES) + @rm -f t-revokekey$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(t_revokekey_OBJECTS) $(t_revokekey_LDADD) $(LIBS) + +t-setprimaryuserid$(EXEEXT): $(t_setprimaryuserid_OBJECTS) $(t_setprimaryuserid_DEPENDENCIES) $(EXTRA_t_setprimaryuserid_DEPENDENCIES) + @rm -f t-setprimaryuserid$(EXEEXT) + $(AM_V_CXXLD)$(CXXLINK) $(t_setprimaryuserid_OBJECTS) $(t_setprimaryuserid_LDADD) $(LIBS) + t-tofuinfo$(EXEEXT): $(t_tofuinfo_OBJECTS) $(t_tofuinfo_DEPENDENCIES) $(EXTRA_t_tofuinfo_DEPENDENCIES) @rm -f t-tofuinfo$(EXEEXT) $(AM_V_CXXLD)$(CXXLINK) $(t_tofuinfo_OBJECTS) $(t_tofuinfo_LDADD) $(LIBS) @@ -762,19 +995,26 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-decryptverifyarchivejob.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-encryptarchivejob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-exportjob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-importjob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-keyformailboxjob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-receivekeysjob.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-refreshkeysjob.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/run-signarchivejob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-addexistingsubkey.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-changeexpiryjob.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-config.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-decryptverify.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-encrypt.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-import.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-keylist.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-keylocate.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-ownertrust.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-remarks.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-revokekey.Po@am__quote@ # am--include-marker +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-setprimaryuserid.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-support.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-tofuinfo.Po@am__quote@ # am--include-marker @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/t-trustsignatures.Po@am__quote@ # am--include-marker @@ -1040,19 +1280,26 @@ mostlyclean-am distclean: distclean-am - -rm -f ./$(DEPDIR)/run-exportjob.Po + -rm -f ./$(DEPDIR)/run-decryptverifyarchivejob.Po + -rm -f ./$(DEPDIR)/run-encryptarchivejob.Po + -rm -f ./$(DEPDIR)/run-exportjob.Po -rm -f ./$(DEPDIR)/run-importjob.Po -rm -f ./$(DEPDIR)/run-keyformailboxjob.Po -rm -f ./$(DEPDIR)/run-receivekeysjob.Po + -rm -f ./$(DEPDIR)/run-refreshkeysjob.Po + -rm -f ./$(DEPDIR)/run-signarchivejob.Po -rm -f ./$(DEPDIR)/t-addexistingsubkey.Po -rm -f ./$(DEPDIR)/t-changeexpiryjob.Po -rm -f ./$(DEPDIR)/t-config.Po + -rm -f ./$(DEPDIR)/t-decryptverify.Po -rm -f ./$(DEPDIR)/t-encrypt.Po -rm -f ./$(DEPDIR)/t-import.Po -rm -f ./$(DEPDIR)/t-keylist.Po -rm -f ./$(DEPDIR)/t-keylocate.Po -rm -f ./$(DEPDIR)/t-ownertrust.Po -rm -f ./$(DEPDIR)/t-remarks.Po + -rm -f ./$(DEPDIR)/t-revokekey.Po + -rm -f ./$(DEPDIR)/t-setprimaryuserid.Po -rm -f ./$(DEPDIR)/t-support.Po -rm -f ./$(DEPDIR)/t-tofuinfo.Po -rm -f ./$(DEPDIR)/t-trustsignatures.Po @@ -1105,19 +1352,26 @@ installcheck-am: maintainer-clean: maintainer-clean-am - -rm -f ./$(DEPDIR)/run-exportjob.Po + -rm -f ./$(DEPDIR)/run-decryptverifyarchivejob.Po + -rm -f ./$(DEPDIR)/run-encryptarchivejob.Po + -rm -f ./$(DEPDIR)/run-exportjob.Po -rm -f ./$(DEPDIR)/run-importjob.Po -rm -f ./$(DEPDIR)/run-keyformailboxjob.Po -rm -f ./$(DEPDIR)/run-receivekeysjob.Po + -rm -f ./$(DEPDIR)/run-refreshkeysjob.Po + -rm -f ./$(DEPDIR)/run-signarchivejob.Po -rm -f ./$(DEPDIR)/t-addexistingsubkey.Po -rm -f ./$(DEPDIR)/t-changeexpiryjob.Po -rm -f ./$(DEPDIR)/t-config.Po + -rm -f ./$(DEPDIR)/t-decryptverify.Po -rm -f ./$(DEPDIR)/t-encrypt.Po -rm -f ./$(DEPDIR)/t-import.Po -rm -f ./$(DEPDIR)/t-keylist.Po -rm -f ./$(DEPDIR)/t-keylocate.Po -rm -f ./$(DEPDIR)/t-ownertrust.Po -rm -f ./$(DEPDIR)/t-remarks.Po + -rm -f ./$(DEPDIR)/t-revokekey.Po + -rm -f ./$(DEPDIR)/t-setprimaryuserid.Po -rm -f ./$(DEPDIR)/t-support.Po -rm -f ./$(DEPDIR)/t-tofuinfo.Po -rm -f ./$(DEPDIR)/t-trustsignatures.Po @@ -1179,6 +1433,7 @@ $(TESTS_ENVIRONMENT) $(GPG) --no-permission-warning \ --passphrase "abc" \ --import $(top_srcdir)/tests/gpg/secdemo.asc + -$(TESTS_ENVIRONMENT) gpgconf --kill all touch pubring-stamp .cpp.moc:
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/run-decryptverifyarchivejob.cpp
Added
@@ -0,0 +1,122 @@ +/* + run-decryptverifyarchivejob.cpp + + This file is part of QGpgME's test suite. + Copyright (c) 2023 by g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include <decryptverifyarchivejob.h> +#include <protocol.h> + +#include <QCommandLineParser> +#include <QCoreApplication> +#include <QDebug> + +#include <context.h> +#include <decryptionresult.h> +#include <verificationresult.h> + +#include <iostream> + +using namespace GpgME; + +std::ostream &operator<<(std::ostream &os, const QString &s) +{ + return os << s.toLocal8Bit().constData(); +} + +struct CommandLineOptions { + QString outputDirectory; + QString archiveName; +}; + +CommandLineOptions parseCommandLine(const QStringList &arguments) +{ + CommandLineOptions options; + + QCommandLineParser parser; + parser.setApplicationDescription("Test program for DecryptVerifyArchiveJob"); + parser.addHelpOption(); + parser.addOptions({ + {{"C", "directory"}, "Extract the files into the directory DIRECTORY.", "DIRECTORY"}, + }); + parser.addPositionalArgument("archive", "The archive to decrypt and extract"); + + parser.process(arguments); + + const auto args = parser.positionalArguments(); + if (args.size() != 1) { + parser.showHelp(1); + } + + options.outputDirectory = parser.value("directory"); + options.archiveName = args.first(); + + return options; +} + +int main(int argc, char **argv) +{ + GpgME::initializeLibrary(); + + QCoreApplication app{argc, argv}; + app.setApplicationName("run-decryptverifyarchivejob"); + + const auto options = parseCommandLine(app.arguments()); + + if (!QGpgME::DecryptVerifyArchiveJob::isSupported()) { + std::cerr << "Error: Decrypting and extracting archives is not supported by your version of gpg." << std::endl; + return 1; + } + + auto job = QGpgME::openpgp()->decryptVerifyArchiveJob(); + if (!job) { + std::cerr << "Error: Could not create job" << std::endl; + return 1; + } + job->setInputFile(options.archiveName); + job->setOutputDirectory(options.outputDirectory); + QObject::connect(job, &QGpgME::DecryptVerifyArchiveJob::result, &app, (const GpgME::DecryptionResult &decryptionResult, const GpgME::VerificationResult &verificationResult, const QString &auditLog, const GpgME::Error &) { + std::cerr << "Diagnostics: " << auditLog << std::endl; + std::cerr << "Decryption Result: " << decryptionResult << std::endl; + std::cerr << "Verification Result: " << verificationResult << std::endl; + qApp->quit(); + }); + + const auto err = job->startIt(); + if (err) { + std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl; + return 1; + } + + return app.exec(); +}
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/run-encryptarchivejob.cpp
Added
@@ -0,0 +1,191 @@ +/* + run-encryptarchivejob.cpp + + This file is part of QGpgME's test suite. + Copyright (c) 2023 by g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include <protocol.h> +#include <encryptarchivejob.h> +#include <signencryptarchivejob.h> + +#include <QCommandLineParser> +#include <QCoreApplication> +#include <QDebug> +#include <QDir> +#include <QFile> +#include <QFileInfo> + +#include <context.h> +#include <encryptionresult.h> +#include <signingresult.h> + +#include <iostream> + +using namespace GpgME; + +std::ostream &operator<<(std::ostream &os, const QString &s) +{ + return os << s.toLocal8Bit().constData(); +} + +struct CommandLineOptions { + bool armor = false; + bool sign = false; + QString archiveName; + QString baseDirectory; + std::vector<QString> filesAndDirectories; +}; + +CommandLineOptions parseCommandLine(const QStringList &arguments) +{ + CommandLineOptions options; + + QCommandLineParser parser; + parser.setApplicationDescription("Test program for EncryptArchiveJob and SignEncryptArchiveJob"); + parser.addHelpOption(); + parser.addOptions({ + {{"s", "sign"}, "Sign archive before encryption."}, + {{"o", "output"}, "Write output to FILE.", "FILE"}, + {{"a", "armor"}, "Create ASCII armored output."}, + {{"C", "directory"}, "Change to DIRECTORY before creating the archive.", "DIRECTORY"}, + }); + parser.addPositionalArgument("files", "Files and directories to add to the archive", "files directories"); + + parser.process(arguments); + + const auto args = parser.positionalArguments(); + if (args.empty()) { + parser.showHelp(1); + } + + options.armor = parser.isSet("armor"); + options.sign = parser.isSet("sign"); + options.archiveName = parser.value("output"); + options.baseDirectory = parser.value("directory"); + std::copy(args.begin(), args.end(), std::back_inserter(options.filesAndDirectories)); + + return options; +} + +QString checkOutputFilePath(const QString &fileName, const QString &baseDirectory) +{ + const QFileInfo fi{QDir{baseDirectory}, fileName}; + if (fi.exists()) { + qCritical() << "File" << fi.filePath() << "exists. Bailing out."; + return {}; + } + return fileName; +} + +int main(int argc, char **argv) +{ + GpgME::initializeLibrary(); + + QCoreApplication app{argc, argv}; + app.setApplicationName("run-encryptarchivejob"); + + const auto options = parseCommandLine(app.arguments()); + + if ((options.sign && !QGpgME::SignEncryptArchiveJob::isSupported()) + || (!options.sign && !QGpgME::EncryptArchiveJob::isSupported())) { + std::cerr << "Error: Encrypting archives is not supported by your version of gpg." << std::endl; + return 1; + } + + std::shared_ptr<QFile> output; + QString outputFilePath; + if (options.archiveName.isEmpty() || options.archiveName == QLatin1String{"-"}) { + output.reset(new QFile); + output->open(stdout, QIODevice::WriteOnly); + } else { + outputFilePath = checkOutputFilePath(options.archiveName, options.baseDirectory); + if (outputFilePath.isEmpty()) { + return 1; + } + } + + if (options.sign) { + auto job = QGpgME::openpgp()->signEncryptArchiveJob(options.armor); + if (!job) { + std::cerr << "Error: Could not create job" << std::endl; + return 1; + } + job->setBaseDirectory(options.baseDirectory); + QObject::connect(job, &QGpgME::SignEncryptArchiveJob::result, &app, (const GpgME::SigningResult &signingResult, const GpgME::EncryptionResult &encryptionResult, const QString &auditLog, const GpgME::Error &) { + std::cerr << "Diagnostics: " << auditLog << std::endl; + std::cerr << "Signing Result: " << signingResult << std::endl; + std::cerr << "Encryption Result: " << encryptionResult << std::endl; + qApp->quit(); + }); + + GpgME::Error err; + if (output) { + err = job->start({}, {}, options.filesAndDirectories, output, GpgME::Context::None); + } else { + job->setInputPaths(options.filesAndDirectories); + job->setOutputFile(outputFilePath); + err = job->startIt(); + } + if (err) { + std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl; + return 1; + } + } else { + auto job = QGpgME::openpgp()->encryptArchiveJob(options.armor); + if (!job) { + std::cerr << "Error: Could not create job" << std::endl; + return 1; + } + job->setBaseDirectory(options.baseDirectory); + QObject::connect(job, &QGpgME::EncryptArchiveJob::result, &app, (const GpgME::EncryptionResult &result, const QString &auditLog, const GpgME::Error &) { + std::cerr << "Diagnostics: " << auditLog << std::endl; + std::cerr << "Result: " << result << std::endl; + qApp->quit(); + }); + + GpgME::Error err; + if (output) { + err = job->start({}, options.filesAndDirectories, output, GpgME::Context::None); + } else { + job->setInputPaths(options.filesAndDirectories); + job->setOutputFile(outputFilePath); + err = job->startIt(); + } + if (err) { + std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl; + return 1; + } + } + + return app.exec(); +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/run-exportjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/run-exportjob.cpp
Changed
@@ -57,7 +57,7 @@ exit(exitCode); } -static auto createExportJob(unsigned int mode) +static QGpgME::ExportJob *createExportJob(unsigned int mode) { if (mode & Context::ExportSecretSubkey) { return QGpgME::openpgp()->secretSubkeyExportJob(/*armor=*/true);
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/run-refreshkeysjob.cpp
Added
@@ -0,0 +1,155 @@ +/* + run-refreshkeysjob.cpp + + This file is part of QGpgME's test suite. + Copyright (c) 2022 by g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include <protocol.h> +#include <refreshkeysjob.h> +#include <receivekeysjob.h> + +#include <QCoreApplication> +#include <QDebug> + +#include <context.h> +#include <importresult.h> + +#include <iostream> + +using namespace GpgME; + +std::ostream &operator<<(std::ostream &os, const QString &s) +{ + return os << s.toLocal8Bit().constData(); +} + +const char *displayName(Protocol protocol) +{ + switch (protocol) { + case GpgME::OpenPGP: + return "OpenPGP"; + case GpgME::CMS: + return "S/MIME"; + default: + return "Unknown protocol"; + } +} + +struct KeyAndError { + Key key; + Error error; +}; + +KeyAndError getKey(const QString &keyId, Protocol protocol) +{ + KeyAndError result; + + auto ctx = Context::create(protocol); + if (!ctx) { + result.error = Error::fromCode(GPG_ERR_GENERAL); + return result; + } + + result.key = ctx->key(keyId.toLatin1().constData(), result.error); + if (result.error.code() == GPG_ERR_EOF) { + result.error = Error{}; + } + return result; +} + +int main(int argc, char **argv) +{ + GpgME::initializeLibrary(); + + if (argc != 2) { + std::cerr << "Usage: " << argv0 << " KEYID" << std::endl; + return 1; + } + + QCoreApplication app{argc, argv}; + const auto keyId = qApp->arguments().last(); + + auto openPGPKey = getKey(keyId, GpgME::OpenPGP); + auto smimeKey = getKey(keyId, GpgME::CMS); + if ((!openPGPKey.key.isNull() && !smimeKey.key.isNull()) + || (openPGPKey.error.code() == GPG_ERR_AMBIGUOUS_NAME) + || (smimeKey.error.code() == GPG_ERR_AMBIGUOUS_NAME)) { + std::cerr << "Error: Multiple keys matching '" << keyId << "' found" << std::endl; + return 1; + } else if (openPGPKey.key.isNull() && smimeKey.key.isNull()) { + std::cerr << "Error: No key matching '" << keyId << "' found" << std::endl; + return 1; + } + if (openPGPKey.error) { + std::cerr << "Warning: Error while getting OpenPGP key: " << openPGPKey.error.asString() << std::endl; + } + if (smimeKey.error) { + std::cerr << "Warning: Error while getting S/MIME key: " << openPGPKey.error.asString() << std::endl; + } + auto key = openPGPKey.key.isNull() ? smimeKey.key : openPGPKey.key; + std::cout << "Refreshing " << displayName(key.protocol()) << " key " << key.userID(0).id() << std::endl; + + if (key.protocol() == GpgME::OpenPGP) { + auto job = QGpgME::openpgp()->receiveKeysJob(); + if (!job) { + std::cerr << "Error: Could not create job to refresh OpenPGP key" << std::endl; + return 1; + } + QObject::connect(job, &QGpgME::ReceiveKeysJob::result, &app, (const GpgME::ImportResult &result, const QString &, const GpgME::Error &) { + std::cout << "Result: " << result << std::endl; + qApp->quit(); + }); + const auto err = job->start({QString::fromLatin1(key.primaryFingerprint())}); + if (err) { + std::cerr << "Error: " << err.asString() << std::endl; + return 1; + } + } else { + auto job = QGpgME::smime()->refreshKeysJob(); + if (!job) { + std::cerr << "Error: Could not create job to refresh S/MIME key" << std::endl; + return 1; + } + QObject::connect(job, &QGpgME::RefreshKeysJob::result, &app, (const GpgME::Error &err) { + std::cout << "Result: " << err.asString() << std::endl; + qApp->quit(); + }); + const auto err = job->start({key}); + if (err) { + std::cerr << "Error: " << err.asString() << std::endl; + return 1; + } + } + + return app.exec(); +}
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/run-signarchivejob.cpp
Added
@@ -0,0 +1,157 @@ +/* + run-signarchivejob.cpp + + This file is part of QGpgME's test suite. + Copyright (c) 2023 by g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ + +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include <protocol.h> +#include <signarchivejob.h> + +#include <QCommandLineParser> +#include <QCoreApplication> +#include <QDebug> +#include <QDir> +#include <QFile> +#include <QFileInfo> + +#include <context.h> +#include <signingresult.h> + +#include <iostream> + +using namespace GpgME; + +std::ostream &operator<<(std::ostream &os, const QString &s) +{ + return os << s.toLocal8Bit().constData(); +} + +struct CommandLineOptions { + bool armor; + QString archiveName; + QString baseDirectory; + std::vector<QString> filesAndDirectories; +}; + +CommandLineOptions parseCommandLine(const QStringList &arguments) +{ + CommandLineOptions options; + + QCommandLineParser parser; + parser.setApplicationDescription("Test program for SignArchiveJob"); + parser.addHelpOption(); + parser.addOptions({ + {{"o", "output"}, "Write output to FILE.", "FILE"}, + {{"a", "armor"}, "Create ASCII armored output."}, + {{"C", "directory"}, "Change to DIRECTORY before creating the archive.", "DIRECTORY"}, + }); + parser.addPositionalArgument("files", "Files and directories to add to the archive", "files directories"); + + parser.process(arguments); + + const auto args = parser.positionalArguments(); + if (args.empty()) { + parser.showHelp(1); + } + + options.armor = parser.isSet("armor"); + options.archiveName = parser.value("output"); + options.baseDirectory = parser.value("directory"); + std::copy(args.begin(), args.end(), std::back_inserter(options.filesAndDirectories)); + + return options; +} + +QString checkOutputFilePath(const QString &fileName, const QString &baseDirectory) +{ + const QFileInfo fi{QDir{baseDirectory}, fileName}; + if (fi.exists()) { + qCritical() << "File" << fi.filePath() << "exists. Bailing out."; + return {}; + } + return fileName; +} + +int main(int argc, char **argv) +{ + GpgME::initializeLibrary(); + + QCoreApplication app{argc, argv}; + app.setApplicationName("run-signarchivejob"); + + const auto options = parseCommandLine(app.arguments()); + + if (!QGpgME::SignArchiveJob::isSupported()) { + std::cerr << "Error: Signing archives is not supported by your version of gpg." << std::endl; + return 1; + } + + std::shared_ptr<QFile> output; + QString outputFilePath; + if (options.archiveName.isEmpty() || options.archiveName == QLatin1String{"-"}) { + output.reset(new QFile); + output->open(stdout, QIODevice::WriteOnly); + } else { + outputFilePath = checkOutputFilePath(options.archiveName, options.baseDirectory); + if (outputFilePath.isEmpty()) { + return 1; + } + } + + auto job = QGpgME::openpgp()->signArchiveJob(options.armor); + if (!job) { + std::cerr << "Error: Could not create job" << std::endl; + return 1; + } + job->setBaseDirectory(options.baseDirectory); + QObject::connect(job, &QGpgME::SignArchiveJob::result, &app, (const GpgME::SigningResult &result, const QString &auditLog, const GpgME::Error &) { + std::cerr << "Diagnostics: " << auditLog << std::endl; + std::cerr << "Result: " << result << std::endl; + qApp->quit(); + }); + + GpgME::Error err; + if (output) { + err = job->start({}, options.filesAndDirectories, output); + } else { + job->setInputPaths(options.filesAndDirectories); + job->setOutputFile(outputFilePath); + err = job->startIt(); + } + if (err) { + std::cerr << "Error: Starting the job failed: " << err.asString() << std::endl; + return 1; + } + + return app.exec(); +}
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-addexistingsubkey.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-addexistingsubkey.cpp
Changed
@@ -168,7 +168,7 @@ QSignalSpy spy (this, SIGNAL(asyncDone())); QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT)); - QVERIFY(result.code() == GPG_ERR_NO_ERROR); + QCOMPARE(result.code(), static_cast<int>(GPG_ERR_NO_ERROR)); key.update(); QCOMPARE(key.numSubkeys(), 3u); } @@ -190,7 +190,7 @@ const auto result = job->exec(key, sourceSubkey); - QVERIFY(result.code() == GPG_ERR_NO_ERROR); + QCOMPARE(result.code(), static_cast<int>(GPG_ERR_NO_ERROR)); key.update(); QCOMPARE(key.numSubkeys(), 3u); QCOMPARE(key.subkey(2).expirationTime(), 0); @@ -213,24 +213,30 @@ const auto result = job->exec(key, sourceSubkey); - QVERIFY(result.code() == GPG_ERR_NO_ERROR); - key.update(); - QCOMPARE(key.numSubkeys(), 3u); - - // allow 1 second different expiration because gpg calculates with - // expiration as difference to current time and takes current time - // several times - const auto allowedDeltaTSeconds = 1; - const auto expectedExpirationRange = std::make_pair( - sourceSubkey.expirationTime() - allowedDeltaTSeconds, - sourceSubkey.expirationTime() + allowedDeltaTSeconds); - const auto actualExpiration = key.subkey(2).expirationTime(); - QVERIFY2(actualExpiration >= expectedExpirationRange.first, - ("actual: " + std::to_string(actualExpiration) + - "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); - QVERIFY2(actualExpiration <= expectedExpirationRange.second, - ("actual: " + std::to_string(actualExpiration) + - "; expected: " + std::to_string(expectedExpirationRange.second)).c_str()); + if (sourceSubkey.expirationTime() > 0) { + QCOMPARE(result.code(), static_cast<int>(GPG_ERR_NO_ERROR)); + key.update(); + QCOMPARE(key.numSubkeys(), 3u); + + // allow 1 second different expiration because gpg calculates with + // expiration as difference to current time and takes current time + // several times + const auto allowedDeltaTSeconds = 1; + const auto expectedExpirationRange = std::make_pair( + uint_least32_t(sourceSubkey.expirationTime()) - allowedDeltaTSeconds, + uint_least32_t(sourceSubkey.expirationTime()) + allowedDeltaTSeconds); + const auto actualExpiration = uint_least32_t(key.subkey(2).expirationTime()); + QVERIFY2(actualExpiration >= expectedExpirationRange.first, + ("actual: " + std::to_string(actualExpiration) + + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); + QVERIFY2(actualExpiration <= expectedExpirationRange.second, + ("actual: " + std::to_string(actualExpiration) + + "; expected: " + std::to_string(expectedExpirationRange.second)).c_str()); + } else { + // on 32-bit systems the expiration date of the test key overflows; + // in this case we expect an appropriate error code + QCOMPARE(result.code(), static_cast<int>(GPG_ERR_INV_TIME)); + } } private:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-changeexpiryjob.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-changeexpiryjob.cpp
Changed
@@ -70,7 +70,7 @@ QVERIFY(!key.isNull()); QVERIFY(!key.subkey(0).isNull()); QVERIFY(!key.subkey(1).isNull()); - const auto subkeyExpiration = key.subkey(1).expirationTime(); + const auto subkeyExpiration = uint_least32_t(key.subkey(1).expirationTime()); { // Create the job @@ -101,7 +101,7 @@ newExpirationDate.toSecsSinceEpoch() - 10, QDateTime::currentDateTime().addDays(1).toSecsSinceEpoch()); { - const auto actualExpiration = key.subkey(0).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(0).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); @@ -110,7 +110,7 @@ "; expected: " + std::to_string(expectedExpirationRange.second)).c_str()); } { - const auto actualExpiration = key.subkey(1).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(1).expirationTime()); QCOMPARE(actualExpiration, subkeyExpiration); // unchanged } } @@ -133,7 +133,7 @@ QVERIFY(!key.isNull()); QVERIFY(!key.subkey(0).isNull()); QVERIFY(!key.subkey(1).isNull()); - const auto primaryKeyExpiration = key.subkey(0).expirationTime(); + const auto primaryKeyExpiration = uint_least32_t(key.subkey(0).expirationTime()); { // Create the job @@ -164,11 +164,11 @@ newExpirationDate.toSecsSinceEpoch() - 10, QDateTime::currentDateTime().addDays(2).toSecsSinceEpoch()); { - const auto actualExpiration = key.subkey(0).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(0).expirationTime()); QCOMPARE(actualExpiration, primaryKeyExpiration); // unchanged } { - const auto actualExpiration = key.subkey(1).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(1).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); @@ -196,7 +196,7 @@ QVERIFY(!key.isNull()); QVERIFY(!key.subkey(0).isNull()); QVERIFY(!key.subkey(1).isNull()); - const auto subkeyExpiration = key.subkey(1).expirationTime(); + const auto subkeyExpiration = uint_least32_t(key.subkey(1).expirationTime()); { // Create the job @@ -228,7 +228,7 @@ newExpirationDate.toSecsSinceEpoch() - 10, QDateTime::currentDateTime().addDays(3).toSecsSinceEpoch()); { - const auto actualExpiration = key.subkey(0).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(0).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); @@ -237,7 +237,7 @@ "; expected: " + std::to_string(expectedExpirationRange.second)).c_str()); } { - const auto actualExpiration = key.subkey(1).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(1).expirationTime()); QCOMPARE(actualExpiration, subkeyExpiration); // unchanged } } @@ -291,7 +291,7 @@ newExpirationDate.toSecsSinceEpoch() - 10, QDateTime::currentDateTime().addDays(4).toSecsSinceEpoch()); { - const auto actualExpiration = key.subkey(0).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(0).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); @@ -300,7 +300,7 @@ "; expected: " + std::to_string(expectedExpirationRange.second)).c_str()); } { - const auto actualExpiration = key.subkey(1).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(1).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); @@ -359,7 +359,7 @@ newExpirationDate.toSecsSinceEpoch() - 10, QDateTime::currentDateTime().addDays(5).toSecsSinceEpoch()); { - const auto actualExpiration = key.subkey(0).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(0).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str()); @@ -368,7 +368,7 @@ "; expected: " + std::to_string(expectedExpirationRange.second)).c_str()); } { - const auto actualExpiration = key.subkey(1).expirationTime(); + const auto actualExpiration = uint_least32_t(key.subkey(1).expirationTime()); QVERIFY2(actualExpiration >= expectedExpirationRange.first, ("actual: " + std::to_string(actualExpiration) + "; expected: " + std::to_string(expectedExpirationRange.first)).c_str());
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-decryptverify.cpp
Added
@@ -0,0 +1,131 @@ +/* t-verifiy.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2016 by Bundesamt für Sicherheit in der Informationstechnik + Software engineering by Intevation GmbH + Copyright (c) 2023 by g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "t-support.h" + +#include <protocol.h> +#include <decryptverifyjob.h> + +#include <QDebug> +#include <QTest> + +#include <decryptionresult.h> +#include <key.h> +#include <verificationresult.h> + +using namespace QGpgME; +using namespace GpgME; + +static const char encryptedText = +"-----BEGIN PGP MESSAGE-----\n" +"\n" +"jA0ECQMCnJt+DX+RJJH90kIBCYlu/LYn57TCNO+O8kYwe4jcyEIaHqSZuvO50nFE\n" +"hQy9p33Y5VwP6uDOYOKxr1W6iE4GvbX+5UNKYdjjPL0m1ak=\n" +"=hgKY\n" +"-----END PGP MESSAGE-----\n"; + +static const char signedText = +"-----BEGIN PGP MESSAGE-----\n" +"\n" +"owGbwMvMwCSoW1RzPCOz3IRxjXQSR0lqcYleSUWJTZOvjVdpcYmCu1+oQmaJIleH\n" +"GwuDIBMDGysTSIqBi1MApi+nlGGuwDeHao53HBr+FoVGP3xX+kvuu9fCMJvl6IOf\n" +"y1kvP4y+8D5a11ang0udywsA\n" +"=Crq6\n" +"-----END PGP MESSAGE-----\n"; + +static const char storedText = +"-----BEGIN PGP MESSAGE-----\n" +"\n" +"owE7LZzEkHy7X86rtLhEwd0vVCGzRJELAA==\n" +"=VwL6\n" +"-----END PGP MESSAGE-----\n"; + +class DecryptVerifyTest: public QGpgMETest +{ + Q_OBJECT + +private Q_SLOTS: + + void testEncryptedOnlyData() + { + const QByteArray encryptedData{encryptedText}; + std::unique_ptr<DecryptVerifyJob> job{openpgp()->decryptVerifyJob(true)}; + hookUpPassphraseProvider(job.get()); + + QByteArray verified; + const auto result = job->exec(encryptedData, verified); + + const auto decryptionResult = result.first; + QCOMPARE(decryptionResult.error().code(), int{GPG_ERR_NO_ERROR}); + const auto verificationResult = result.second; + QCOMPARE(verificationResult.error().code(), int{GPG_ERR_NO_ERROR}); + QCOMPARE(verificationResult.numSignatures(), 0u); + } + + void testSignedOnlyData() + { + const QByteArray signedData{signedText}; + std::unique_ptr<DecryptVerifyJob> job{openpgp()->decryptVerifyJob(true)}; + + QByteArray verified; + const auto result = job->exec(signedData, verified); + + const auto decryptionResult = result.first; + QCOMPARE(decryptionResult.error().code(), int{GPG_ERR_NO_DATA}); + const auto verificationResult = result.second; + QCOMPARE(verificationResult.error().code(), int{GPG_ERR_NO_ERROR}); + QCOMPARE(verificationResult.numSignatures(), 1u); + } + + void testStoredData() + { + const QByteArray storedData{storedText}; + std::unique_ptr<DecryptVerifyJob> job{openpgp()->decryptVerifyJob(true)}; + + QByteArray verified; + const auto result = job->exec(storedData, verified); + + const auto decryptionResult = result.first; + QCOMPARE(decryptionResult.error().code(), int{GPG_ERR_NO_DATA}); + const auto verificationResult = result.second; + QCOMPARE(verificationResult.error().code(), int{GPG_ERR_NO_DATA}); + QCOMPARE(verificationResult.numSignatures(), 0u); + } +}; + +QTEST_MAIN(DecryptVerifyTest) +#include "t-decryptverify.moc"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-encrypt.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-encrypt.cpp
Changed
@@ -120,7 +120,22 @@ bool initSeen = false; bool finishSeen = false; - connect(job, &Job::progress, this, this, &initSeen, &finishSeen (const QString&, int current, int total) { + connect(job, &Job::jobProgress, this, &initSeen, &finishSeen (int current, int total) { + // We only check for progress 0 and max progress as the other progress + // lines depend on the system speed and are as such unreliable to test. + QVERIFY(total == PROGRESS_TEST_SIZE); + if (current == 0) { + initSeen = true; + } + if (current == total) { + finishSeen = true; + } + QVERIFY(current >= 0 && current <= total); + }); + connect(job, &Job::rawProgress, this, &initSeen, &finishSeen (const QString &what, int type, int current, int total) { + // `what` is something like "-&12", i.e. a special fd passed to gpg; we only check that it's not empty + QVERIFY(!what.isEmpty()); + QCOMPARE(type, '?'); // We only check for progress 0 and max progress as the other progress // lines depend on the system speed and are as such unreliable to test. QVERIFY(total == PROGRESS_TEST_SIZE);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-import.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-import.cpp
Changed
@@ -48,6 +48,8 @@ #include <QTemporaryDir> #include <QTest> +#include <memory> + using namespace QGpgME; using namespace GpgME; @@ -111,11 +113,11 @@ QSignalSpy spy (this, SIGNAL(asyncDone())); QVERIFY(spy.wait()); - auto ctx = Context::createForProtocol(GpgME::OpenPGP); + auto ctx = std::unique_ptr<GpgME::Context>(Context::createForProtocol(GpgME::OpenPGP)); GpgME::Error err; const auto key = ctx->key(keyFpr, err, false); QVERIFY(!key.isNull()); - QCOMPARE(key.numUserIDs(), 1); + QCOMPARE(key.numUserIDs(), 1u); QCOMPARE(key.userID(0).id(), "importWithImportFilter@example.net"); } @@ -155,13 +157,50 @@ QSignalSpy spy (this, SIGNAL(asyncDone())); QVERIFY(spy.wait()); - auto ctx = Context::createForProtocol(GpgME::OpenPGP); + auto ctx = std::unique_ptr<GpgME::Context>(Context::createForProtocol(GpgME::OpenPGP)); GpgME::Error err; const auto key = ctx->key(keyFpr, err, false); QVERIFY(!key.isNull()); QVERIFY(key.origin() == Key::OriginWKD); // the origin URL is currently not available in GpgME } + + void testDeferredStart() + { + // pub ed25519 2023-01-05 SC + // 4D1367FE9AF6334D8A55BA635A817A94C7B37E5D + // uid importDeferred@example.net + static const char keyFpr = "4D1367FE9AF6334D8A55BA635A817A94C7B37E5D"; + static const char keyData = + "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" + "\n" + "mDMEY7bNSxYJKwYBBAHaRw8BAQdAazIWyd/xEMeObDSUnh2+AXQuo0oM+TDBG49z\n" + "KHvTAYG0GmltcG9ydERlZmVycmVkQGV4YW1wbGUubmV0iJMEExYKADsWIQRNE2f+\n" + "mvYzTYpVumNagXqUx7N+XQUCY7bNSwIbAwULCQgHAgIiAgYVCgkICwIEFgIDAQIe\n" + "BwIXgAAKCRBagXqUx7N+XasrAP4qPzLzPd6tWDZvP29ZYPTSrjrTb0U5MOJeIPKX\n" + "73jZswEAwWRvgH+GmhTOigw0UVtinAFvUEFVyvcW/GR19mw5XA0=\n" + "=JnpA\n" + "-----END PGP PUBLIC KEY BLOCK-----\n"; + + auto *job = openpgp()->importJob(); + job->startLater(QByteArray{keyData}); + connect(job, &ImportJob::result, this, + this(ImportResult result, QString, Error) + { + QVERIFY(!result.error()); + QVERIFY(!result.imports().empty()); + QVERIFY(result.numImported()); + Q_EMIT asyncDone(); + }); + job->startNow(); + QSignalSpy spy (this, SIGNAL(asyncDone())); + QVERIFY(spy.wait()); + + auto ctx = std::unique_ptr<GpgME::Context>(Context::createForProtocol(GpgME::OpenPGP)); + GpgME::Error err; + const auto key = ctx->key(keyFpr, err, false); + QVERIFY(!key.isNull()); + } }; QTEST_MAIN(ImportTest)
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-revokekey.cpp
Added
@@ -0,0 +1,338 @@ +/* t-revokekey.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "t-support.h" + +#include <protocol.h> +#include <revokekeyjob.h> + +#include <QDebug> +#include <QProcess> +#include <QRegularExpression> +#include <QSignalSpy> +#include <QTest> + +#include <context.h> +#include <data.h> + +#include <algorithm> + +using namespace QGpgME; +using namespace GpgME; + +/* Test keys + sec ed25519 2022-03-29 SC + 604122B94C86BE846EAFE637FC2BCFB1B19A1CF4 + uid ultimate revoke-me@example.net + ssb cv25519 2022-03-29 E + * generated with +export GNUPGHOME=$(mktemp -d) +gpg -K +gpg --batch --pinentry-mode loopback --passphrase abc --quick-gen-key revoke-me@example.net default default never +gpg -K +gpg --export-secret-keys --armor --batch --pinentry-mode loopback --passphrase abc --comment revoke-me@example.net revoke-me@example.net | sed 's/\(.*\)/ "\1\\n"/' +#rm -rf ${GNUPGHOME} +unset GNUPGHOME +*/ +static const char *testKeyData = + "-----BEGIN PGP PRIVATE KEY BLOCK-----\n" + "Comment: revoke-me@example.net\n" + "\n" + "lIYEYkLSGhYJKwYBBAHaRw8BAQdAWKBjYOZIW33CjwlHKKGIgqXDOGhmbPCStkj1\n" + "+2/cVFL+BwMCXJpRHkD8EcT8DMWdVo84Lx4w7RNDCQx5xnm6rO5kvtmh+PjgM3qt\n" + "CQVGy8H7Dq35yzi0Hihm5zvHxVGYdAu96ShAI2ZqqVL7is0CdAmAibQVcmV2b2tl\n" + "LW1lQGV4YW1wbGUubmV0iJQEExYKADwWIQRgQSK5TIa+hG6v5jf8K8+xsZoc9AUC\n" + "YkLSGgIbAwULCQgHAgMiAgEGFQoJCAsCBBYCAwECHgcCF4AACgkQ/CvPsbGaHPSH\n" + "LAD/RNFgm1Bp6ltDXLS6oS0S5Bgjjg3CBpbdxWTvLjPpaagBAIU2pTLrsGNDKIZq\n" + "EAY7hY50tdcvOfT4OSAySJACJzMFnIsEYkLSGhIKKwYBBAGXVQEFAQEHQIOTbPEz\n" + "hUtL72BHfetUWESlEbh2IF/NEUWASUtQJDghAwEIB/4HAwJGE5naBnwwcfyPC+Nq\n" + "DwY5FO28hQVAzgNu9KAncmPtpST1J8sEPAtJGhtq/9fki9eSvBMbAa64VVpFHKHK\n" + "ravZxr2uCrK6J/u4rTvnR8HgiHgEGBYKACAWIQRgQSK5TIa+hG6v5jf8K8+xsZoc\n" + "9AUCYkLSGgIbDAAKCRD8K8+xsZoc9ANAAP9rX/xanm7YvcGFIxPclmy4h33lLaG8\n" + "dE5RA6zeSg7DqQD8Dae82iKaqKfTpe2+2vIEyxBVy8+WttoElUoXiwr0AQg=\n" + "=/5re\n" + "-----END PGP PRIVATE KEY BLOCK-----\n"; + +class RevokeKeyJobTest : public QGpgMETest +{ + Q_OBJECT + +private Q_SLOTS: + + void initTestCase() + { + QGpgMETest::initTestCase(); + + // set up the test fixture for this test + qputenv("GNUPGHOME", mGnupgHomeTestFixture.path().toUtf8()); + QVERIFY(importSecretKeys(testKeyData, 1)); + } + + void init() + { + // set up a copy of the test fixture for each test function + mGnupgHomeTestCopy.reset(new QTemporaryDir{}); + QVERIFY(copyKeyrings(mGnupgHomeTestFixture.path(), mGnupgHomeTestCopy->path())); + qputenv("GNUPGHOME", mGnupgHomeTestCopy->path().toUtf8()); + } + + void testAsync() + { + // Get the key that shall be revoked + auto key = getTestKey("revoke-me@example.net"); + QVERIFY(!key.isNull()); + QVERIFY(!key.isRevoked()); + + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + hookUpPassphraseProvider(job.get()); + + Error result; + connect(job.get(), &RevokeKeyJob::result, + job.get(), this, &result(const Error &result_) { + result = result_; + Q_EMIT asyncDone(); + }); + QVERIFY(!job->start(key, RevocationReason::NoLongerUsed, + {"This key is not used anymore."})); + job.release(); // after the job has been started it's on its own + + QSignalSpy spy (this, SIGNAL(asyncDone())); + QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT)); + + QVERIFY(result.code() == GPG_ERR_NO_ERROR); + key.update(); + QVERIFY(key.isRevoked()); + verifyReason(key, RevocationReason::NoLongerUsed, + {"This key is not used anymore."}); + } + + void testSync_noReasonDescription() + { + // Get the key that shall be revoked + auto key = getTestKey("revoke-me@example.net"); + QVERIFY(!key.isNull()); + QVERIFY(!key.isRevoked()); + + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + hookUpPassphraseProvider(job.get()); + + const auto result = job->exec(key); + + QVERIFY(result.code() == GPG_ERR_NO_ERROR); + key.update(); + QVERIFY(key.isRevoked()); + verifyReason(key, RevocationReason::Unspecified, {}); + } + + void testSync_oneLineReasonDescription() + { + // Get the key that shall be revoked + auto key = getTestKey("revoke-me@example.net"); + QVERIFY(!key.isNull()); + QVERIFY(!key.isRevoked()); + + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + hookUpPassphraseProvider(job.get()); + + const auto result = job->exec(key, RevocationReason::Compromised, + {"The secret key was stolen."}); + + QVERIFY(result.code() == GPG_ERR_NO_ERROR); + key.update(); + QVERIFY(key.isRevoked()); + verifyReason(key, RevocationReason::Compromised, + {"The secret key was stolen."}); + } + + void testSync_twoLinesReasonDescription() + { + // Get the key that shall be revoked + auto key = getTestKey("revoke-me@example.net"); + QVERIFY(!key.isNull()); + QVERIFY(!key.isRevoked()); + + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + hookUpPassphraseProvider(job.get()); + + const auto result = job->exec(key, RevocationReason::Superseded, + {"This key has been superseded by key", + "0000 1111 2222 3333 4444 5555 6666 7777 8888 9999."}); + + QVERIFY(result.code() == GPG_ERR_NO_ERROR); + key.update(); + QVERIFY(key.isRevoked()); + verifyReason(key, RevocationReason::Superseded, + {"This key has been superseded by key", + "0000 1111 2222 3333 4444 5555 6666 7777 8888 9999."}); + } + + void testErrorHandling_nullKey() + { + { + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + QTest::ignoreMessage(QtWarningMsg, "Error: Key is null key"); + const auto result = job->exec(Key{}); + QVERIFY(result.code() == GPG_ERR_INV_ARG); + } + { + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + QTest::ignoreMessage(QtWarningMsg, "Error: Key is null key"); + const auto result = job->start(Key{}); + QVERIFY(result.code() == GPG_ERR_INV_ARG); + } + } + + void testErrorHandling_invalidReason() + { + // Get the key that shall be revoked + auto key = getTestKey("revoke-me@example.net"); + QVERIFY(!key.isNull()); + QVERIFY(!key.isRevoked()); + + { + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + QTest::ignoreMessage(QtWarningMsg, QRegularExpression{"^Error: Invalid revocation reason"}); + const auto result = job->exec(key, static_cast<RevocationReason>(-1)); + QVERIFY(result.code() == GPG_ERR_INV_VALUE); + } + { + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + QTest::ignoreMessage(QtWarningMsg, QRegularExpression{"^Error: Invalid revocation reason"}); + const auto result = job->start(key, static_cast<RevocationReason>(4)); + QVERIFY(result.code() == GPG_ERR_INV_VALUE); + } + } + + void testErrorHandling_invalidDescription() + { + // Get the key that shall be revoked + auto key = getTestKey("revoke-me@example.net"); + QVERIFY(!key.isNull()); + QVERIFY(!key.isRevoked()); + + { + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + QTest::ignoreMessage(QtWarningMsg, "Error: Revocation description contains empty lines or lines with endline characters"); + const auto result = job->exec(key, RevocationReason::Unspecified, + {"line1", "", "line3"}); + QVERIFY(result.code() == GPG_ERR_INV_VALUE); + } + { + auto job = std::unique_ptr<RevokeKeyJob>{openpgp()->revokeKeyJob()}; + QTest::ignoreMessage(QtWarningMsg, "Error: Revocation description contains empty lines or lines with endline characters"); + const auto result = job->start(key, RevocationReason::Unspecified, + {"line1\nline2"}); + QVERIFY(result.code() == GPG_ERR_INV_VALUE); + } + } + +private: + Key getTestKey(const char *pattern) + { + auto ctx = Context::create(OpenPGP); + VERIFY_OR_OBJECT(ctx); + + Error err; + auto key = ctx->key(pattern, err, /*secret=*/true); + VERIFY_OR_OBJECT(!err); + VERIFY_OR_OBJECT(!key.isNull()); + return key; + } + + bool verifyReason(const Key &key, RevocationReason reason, const QStringList &description) + { + static const auto startTimeout = std::chrono::milliseconds{1000}; + static const auto finishTimeout = std::chrono::milliseconds{2000}; + static const QStringList hexCodeForReason = { + QStringLiteral("00"), /* no particular reason */ + QStringLiteral("02"), /* key has been compromised */ + QStringLiteral("01"), /* key is superseded */ + QStringLiteral("03") /* key is no longer used */ + }; + + QProcess p; + p.setProgram(dirInfo("gpg-name")); + p.setArguments({QStringLiteral("-K"), + QStringLiteral("--with-colon"), + QStringLiteral("--with-sig-list"), + QLatin1String{key.primaryFingerprint()} + }); + + p.start(); + + if (!p.waitForStarted(startTimeout.count())) { + qWarning() << "Timeout while waiting for start of" << p.program() << p.arguments().join(u' '); + return false; + } + if (!p.waitForFinished(finishTimeout.count())) { + qWarning() << "Timeout while waiting for completion of" << p.program() << p.arguments().join(u' '); + return false; + } + if (p.exitStatus() != QProcess::NormalExit) { + qWarning() << p.program() << "terminated abnormally with exit status" << p.exitStatus(); + return false; + } + + const auto lines = QString::fromUtf8(p.readAllStandardOutput()).split(u'\n'); + for (const auto &l : lines) { + const auto fields = l.split(u':'); + if (fields0 == QLatin1String{"rev"}) { + // or "rev" the signature class may be followed by a comma + // and a 2 digit hexnumber with the revocation reason + const auto sigClass = fields.value(10); + const auto revReason = sigClass.split(u',').value(1); + COMPARE_OR_FALSE(revReason, hexCodeForReason.value(static_cast<int>(reason))); + + // decode the \n in the C-style quoted comment field + const auto comment = fields.value(20).replace(QStringLiteral("\\n"), QStringLiteral("\n")); + COMPARE_OR_FALSE(comment, description.join(u'\n')); + return true; + } + if (fields0 == QLatin1String{"uid"}) { + qWarning() << "Found uid before rev in key listing:\n" << stdout; + return false; + } + } + return false; + } + +private: + QTemporaryDir mGnupgHomeTestFixture; + std::unique_ptr<QTemporaryDir> mGnupgHomeTestCopy; +}; + +QTEST_MAIN(RevokeKeyJobTest) + +#include "t-revokekey.moc"
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-setprimaryuserid.cpp
Added
@@ -0,0 +1,165 @@ +/* t-setprimaryuserid.cpp + + This file is part of qgpgme, the Qt API binding for gpgme + Copyright (c) 2022 g10 Code GmbH + Software engineering by Ingo Klöcker <dev@ingo-kloecker.de> + + QGpgME is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of the + License, or (at your option) any later version. + + QGpgME 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 + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + In addition, as a special exception, the copyright holders give + permission to link the code of this program with any edition of + the Qt library by Trolltech AS, Norway (or with modified versions + of Qt that use the same license as Qt), and distribute linked + combinations including the two. You must obey the GNU General + Public License in all respects for all of the code used other than + Qt. If you modify this file, you may extend this exception to + your version of the file, but you are not obligated to do so. If + you do not wish to do so, delete this exception statement from + your version. +*/ +#ifdef HAVE_CONFIG_H + #include "config.h" +#endif + +#include "t-support.h" + +#include <keylistjob.h> +#include <protocol.h> + +#include <context.h> +#include <engineinfo.h> +#include <keylistresult.h> + +using namespace QGpgME; +using namespace GpgME; + +class TestSetPrimaryUserID: public QGpgMETest +{ + Q_OBJECT + +private Q_SLOTS: + void testSetPrimaryUserID() + { + Key key; + { + std::unique_ptr<KeyListJob> job{openpgp()->keyListJob()}; + std::vector<GpgME::Key> keys; + GpgME::KeyListResult result = job->exec({QStringLiteral("alfa@example.net")}, true, keys); + QVERIFY(!result.error()); + QVERIFY(keys.size() == 1); + key = keys.front(); + } + + QCOMPARE(key.numUserIDs(), 3u); + const std::string oldPrimaryUserId = key.userID(0).id(); + const std::string newPrimaryUserId = key.userID(1).id(); + const std::string newPrimaryUserIdHash = key.userID(1).uidhash(); + + { + std::unique_ptr<Context> ctx{Context::createForProtocol(key.protocol())}; + QVERIFY(ctx); + hookUpPassphraseProvider(ctx.get()); + + if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() >= "2.3.8") { + QVERIFY(!ctx->setPrimaryUid(key, newPrimaryUserIdHash.c_str())); + } else { + QVERIFY(!ctx->setPrimaryUid(key, newPrimaryUserId.c_str())); + } + } + key.update(); + + QCOMPARE(key.userID(0).id(), newPrimaryUserId); + + { + std::unique_ptr<Context> ctx{Context::createForProtocol(key.protocol())}; + QVERIFY(ctx); + hookUpPassphraseProvider(ctx.get()); + + QVERIFY(!ctx->setPrimaryUid(key, oldPrimaryUserId.c_str())); + } + key.update(); + + QCOMPARE(key.userID(0).id(), oldPrimaryUserId); + } + + void testErrorHandling_noSecretKey() + { + if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.3.8") { + QSKIP("gpg < 2.3.8 does not report status error"); + } + Key key; + { + std::unique_ptr<KeyListJob> job{openpgp()->keyListJob()}; + std::vector<GpgME::Key> keys; + GpgME::KeyListResult result = job->exec({QStringLiteral("bravo@example.net")}, false, keys); + QVERIFY(!result.error()); + QVERIFY(keys.size() == 1); + key = keys.front(); + } + + QCOMPARE(key.numUserIDs(), 2u); + const std::string newPrimaryUserId = key.userID(1).id(); + + { + std::unique_ptr<Context> ctx{Context::createForProtocol(key.protocol())}; + QVERIFY(ctx); + auto err = ctx->setPrimaryUid(key, newPrimaryUserId.c_str()); + QCOMPARE(err.code(), static_cast<int>(GPG_ERR_NO_SECKEY)); + } + } + + void testErrorHandling_noUserID() + { + if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.3.8") { + QSKIP("gpg < 2.3.8 does not report status error"); + } + Key key; + { + std::unique_ptr<KeyListJob> job{openpgp()->keyListJob()}; + std::vector<GpgME::Key> keys; + GpgME::KeyListResult result = job->exec({QStringLiteral("alfa@example.net")}, true, keys); + QVERIFY(!result.error()); + QVERIFY(keys.size() == 1); + key = keys.front(); + } + { + std::unique_ptr<Context> ctx{Context::createForProtocol(key.protocol())}; + QVERIFY(ctx); + auto err = ctx->setPrimaryUid(key, "bravo"); + QCOMPARE(err.code(), static_cast<int>(GPG_ERR_NO_USER_ID)); + } + } + + void initTestCase() + { + QGpgMETest::initTestCase(); + const QString gpgHome = qgetenv("GNUPGHOME"); + QVERIFY(copyKeyrings(gpgHome, mDir.path())); + qputenv("GNUPGHOME", mDir.path().toUtf8()); + QFile conf(mDir.path() + QStringLiteral("/gpg.conf")); + QVERIFY(conf.open(QIODevice::WriteOnly)); + if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() >= "2.2.18") { + conf.write("allow-weak-key-signatures\n"); + } + conf.close(); + } + +private: + QTemporaryDir mDir; +}; + +QTEST_MAIN(TestSetPrimaryUserID) + +#include "t-setprimaryuserid.moc"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-support.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-support.h
Changed
@@ -89,7 +89,7 @@ { public: char *getPassphrase(const char * /*useridHint*/, const char * /*description*/, - bool /*previousWasBad*/, bool &/*canceled*/) Q_DECL_OVERRIDE + bool /*previousWasBad*/, bool &/*canceled*/) override { char *ret; gpgrt_asprintf(&ret, "abc");
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-trustsignatures.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-trustsignatures.cpp
Changed
@@ -41,6 +41,7 @@ #include "protocol.h" #include "signkeyjob.h" +#include <QRegularExpression> #include <QSignalSpy> #include <QTemporaryDir> #include <QTest> @@ -113,9 +114,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.org>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.org>")).hasMatch()); } // Create second trust signature @@ -158,9 +159,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.net>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.net>")).hasMatch()); } } @@ -224,9 +225,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.org>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.org>")).hasMatch()); } // Create second trust signature @@ -269,9 +270,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.net>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.net>")).hasMatch()); } } @@ -336,9 +337,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.org>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.org>")).hasMatch()); } // Create second trust signature @@ -381,9 +382,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.net>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.net>")).hasMatch()); } } @@ -447,9 +448,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.org>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.org>")).hasMatch()); } // Create second trust signature @@ -493,9 +494,9 @@ QVERIFY(trustSignature.trustScope()); const auto trustScope = QString::fromUtf8(trustSignature.trustScope()); QVERIFY(!trustScope.isEmpty()); - const QRegExp regex{trustScope}; + const QRegularExpression regex{trustScope}; QVERIFY(regex.isValid()); - QVERIFY(regex.indexIn(QStringLiteral("Foo <foo@example.net>")) != -1); + QVERIFY(regex.match(QStringLiteral("Foo <foo@example.net>")).hasMatch()); } }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-various.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-various.cpp
Changed
@@ -328,8 +328,6 @@ } }); - QTest::ignoreMessage(QtWarningMsg, "Expiration of certification has been changed to QDate(\"2106-02-06\")"); - job->start(target); QSignalSpy spy{this, &TestVarious::asyncDone}; QVERIFY(spy.wait(QSIGNALSPY_TIMEOUT)); @@ -339,7 +337,15 @@ const auto keySignature = target.userID(0).signature(target.userID(0).numSignatures() - 1); QVERIFY(!keySignature.neverExpires()); const auto expirationDate = QDateTime::fromSecsSinceEpoch(uint_least32_t(keySignature.expirationTime())).date(); - QCOMPARE(expirationDate, QDate(2106, 2, 6)); // expiration date is capped at 2106-02-06 + // expiration date is capped at 2106-02-05; we also allow 2106-02-04 as expiration date because for locations that use DST + // the expiration date may be 2106-02-04-23:xx:xx (in local non-DST time) if the current time is 00:xx::xx (in local DST time) + const auto expectedExpirationRange = std::make_pair(QDate{2106, 2, 4}, QDate{2106, 2, 5}); + QVERIFY2(expirationDate >= expectedExpirationRange.first, + ("\n Actual : " + expirationDate.toString(Qt::ISODate).toLatin1() + + "\n Expected: " + expectedExpirationRange.first.toString(Qt::ISODate).toLatin1()).constData()); + QVERIFY2(expirationDate <= expectedExpirationRange.second, + ("\n Actual : " + expirationDate.toString(Qt::ISODate).toLatin1() + + "\n Expected: " + expectedExpirationRange.second.toString(Qt::ISODate).toLatin1()).constData()); } void testVersion()
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/lang/qt/tests/t-verify.cpp -> _service:tar_scm:gpgme-1.21.0.tar.bz2/lang/qt/tests/t-verify.cpp
Changed
@@ -81,7 +81,7 @@ QVERIFY(!key.isNull()); bool found = false; - for (const auto subkey: key.subkeys()) { + for (const auto &subkey: key.subkeys()) { if (!strcmp (subkey.fingerprint(), sig.fingerprint())) { found = true; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/m4/ax_cxx_compile_stdcxx.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/m4/ax_cxx_compile_stdcxx.m4
Changed
@@ -1,5 +1,5 @@ # =========================================================================== -# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html # =========================================================================== # # SYNOPSIS @@ -10,13 +10,13 @@ # # Check for baseline language coverage in the compiler for the specified # version of the C++ standard. If necessary, add switches to CXX and -# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) -# or '14' (for the C++14 standard). +# CXXCPP to enable support. VERSION may be '11', '14', '17', or '20' for +# the respective C++ standard version. # # The second argument, if specified, indicates whether you insist on an # extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. # -std=c++11). If neither is specified, you get whatever works, with -# preference for an extended mode. +# preference for no added switch, and then for an extended mode. # # The third argument, if specified 'mandatory' or if left unspecified, # indicates that baseline support for the specified C++ standard is @@ -33,21 +33,26 @@ # Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov <sokolov@google.com> # Copyright (c) 2015 Paul Norman <penorman@mac.com> # Copyright (c) 2015 Moritz Klammler <moritz@klammler.eu> +# Copyright (c) 2016, 2018 Krzesimir Nowak <qdlacz@gmail.com> +# Copyright (c) 2019 Enji Cooper <yaneurabeya@gmail.com> +# Copyright (c) 2020 Jason Merrill <jason@redhat.com> +# Copyright (c) 2021 Jörn Heusipp <osmanx@problemloesungsmaschine.de> # # Copying and distribution of this file, with or without modification, are # permitted in any medium without royalty provided the copyright notice # and this notice are preserved. This file is offered as-is, without any # warranty. -#serial 4 +#serial 15 dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro dnl (serial version number 13). AC_DEFUN(AX_CXX_COMPILE_STDCXX, dnl - m4_if($1, 11, , - $1, 14, , - $1, 17, m4_fatal(support for C++17 not yet implemented in AX_CXX_COMPILE_STDCXX), + m4_if($1, 11, ax_cxx_compile_alternatives="11 0x", + $1, 14, ax_cxx_compile_alternatives="14 1y", + $1, 17, ax_cxx_compile_alternatives="17 1z", + $1, 20, ax_cxx_compile_alternatives="20", m4_fatal(invalid first argument `$1' to AX_CXX_COMPILE_STDCXX))dnl m4_if($2, , , $2, ext, , @@ -59,18 +64,21 @@ m4_fatal(invalid third argument `$3' to AX_CXX_COMPILE_STDCXX)) AC_LANG_PUSH(C++)dnl ac_success=no - AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, - ax_cv_cxx_compile_cxx$1, - AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), - ax_cv_cxx_compile_cxx$1=yes, - ax_cv_cxx_compile_cxx$1=no)) - if test x$ax_cv_cxx_compile_cxx$1 = xyes; then - ac_success=yes - fi + + m4_if($2, , dnl + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), + ax_cv_cxx_compile_cxx$1=yes, + ax_cv_cxx_compile_cxx$1=no)) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi) m4_if($2, noext, , dnl if test x$ac_success = xno; then - for switch in -std=gnu++$1 -std=gnu++0x; do + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" cachevar=AS_TR_SH(ax_cv_cxx_compile_cxx$1_$switch) AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, $cachevar, @@ -82,7 +90,9 @@ CXX="$ac_save_CXX") if eval test x\$$cachevar = xyes; then CXX="$CXX $switch" - CXXCPP="$CXXCPP $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi ac_success=yes break fi @@ -94,20 +104,27 @@ dnl HP's aCC needs +std=c++11 according to: dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf dnl Cray's crayCC needs "-h std=c++11" - for switch in -std=c++$1 -std=c++0x +std=c++$1 "-h std=c++$1"; do - cachevar=AS_TR_SH(ax_cv_cxx_compile_cxx$1_$switch) - AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, - $cachevar, - ac_save_CXX="$CXX" - CXX="$CXX $switch" - AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), - eval $cachevar=yes, - eval $cachevar=no) - CXX="$ac_save_CXX") - if eval test x\$$cachevar = xyes; then - CXX="$CXX $switch" - CXXCPP="$CXXCPP $switch" - ac_success=yes + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH(ax_cv_cxx_compile_cxx$1_$switch) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE(AC_LANG_SOURCE(_AX_CXX_COMPILE_STDCXX_testbody_$1), + eval $cachevar=yes, + eval $cachevar=no) + CXX="$ac_save_CXX") + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then break fi done @@ -136,7 +153,6 @@ _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 ) - dnl Test body for checking C++14 support m4_define(_AX_CXX_COMPILE_STDCXX_testbody_14, @@ -144,6 +160,23 @@ _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 ) +dnl Test body for checking C++17 support + +m4_define(_AX_CXX_COMPILE_STDCXX_testbody_17, + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Test body for checking C++20 support + +m4_define(_AX_CXX_COMPILE_STDCXX_testbody_20, + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_20 +) + dnl Tests for new features in C++11 @@ -156,7 +189,11 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201103L +// MSVC always sets __cplusplus to 199711L in older versions; newer versions +// only set it correctly if /Zc:__cplusplus is specified as well as a +// /std:c++NN switch: +// https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +#elif __cplusplus < 201103L && !defined _MSC_VER #error "This is not a C++11 compiler" @@ -181,11 +218,13 @@ struct Base { + virtual ~Base() {} virtual void f() {} }; struct Derived : public Base { + virtual ~Derived() override {} virtual void f() override {} }; @@ -445,7 +484,7 @@ #error "This is not a C++ compiler" -#elif __cplusplus < 201402L +#elif __cplusplus < 201402L && !defined _MSC_VER #error "This is not a C++14 compiler" @@ -514,7 +553,7 @@ } - namespace test_digit_seperators + namespace test_digit_separators { constexpr auto ten_million = 100'000'000; @@ -556,3 +595,415 @@ #endif // __cplusplus >= 201402L ) + + +dnl Tests for new features in C++17 + +m4_define(_AX_CXX_COMPILE_STDCXX_testbody_new_in_17, + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201703L && !defined _MSC_VER + +#error "This is not a C++17 compiler" + +#else + +#include <initializer_list> +#include <utility> +#include <type_traits> + +namespace cxx17 +{ + + namespace test_constexpr_lambdas + { + + constexpr int foo = (){return 42;}(); + + } + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template<typename... Args> + int multiply(Args... args) + { + return (args * ... * 1); + } + + template<typename... Args> + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same<std::initializer_list<int>, decltype(foo)>::value); + static_assert(std::is_same<int, decltype(bar)>::value); + } + + namespace test_typename_in_template_template_parameter + { + + template<template<typename> typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + nodiscard int f2() + { + maybe_unused auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + fallthrough; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + maybe_unused auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return *this() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template <bool cond> + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + + namespace test_template_argument_deduction_for_class_templates + { + + template <typename T1, typename T2> + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + maybe_unused auto p = pair{13, 42u}; + } + + } + + namespace test_non_type_auto_template_parameters + { + + template <auto n> + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + + namespace test_structured_bindings + { + + int arr2 = { 1, 2 }; + std::pair<int, int> pr = { 1, 2 }; + + auto f1() -> int(&)2 + { + return arr; + } + + auto f2() -> std::pair<int, int>& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto x1, y1 = f1(); + auto& xr1, yr1 = f1(); + auto x2, y2 = f2(); + auto& xr2, yr2 = f2(); + const auto x3, y3 = f3(); + + } + + namespace test_exception_spec_type_system + { + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template<typename T> + Bad + f(T*, T*); + + template<typename T1, typename T2> + Good + f(T1*, T2*); + + static_assert (std::is_same_v<Good, decltype(f(g1, g2))>); + + } + + namespace test_inline_variables + { + + template<class T> void f(T) + {} + + template<class T> inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus < 201703L && !defined _MSC_VER + +) + + +dnl Tests for new features in C++20 + +m4_define(_AX_CXX_COMPILE_STDCXX_testbody_new_in_20, + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 202002L && !defined _MSC_VER + +#error "This is not a C++20 compiler" + +#else + +#include <version> + +namespace cxx20 +{ + +// As C++20 supports feature test macros in the standard, there is no +// immediate need to actually test for feature availability on the +// Autoconf side. + +} // namespace cxx20 + +#endif // __cplusplus < 202002L && !defined _MSC_VER + +)
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/m4/ax_gcc_func_attribute.m4
Added
@@ -0,0 +1,242 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_gcc_func_attribute.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_GCC_FUNC_ATTRIBUTE(ATTRIBUTE) +# +# DESCRIPTION +# +# This macro checks if the compiler supports one of GCC's function +# attributes; many other compilers also provide function attributes with +# the same syntax. Compiler warnings are used to detect supported +# attributes as unsupported ones are ignored by default so quieting +# warnings when using this macro will yield false positives. +# +# The ATTRIBUTE parameter holds the name of the attribute to be checked. +# +# If ATTRIBUTE is supported define HAVE_FUNC_ATTRIBUTE_<ATTRIBUTE>. +# +# The macro caches its result in the ax_cv_have_func_attribute_<attribute> +# variable. +# +# The macro currently supports the following function attributes: +# +# alias +# aligned +# alloc_size +# always_inline +# artificial +# cold +# const +# constructor +# constructor_priority for constructor attribute with priority +# deprecated +# destructor +# dllexport +# dllimport +# error +# externally_visible +# fallthrough +# flatten +# format +# format_arg +# gnu_format +# gnu_inline +# hot +# ifunc +# leaf +# malloc +# noclone +# noinline +# nonnull +# noreturn +# nothrow +# optimize +# pure +# sentinel +# sentinel_position +# unused +# used +# visibility +# warning +# warn_unused_result +# weak +# weakref +# +# Unsupported function attributes will be tested with a prototype +# returning an int and not accepting any arguments and the result of the +# check might be wrong or meaningless so use with care. +# +# LICENSE +# +# Copyright (c) 2013 Gabriele Svelto <gabriele.svelto@gmail.com> +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 13 + +AC_DEFUN(AX_GCC_FUNC_ATTRIBUTE, + AS_VAR_PUSHDEF(ac_var, ax_cv_have_func_attribute_$1) + + AC_CACHE_CHECK(for __attribute__(($1)), ac_var, + AC_LINK_IFELSE(AC_LANG_PROGRAM( + m4_case($1, + alias, + int foo( void ) { return 0; } + int bar( void ) __attribute__(($1("foo"))); + , + aligned, + int foo( void ) __attribute__(($1(32))); + , + alloc_size, + void *foo(int a) __attribute__(($1(1))); + , + always_inline, + inline __attribute__(($1)) int foo( void ) { return 0; } + , + artificial, + inline __attribute__(($1)) int foo( void ) { return 0; } + , + cold, + int foo( void ) __attribute__(($1)); + , + const, + int foo( void ) __attribute__(($1)); + , + constructor_priority, + int foo( void ) __attribute__((__constructor__(65535/2))); + , + constructor, + int foo( void ) __attribute__(($1)); + , + deprecated, + int foo( void ) __attribute__(($1(""))); + , + destructor, + int foo( void ) __attribute__(($1)); + , + dllexport, + __attribute__(($1)) int foo( void ) { return 0; } + , + dllimport, + int foo( void ) __attribute__(($1)); + , + error, + int foo( void ) __attribute__(($1(""))); + , + externally_visible, + int foo( void ) __attribute__(($1)); + , + fallthrough, + void foo( int x ) {switch (x) { case 1: __attribute__(($1)); case 2: break ; }}; + , + flatten, + int foo( void ) __attribute__(($1)); + , + format, + int foo(const char *p, ...) __attribute__(($1(printf, 1, 2))); + , + gnu_format, + int foo(const char *p, ...) __attribute__((format(gnu_printf, 1, 2))); + , + format_arg, + char *foo(const char *p) __attribute__(($1(1))); + , + gnu_inline, + inline __attribute__(($1)) int foo( void ) { return 0; } + , + hot, + int foo( void ) __attribute__(($1)); + , + ifunc, + int my_foo( void ) { return 0; } + static int (*resolve_foo(void))(void) { return my_foo; } + int foo( void ) __attribute__(($1("resolve_foo"))); + , + leaf, + __attribute__(($1)) int foo( void ) { return 0; } + , + malloc, + void *foo( void ) __attribute__(($1)); + , + noclone, + int foo( void ) __attribute__(($1)); + , + noinline, + __attribute__(($1)) int foo( void ) { return 0; } + , + nonnull, + int foo(char *p) __attribute__(($1(1))); + , + noreturn, + void foo( void ) __attribute__(($1)); + , + nothrow, + int foo( void ) __attribute__(($1)); + , + optimize, + __attribute__(($1(3))) int foo( void ) { return 0; } + , + pure, + int foo( void ) __attribute__(($1)); + , + sentinel, + int foo(void *p, ...) __attribute__(($1)); + , + sentinel_position, + int foo(void *p, ...) __attribute__(($1(1))); + , + returns_nonnull, + void *foo( void ) __attribute__(($1)); + , + unused, + int foo( void ) __attribute__(($1)); + , + used, + int foo( void ) __attribute__(($1)); + , + visibility, + int foo_def( void ) __attribute__(($1("default"))); + int foo_hid( void ) __attribute__(($1("hidden"))); + int foo_int( void ) __attribute__(($1("internal"))); + int foo_pro( void ) __attribute__(($1("protected"))); + , + warning, + int foo( void ) __attribute__(($1(""))); + , + warn_unused_result, + int foo( void ) __attribute__(($1)); + , + weak, + int foo( void ) __attribute__(($1)); + , + weakref, + static int foo( void ) { return 0; } + static int bar( void ) __attribute__(($1("foo"))); + , + + m4_warn(syntax, Unsupported attribute $1, the test may fail) + int foo( void ) __attribute__(($1)); + + ), ) + , + dnl GCC doesn't exit with an error if an unknown attribute is + dnl provided but only outputs a warning, so accept the attribute + dnl only if no warning were issued. + AS_IF(grep -- -Wattributes conftest.err, + AS_VAR_SET(ac_var, no), + AS_VAR_SET(ac_var, yes)), + AS_VAR_SET(ac_var, no)) + ) + + AS_IF(test yes = AS_VAR_GET(ac_var), + AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_FUNC_ATTRIBUTE_$1), 1, + Define to 1 if the system has the `$1' function attribute), ) + + AS_VAR_POPDEF(ac_var) +)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/m4/glib-2.0.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/m4/glib-2.0.m4
Changed
@@ -87,7 +87,7 @@ dnl checks the results of pkg-config to some extent) dnl rm -f conf.glibtest - AC_TRY_RUN( + AC_RUN_IFELSE(AC_LANG_SOURCE( #include <glib.h> #include <stdio.h> #include <stdlib.h> @@ -158,7 +158,7 @@ } return 1; } -,, no_glib=yes,echo $ac_n "cross compiling; assumed OK... $ac_c") +),, no_glib=yes,echo $ac_n "cross compiling; assumed OK... $ac_c") CFLAGS="$ac_save_CFLAGS" LIBS="$ac_save_LIBS" fi @@ -180,10 +180,9 @@ ac_save_LIBS="$LIBS" CFLAGS="$CFLAGS $GLIB_CFLAGS" LIBS="$LIBS $GLIB_LIBS" - AC_TRY_LINK( -#include <glib.h> + AC_LINK_IFELSE(AC_LANG_PROGRAM(#include <glib.h> #include <stdio.h> -, return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); , +, return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ), echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GLIB or finding the wrong" echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/m4/gpg-error.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/m4/gpg-error.m4
Changed
@@ -1,5 +1,5 @@ # gpg-error.m4 - autoconf macro to detect libgpg-error. -# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020, 2021 +# Copyright (C) 2002, 2003, 2004, 2011, 2014, 2018, 2020, 2021, 2022 # g10 Code GmbH # # This file is free software; as a special exception the author gives @@ -10,23 +10,13 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2021-03-31 +# Last-changed: 2023-04-01 - -dnl AM_PATH_GPG_ERROR(MINIMUM-VERSION, -dnl ACTION-IF-FOUND , ACTION-IF-NOT-FOUND ) dnl -dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS, -dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are -dnl used for programs requireing real multi thread support. -dnl -dnl If a prefix option is not used, the config script is first -dnl searched in $SYSROOT/bin and then along $PATH. If the used -dnl config script does not match the host specification the script -dnl is added to the gpg_config_script_warn variable. +dnl Find gpg-error-config, for backward compatibility dnl -AC_DEFUN(AM_PATH_GPG_ERROR, - AC_REQUIRE(AC_CANONICAL_HOST) +dnl _AM_PATH_POSSIBLE_GPG_ERROR_CONFIG +AC_DEFUN(_AM_PATH_POSSIBLE_GPG_ERROR_CONFIG,dnl gpg_error_config_prefix="" dnl --with-libgpg-error-prefix=PFX is the preferred name for this option, dnl since that is consistent with how our three siblings use the directory/ @@ -62,9 +52,14 @@ fi AC_PATH_PROG(GPG_ERROR_CONFIG, gpg-error-config, no) - min_gpg_error_version=ifelse($1, ,1.33,$1) - ok=no +) +dnl +dnl Find gpgrt-config, which uses .pc file +dnl (minimum pkg-config functionality, supporting cross build) +dnl +dnl _AM_PATH_GPGRT_CONFIG +AC_DEFUN(_AM_PATH_GPGRT_CONFIG,dnl AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no, $prefix/bin:$PATH) if test "$GPGRT_CONFIG" != "no"; then # Determine gpgrt_libdir @@ -120,8 +115,9 @@ fi if test -n "$gpgrt_libdir"; then break; fi done - else - # When we cannot determine system libdir-format, use this: + fi + if test -z "$gpgrt_libdir"; then + # No valid pkgconfig dir in any of the system directories, fallback gpgrt_libdir=${possible_libdir1} fi else @@ -135,11 +131,33 @@ AC_MSG_NOTICE(Use gpgrt-config with $gpgrt_libdir as gpg-error-config) gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion` else + gpg_error_config_version=`$GPG_ERROR_CONFIG --version` unset GPGRT_CONFIG fi elif test "$GPG_ERROR_CONFIG" != "no"; then gpg_error_config_version=`$GPG_ERROR_CONFIG --version` + unset GPGRT_CONFIG fi +) + +dnl AM_PATH_GPG_ERROR(MINIMUM-VERSION, +dnl ACTION-IF-FOUND , ACTION-IF-NOT-FOUND ) +dnl +dnl Test for libgpg-error and define GPG_ERROR_CFLAGS, GPG_ERROR_LIBS, +dnl GPG_ERROR_MT_CFLAGS, and GPG_ERROR_MT_LIBS. The _MT_ variants are +dnl used for programs requireing real multi thread support. +dnl +dnl If a prefix option is not used, the config script is first +dnl searched in $SYSROOT/bin and then along $PATH. If the used +dnl config script does not match the host specification the script +dnl is added to the gpg_config_script_warn variable. +dnl +AC_DEFUN(AM_PATH_GPG_ERROR,dnl +AC_REQUIRE(AC_CANONICAL_HOST)dnl +AC_REQUIRE(_AM_PATH_POSSIBLE_GPG_ERROR_CONFIG)dnl +AC_REQUIRE(_AM_PATH_GPGRT_CONFIG)dnl + min_gpg_error_version=ifelse($1, ,1.33,$1) + ok=no if test "$GPG_ERROR_CONFIG" != "no"; then req_major=`echo $min_gpg_error_version | \ sed 's/\(0-9*\)\.\(0-9*\)/\1/'`
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/m4/libassuan.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/m4/libassuan.m4
Changed
@@ -9,7 +9,7 @@ dnl WITHOUT ANY WARRANTY, to the extent permitted by law; without even the dnl implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. dnl SPDX-License-Identifier: FSFULLR -# Last-changed: 2020-11-17 +# Last-changed: 2022-11-01 dnl dnl Common code used for libassuan detection internal @@ -28,7 +28,7 @@ fi use_gpgrt_config="" - if test x"${LIBASSUAN_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then + if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then if $GPGRT_CONFIG libassuan --exists; then LIBASSUAN_CONFIG="$GPGRT_CONFIG libassuan" AC_MSG_NOTICE(Use gpgrt-config as libassuan-config)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/m4/python.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/m4/python.m4
Changed
@@ -1,10 +1,10 @@ ## ------------------------ -*- Autoconf -*- ## Python file handling ## From Andrew Dalke -## Updated by James Henstridge +## Updated by James Henstridge and other contributors. ## Updated by Werner Koch 2018-10-17 -## --------------------------------- -# Copyright (C) 1999-2017 Free Software Foundation, Inc. +## ------------------------ +# Copyright (C) 1999-2021 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, @@ -36,13 +36,12 @@ # numbers and dots only. AC_DEFUN(AM_PATH_PYTHON, - dnl Find a Python interpreter. Python versions prior to 2.0 are not - dnl supported. (2.0 was released on October 16, 2000). Python 3.0 - dnl through to Python 3.9 are also not supported. + dnl Find a Python interpreter. Python versions prior to 2.7 are not + dnl supported. Python 3.0 through to Python 3.3 are also not supported. m4_define_default(_AM_PYTHON_INTERPRETER_LIST, python2 python2.7 dnl python dnl - python3 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 + python3 python3.10 python3.9 python3.8 python3.7 python3.6 python3.5 python3.4 ) AC_ARG_VAR(PYTHON, the Python interpreter) @@ -85,34 +84,141 @@ ) if test "$PYTHON" = :; then - dnl Run any user-specified action, or abort. + dnl Run any user-specified action, or abort. m4_default($3, AC_MSG_ERROR(no suitable Python interpreter found)) else - dnl Query Python for its version number. Getting :3 seems to be - dnl the best way to do this; it's what "site.py" does in the standard - dnl library. - + dnl Query Python for its version number. Although site.py simply uses + dnl sys.version:3, printing that failed with Python 3.10, since the + dnl trailing zero was eliminated. So now we output just the major + dnl and minor version numbers, as numbers. Apparently the tertiary + dnl version is not of interest. + dnl AC_CACHE_CHECK(for $am_display_PYTHON version, am_cv_python_version, - am_cv_python_version=`$PYTHON -c "import sys; sys.stdout.write(sys.version:3)"`) + am_cv_python_version=`$PYTHON -c "import sys; print ('%u.%u' % sys.version_info:2)"`) AC_SUBST(PYTHON_VERSION, $am_cv_python_version) - dnl Use the values of $prefix and $exec_prefix for the corresponding - dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made - dnl distinct variables so they can be overridden if need be. However, - dnl general consensus is that you shouldn't need this ability. - - AC_SUBST(PYTHON_PREFIX, '${prefix}') - AC_SUBST(PYTHON_EXEC_PREFIX, '${exec_prefix}') - - dnl At times (like when building shared libraries) you may want + dnl At times, e.g., when building shared libraries, you may want dnl to know which OS platform Python thinks this is. - + dnl AC_CACHE_CHECK(for $am_display_PYTHON platform, am_cv_python_platform, am_cv_python_platform=`$PYTHON -c "import sys; sys.stdout.write(sys.platform)"`) AC_SUBST(PYTHON_PLATFORM, $am_cv_python_platform) - # Just factor out some code duplication. + dnl emacs-page + dnl If --with-python-sys-prefix is given, use the values of sys.prefix + dnl and sys.exec_prefix for the corresponding values of PYTHON_PREFIX + dnl and PYTHON_EXEC_PREFIX. Otherwise, use the GNU ${prefix} and + dnl ${exec_prefix} variables. + dnl + dnl The two are made distinct variables so they can be overridden if + dnl need be, although general consensus is that you shouldn't need + dnl this separation. + dnl + dnl Also allow directly setting the prefixes via configure options, + dnl overriding any default. + dnl + if test "x$prefix" = xNONE; then + am__usable_prefix=$ac_default_prefix + else + am__usable_prefix=$prefix + fi + + # Allow user to request using sys.* values from Python, + # instead of the GNU $prefix values. + AC_ARG_WITH(python-sys-prefix, + AS_HELP_STRING(--with-python-sys-prefix, + use Python's sys.prefix and sys.exec_prefix values), + am_use_python_sys=:, + am_use_python_sys=false) + + # Allow user to override whatever the default Python prefix is. + AC_ARG_WITH(python_prefix, + AS_HELP_STRING(--with-python_prefix, + override the default PYTHON_PREFIX), + am_python_prefix_subst=$withval + am_cv_python_prefix=$withval + AC_MSG_CHECKING(for explicit $am_display_PYTHON prefix) + AC_MSG_RESULT($am_cv_python_prefix), + + if $am_use_python_sys; then + # using python sys.prefix value, not GNU + AC_CACHE_CHECK(for python default $am_display_PYTHON prefix, + am_cv_python_prefix, + am_cv_python_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.prefix)"`) + + dnl If sys.prefix is a subdir of $prefix, replace the literal value of + dnl $prefix with a variable reference so it can be overridden. + case $am_cv_python_prefix in + $am__usable_prefix*) + am__strip_prefix=`echo "$am__usable_prefix" | sed 's|.|.|g'` + am_python_prefix_subst=`echo "$am_cv_python_prefix" | sed "s,^$am__strip_prefix,\\${prefix},"` + ;; + *) + am_python_prefix_subst=$am_cv_python_prefix + ;; + esac + else # using GNU prefix value, not python sys.prefix + am_python_prefix_subst='${prefix}' + am_python_prefix=$am_python_prefix_subst + AC_MSG_CHECKING(for GNU default $am_display_PYTHON prefix) + AC_MSG_RESULT($am_python_prefix) + fi) + # Substituting python_prefix_subst value. + AC_SUBST(PYTHON_PREFIX, $am_python_prefix_subst) + + # emacs-page Now do it all over again for Python exec_prefix, but with yet + # another conditional: fall back to regular prefix if that was specified. + AC_ARG_WITH(python_exec_prefix, + AS_HELP_STRING(--with-python_exec_prefix, + override the default PYTHON_EXEC_PREFIX), + am_python_exec_prefix_subst=$withval + am_cv_python_exec_prefix=$withval + AC_MSG_CHECKING(for explicit $am_display_PYTHON exec_prefix) + AC_MSG_RESULT($am_cv_python_exec_prefix), + + # no explicit --with-python_exec_prefix, but if + # --with-python_prefix was given, use its value for python_exec_prefix too. + AS_IF(test -n "$with_python_prefix", + am_python_exec_prefix_subst=$with_python_prefix + am_cv_python_exec_prefix=$with_python_prefix + AC_MSG_CHECKING(for python_prefix-given $am_display_PYTHON exec_prefix) + AC_MSG_RESULT($am_cv_python_exec_prefix), + + # Set am__usable_exec_prefix whether using GNU or Python values, + # since we use that variable for pyexecdir. + if test "x$exec_prefix" = xNONE; then + am__usable_exec_prefix=$am__usable_prefix + else + am__usable_exec_prefix=$exec_prefix + fi + # + if $am_use_python_sys; then # using python sys.exec_prefix, not GNU + AC_CACHE_CHECK(for python default $am_display_PYTHON exec_prefix, + am_cv_python_exec_prefix, + am_cv_python_exec_prefix=`$PYTHON -c "import sys; sys.stdout.write(sys.exec_prefix)"`) + dnl If sys.exec_prefix is a subdir of $exec_prefix, replace the + dnl literal value of $exec_prefix with a variable reference so it can + dnl be overridden. + case $am_cv_python_exec_prefix in + $am__usable_exec_prefix*) + am__strip_prefix=`echo "$am__usable_exec_prefix" | sed 's|.|.|g'` + am_python_exec_prefix_subst=`echo "$am_cv_python_exec_prefix" | sed "s,^$am__strip_prefix,\\${exec_prefix},"` + ;; + *) + am_python_exec_prefix_subst=$am_cv_python_exec_prefix + ;; + esac + else # using GNU $exec_prefix, not python sys.exec_prefix + am_python_exec_prefix_subst='${exec_prefix}' + am_python_exec_prefix=$am_python_exec_prefix_subst + AC_MSG_CHECKING(for GNU default $am_display_PYTHON exec_prefix) + AC_MSG_RESULT($am_python_exec_prefix) + fi)) + # Substituting python_exec_prefix_subst. + AC_SUBST(PYTHON_EXEC_PREFIX, $am_python_exec_prefix_subst) + + # Factor out some code duplication into this shell variable. am_python_setup_sysconfig="\ import sys # Prefer sysconfig over distutils.sysconfig, for better compatibility @@ -132,96 +238,95 @@ except ImportError: pass" - dnl Set up 4 directories: + dnl emacs-page Set up 4 directories: - dnl pythondir -- where to install python scripts. This is the - dnl site-packages directory, not the python standard library - dnl directory like in previous automake betas. This behavior - dnl is more consistent with lispdir.m4 for example. + dnl 1. pythondir: where to install python scripts. This is the + dnl site-packages directory, not the python standard library + dnl directory like in previous automake betas. This behavior + dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. - AC_CACHE_CHECK(for $am_display_PYTHON script directory, - am_cv_python_pythondir, - if test "x$prefix" = xNONE - then - am_py_prefix=$ac_default_prefix - else - am_py_prefix=$prefix - fi - am_cv_python_pythondir=`$PYTHON -c " + dnl + AC_CACHE_CHECK(for $am_display_PYTHON script directory (pythondir), + am_cv_python_pythondir, + if test "x$am_cv_python_prefix" = x; then + am_py_prefix=$am__usable_prefix + else + am_py_prefix=$am_cv_python_prefix + fi + am_cv_python_pythondir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) + sitedir = sysconfig.get_path('purelib', vars={'base':'$am_py_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(0, 0, prefix='$am_py_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pythondir in - $am_py_prefix*) - am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` - am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,$PYTHON_PREFIX,"` - ;; - *) - case $am_py_prefix in - /usr|/System*) ;; - *) - am_cv_python_pythondir=$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pythondir in + $am_py_prefix*) + am__strip_prefix=`echo "$am_py_prefix" | sed 's|.|.|g'` + am_cv_python_pythondir=`echo "$am_cv_python_pythondir" | sed "s,^$am__strip_prefix,\\${PYTHON_PREFIX},"` + ;; + *) + case $am_py_prefix in + /usr|/System*) ;; + *) am_cv_python_pythondir="\${PYTHON_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac - ) + ;; + esac + ) AC_SUBST(pythondir, $am_cv_python_pythondir) - dnl pkgpythondir -- $PACKAGE directory under pythondir. Was - dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is - dnl more consistent with the rest of automake. - + dnl 2. pkgpythondir: $PACKAGE directory under pythondir. Was + dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is + dnl more consistent with the rest of automake. + dnl AC_SUBST(pkgpythondir, \${pythondir}/$PACKAGE) - dnl pyexecdir -- directory for installing python extension modules - dnl (shared libraries) + dnl 3. pyexecdir: directory for installing python extension modules + dnl (shared libraries). dnl Query distutils for this directory. - AC_CACHE_CHECK(for $am_display_PYTHON extension module directory, - am_cv_python_pyexecdir, - if test "x$exec_prefix" = xNONE - then - am_py_exec_prefix=$am_py_prefix - else - am_py_exec_prefix=$exec_prefix - fi - am_cv_python_pyexecdir=`$PYTHON -c " + dnl + AC_CACHE_CHECK(for $am_display_PYTHON extension module directory (pyexecdir), + am_cv_python_pyexecdir, + if test "x$am_cv_python_exec_prefix" = x; then + am_py_exec_prefix=$am__usable_exec_prefix + else + am_py_exec_prefix=$am_cv_python_exec_prefix + fi + am_cv_python_pyexecdir=`$PYTHON -c " $am_python_setup_sysconfig if can_use_sysconfig: - sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_prefix'}) + sitedir = sysconfig.get_path('platlib', vars={'platbase':'$am_py_exec_prefix'}) else: - from distutils import sysconfig - sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_prefix') + from distutils import sysconfig + sitedir = sysconfig.get_python_lib(1, 0, prefix='$am_py_exec_prefix') sys.stdout.write(sitedir)"` - case $am_cv_python_pyexecdir in - $am_py_exec_prefix*) - am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` - am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,$PYTHON_EXEC_PREFIX,"` - ;; - *) - case $am_py_exec_prefix in - /usr|/System*) ;; - *) - am_cv_python_pyexecdir=$PYTHON_EXEC_PREFIX/lib/python$PYTHON_VERSION/site-packages - ;; - esac - ;; + # + case $am_cv_python_pyexecdir in + $am_py_exec_prefix*) + am__strip_prefix=`echo "$am_py_exec_prefix" | sed 's|.|.|g'` + am_cv_python_pyexecdir=`echo "$am_cv_python_pyexecdir" | sed "s,^$am__strip_prefix,\\${PYTHON_EXEC_PREFIX},"` + ;; + *) + case $am_py_exec_prefix in + /usr|/System*) ;; + *) am_cv_python_pyexecdir="\${PYTHON_EXEC_PREFIX}/lib/python$PYTHON_VERSION/site-packages" + ;; esac - ) + ;; + esac + ) AC_SUBST(pyexecdir, $am_cv_python_pyexecdir) - dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) - + dnl 4. pkgpyexecdir: $(pyexecdir)/$(PACKAGE) + dnl AC_SUBST(pkgpyexecdir, \${pyexecdir}/$PACKAGE) dnl Run any user-specified action. $2 fi - )
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/m4/qt5.m4
Added
@@ -0,0 +1,82 @@ +dnl qt5.m4 +dnl Copyright (C) 2016 Intevation GmbH +dnl +dnl This file is part of gpgme and is provided under the same license as gpgme + +dnl Autoconf macro to find Qt5 +dnl +dnl sets GPGME_QT5_LIBS and GPGME_QT5_CFLAGS +dnl +dnl if QT5 was found have_qt5_libs is set to yes + +AC_DEFUN(FIND_QT5, + + have_qt5_libs="no"; + + PKG_CHECK_MODULES(GPGME_QT5, + Qt5Core >= 5.0.0, + have_qt5_libs="yes", + have_qt5_libs="no") + + PKG_CHECK_MODULES(GPGME_QT5TEST, + Qt5Test >= 5.0.0, + have_qt5test_libs="yes", + have_qt5test_libs="no") + + if ! test "$have_w32_system" = yes; then + if "$PKG_CONFIG" --variable qt_config Qt5Core | grep -q "reduce_relocations"; then + GPGME_QT5_CFLAGS="$GPGME_QT5_CFLAGS -fpic" + fi + fi + if test "$have_qt5_libs" = "yes"; then + AC_CHECK_TOOL(MOC, moc) + AC_MSG_CHECKING(moc version) + mocversion=`$MOC -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + AC_MSG_RESULT(no) + # moc was not the qt5 one, try with moc-qt5 + AC_CHECK_TOOL(MOC2, moc-qt5) + mocversion=`$MOC2 -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc-qt5 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + AC_CHECK_TOOL(QTCHOOSER, qtchooser) + qt5tooldir=`QT_SELECT=qt5 qtchooser -print-env | grep QTTOOLDIR | cut -d '=' -f 2 | cut -d \" -f 2` + mocversion=`$qt5tooldir/moc -v 2>&1` + mocversiongrep=`echo $mocversion | grep -E "Qt 5|moc 5"` + if test x"$mocversiongrep" != x"$mocversion"; then + # no valid moc found + have_qt5_libs="no"; + else + MOC=$qt5tooldir/moc + fi + else + MOC=$MOC2 + fi + fi + AC_MSG_RESULT($mocversion) + fi + if test "$have_qt5_libs" = "yes"; then + dnl Check that a binary can actually be build with this qt. + dnl pkg-config may be set up in a way that it looks also for libraries + dnl of the build system and not only for the host system. In that case + dnl we check here that we can actually compile / link a qt application + dnl for host. + OLDCPPFLAGS=$CPPFLAGS + CPPFLAGS=$GPGME_QT5_CFLAGS + OLDLIBS=$LIBS + LIBS=$GPGME_QT5_LIBS + AC_LANG_PUSH(C++) + AC_MSG_CHECKING(whether a simple qt program can be built) + AC_LINK_IFELSE(AC_LANG_SOURCE( + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + }), have_qt5_libs='yes', have_qt5_libs='no') + AC_MSG_RESULT($have_qt5_libs) + AC_LANG_POP() + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi +)
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/m4/qt6.m4
Added
@@ -0,0 +1,80 @@ +dnl qt6.m4 +dnl Copyright (C) 2016 Intevation GmbH +dnl +dnl This file is part of gpgme and is provided under the same license as gpgme + +dnl Autoconf macro to find Qt6 +dnl +dnl sets GPGME_QT6_LIBS and GPGME_QT6_CFLAGS +dnl +dnl if QT6 was found have_qt6_libs is set to yes + +AC_DEFUN(FIND_QT6, + + have_qt6_libs="no"; + + PKG_CHECK_MODULES(GPGME_QT6, + Qt6Core >= 6.4.0, + have_qt6_libs="yes", + have_qt6_libs="no") + + PKG_CHECK_MODULES(GPGME_QT6TEST, + Qt6Test >= 6.4.0, + have_qt6test_libs="yes", + have_qt6test_libs="no") + + if test "$have_qt6_libs" = "yes"; then + # Qt6 moved moc to libexec + qt6libexecdir=$($PKG_CONFIG --variable=libexecdir 'Qt6Core >= 6.4.0') + AC_PATH_TOOL(MOC, moc, , $qt6libexecdir) + if test -z "$MOC"; then + AC_MSG_WARN(moc not found - Qt 6 binding will not be built.) + have_qt6_libs="no"; + fi + fi + if test "$have_qt6_libs" = "yes"; then + dnl Check that a binary can actually be build with this qt. + dnl pkg-config may be set up in a way that it looks also for libraries + dnl of the build system and not only for the host system. In that case + dnl we check here that we can actually compile / link a qt application + dnl for host. + OLDCPPFLAGS=$CPPFLAGS + OLDLIBS=$LIBS + + # try building without -fPIC + CPPFLAGS=$GPGME_QT6_CFLAGS + LIBS=$GPGME_QT6_LIBS + AC_LANG_PUSH(C++) + AC_MSG_CHECKING(whether a simple qt program can be built without -fPIC) + AC_LINK_IFELSE(AC_LANG_SOURCE( + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + }), have_qt6_libs='yes', have_qt6_libs='no') + AC_MSG_RESULT($have_qt6_libs) + AC_LANG_POP() + + if test "$have_qt6_libs" = "no" -a "$have_w32_system" != yes; then + # try building with -fPIC + CPPFLAGS="$GPGME_QT6_CFLAGS -fPIC" + LIBS=$GPGME_QT6_LIBS + AC_LANG_PUSH(C++) + AC_MSG_CHECKING(whether a simple qt program can be built with -fPIC) + AC_LINK_IFELSE(AC_LANG_SOURCE( + #include <QCoreApplication> + int main (int argc, char **argv) { + QCoreApplication app(argc, argv); + app.exec(); + }), + have_qt6_libs='yes' + GPGME_QT6_CFLAGS="$GPGME_QT6_CFLAGS -fPIC" + , have_qt6_libs='no') + AC_MSG_RESULT($have_qt6_libs) + AC_LANG_POP() + fi + + CPPFLAGS=$OLDCPPFLAGS + LIBS=$OLDLIBS + fi +)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/Makefile.am
Changed
@@ -26,7 +26,11 @@ gpgme.h.in versioninfo.rc.in gpgme.def \ gpgme.pc.in gpgme-glib.pc.in +if USE_GPGRT_CONFIG +noinst_SCRIPTS = gpgme-config +else bin_SCRIPTS = gpgme-config +endif m4datadir = $(datadir)/aclocal m4data_DATA = gpgme.m4 nodist_include_HEADERS = gpgme.h
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/Makefile.in
Changed
@@ -116,6 +116,7 @@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -124,8 +125,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -248,7 +250,7 @@ gpgme_w32spawn_SOURCES = gpgme-w32spawn.c gpgme_w32spawn_OBJECTS = gpgme-w32spawn.$(OBJEXT) gpgme_w32spawn_LDADD = $(LDADD) -SCRIPTS = $(bin_SCRIPTS) +SCRIPTS = $(bin_SCRIPTS) $(noinst_SCRIPTS) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false @@ -409,10 +411,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -422,6 +429,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -564,7 +572,8 @@ gpgme.h.in versioninfo.rc.in gpgme.def \ gpgme.pc.in gpgme-glib.pc.in -bin_SCRIPTS = gpgme-config +@USE_GPGRT_CONFIG_TRUE@noinst_SCRIPTS = gpgme-config +@USE_GPGRT_CONFIG_FALSE@bin_SCRIPTS = gpgme-config m4datadir = $(datadir)/aclocal m4data_DATA = gpgme.m4 nodist_include_HEADERS = gpgme.h
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/argparse.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/argparse.c
Changed
@@ -1388,7 +1388,7 @@ } static void -show_version () +show_version (void) { const char *s; int i;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/assuan-support.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/assuan-support.c
Changed
@@ -27,10 +27,20 @@ #include <stdlib.h> #include <errno.h> +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif +#ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +#endif +#ifndef HAVE_W32_SYSTEM +#include <unistd.h> +#include <sys/wait.h> +#endif + #include "assuan.h" #include "gpgme.h" -#include "ath.h" #include "priv-io.h" #include "debug.h" @@ -62,8 +72,28 @@ static void my_usleep (assuan_context_t ctx, unsigned int usec) { - /* FIXME: Add to ath. */ - __assuan_usleep (ctx, usec); + (void)ctx; + + if (!usec) + return; + +#ifdef HAVE_W32_SYSTEM + Sleep (usec / 1000); +#else +# ifdef HAVE_NANOSLEEP + { + struct timespec req; + struct timespec rem; + + req.tv_sec = usec / 1000000; + req.tv_nsec = (usec % 1000000) * 1000; + while (nanosleep (&req, &rem) < 0 && errno == EINTR) + req = rem; + } +# else + usleep (usec); +# endif +#endif } @@ -294,7 +324,7 @@ NOWAIT in POSIX systems just means the caller already did the waitpid for this child. */ if (! nowait) - return _gpgme_ath_waitpid (pid, status, options); + return waitpid (pid, status, options); #endif return 0; } @@ -306,8 +336,8 @@ my_socketpair (assuan_context_t ctx, int namespace, int style, int protocol, assuan_fd_t filedes2) { -#ifdef HAVE_W32_SYSTEM (void)ctx; +#ifdef HAVE_W32_SYSTEM (void)namespace; (void)style; (void)protocol; @@ -316,7 +346,7 @@ return -1; #else /* FIXME: Debug output missing. */ - return __assuan_socketpair (ctx, namespace, style, protocol, filedes); + return socketpair (namespace, style, protocol, filedes); #endif }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/context.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/context.h
Changed
@@ -134,6 +134,9 @@ * after the operation. */ unsigned int ignore_mdc_error : 1; + /* True if the option --no-auto-check-trustdb shall be passed to gpg. */ + unsigned int no_auto_check_trustdb : 1; + /* Pass --expert to gpg edit key. */ unsigned int extended_edit : 1;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/conversion.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/conversion.c
Changed
@@ -434,10 +434,10 @@ /* Convert STRING into an offset value. Note that this functions only * allows for a base-10 length. This function is similar to atoi() * and thus there is no error checking. */ -gpgme_off_t +uint64_t _gpgme_string_to_off (const char *string) { - gpgme_off_t value = 0; + uint64_t value = 0; while (*string == ' ' || *string == '\t') string++;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/data-identify.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/data-identify.c
Changed
@@ -336,8 +336,10 @@ SEQUENCE SEQUENCE 0 INTEGER INTEGER SEQU (tbs) (version) (s/n) (Algo) - Thus we need to read at least 22 bytes, we add 2 bytes to cope with - length headers stored with 4 bytes. + Thus we need to read at least 22 bytes, we add 2 bytes to cope + with length headers stored with 4 bytes. For a v0 certificate the + tag and the bersion are missin (they are implicit) - detect this + too as a cert becuase some root CA use this. */ @@ -357,24 +359,34 @@ { if (parse_tlv (&s, &n, &ti)) goto try_pgp; - if (!(ti.cls == ASN1_CLASS_CONTEXT && ti.tag == 0 - && ti.is_cons && ti.length == 3 && n >= ti.length)) - goto try_pgp; + if (ti.cls == ASN1_CLASS_CONTEXT && ti.tag == 0 + && ti.is_cons && ti.length == 3 && n >= ti.length) + { + if (parse_tlv (&s, &n, &ti)) + goto try_pgp; + if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER + && !ti.is_cons && ti.length == 1 && n && (*s == 1 || *s == 2))) + goto try_pgp; + s++; + n--; + if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER + && !ti.is_cons)) + goto try_pgp; + /* Because the now following S/N may be larger than the sample + data we have, we stop parsing here and don't check for the + algorithm ID. */ + return GPGME_DATA_TYPE_X509_CERT; /* regular cert. */ + } + if (ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER + && !ti.is_cons) + { + /* Because this S/N may be larger than the sample data we + have, we can't check that a SEQUENCE follows. */ + return GPGME_DATA_TYPE_X509_CERT; /* v0 cert with implict tag. */ + } + + goto try_pgp; - if (parse_tlv (&s, &n, &ti)) - goto try_pgp; - if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER - && !ti.is_cons && ti.length == 1 && n && (*s == 1 || *s == 2))) - goto try_pgp; - s++; - n--; - if (!(ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER - && !ti.is_cons)) - goto try_pgp; - /* Because the now following S/N may be larger than the sample - data we have, we stop parsing here and don't check for the - algorithm ID. */ - return GPGME_DATA_TYPE_X509_CERT; } if (ti.cls == ASN1_CLASS_UNIVERSAL && ti.tag == ASN1_TAG_INTEGER && !ti.is_cons && ti.length == 1 && n && *s == 3)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/data.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/data.c
Changed
@@ -572,7 +572,7 @@ } else if (!strcmp (name, "io-buffer-size")) { - gpgme_off_t val; + uint64_t val; /* We may set this only once. */ if (dh->io_buffer_size) @@ -744,7 +744,7 @@ /* Get the size-hint value for DH or 0 if not available. */ -gpgme_off_t +uint64_t _gpgme_data_get_size_hint (gpgme_data_t dh) { return dh ? dh->size_hint : 0;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/data.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/data.h
Changed
@@ -96,7 +96,7 @@ char *file_name; /* Hint on the to be expected total size of the data. */ - gpgme_off_t size_hint; + uint64_t size_hint; /* If no 0 the size of an allocated inbound or outpund buffers. The * value is at least BUFFER_SIZE and capped at 1MiB. */ @@ -189,7 +189,7 @@ int _gpgme_data_get_fd (gpgme_data_t dh); /* Get the size-hint value for DH or 0 if not available. */ -gpgme_off_t _gpgme_data_get_size_hint (gpgme_data_t dh); +uint64_t _gpgme_data_get_size_hint (gpgme_data_t dh); #endif /* DATA_H */
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/debug.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/debug.c
Changed
@@ -1,6 +1,6 @@ /* debug.c - helpful output in desperate situations * Copyright (C) 2000 Werner Koch (dd9jn) - * Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2009, 2019 g10 Code GmbH + * Copyright (C) 2001-2005, 2007, 2009, 2019-2023 g10 Code GmbH * * This file is part of GPGME. * @@ -54,9 +54,6 @@ variable GPGME_DEBUG. */ static int debug_level; -/* The output stream for the debug messages. */ -static FILE *errfp; - /* If not NULL, this malloced string is used instead of the GPGME_DEBUG envvar. It must have been set before the debug subsystem has been initialized. Using it later may or may not have @@ -126,6 +123,37 @@ } +static int +safe_to_use_debug_file (void) +{ +#ifdef HAVE_DOSISH_SYSTEM + return 1; +#else /* Unix */ + return (getuid () == geteuid () +#if defined(HAVE_GETGID) && defined(HAVE_GETEGID) + && getgid () == getegid () +#endif + ); +#endif /* Unix */ +} + + +static int +tid_log_callback (unsigned long *rvalue) +{ + int len = sizeof (*rvalue); + uintptr_t thread; + + thread = ath_self (); + if (sizeof (thread) < len) + len = sizeof (thread); + memcpy (rvalue, &thread, len); + + return 2; /* Use use hex representation. */ +} + + + static void debug_init (void) { @@ -135,7 +163,7 @@ { gpgme_error_t err; char *e; - const char *s1, *s2;; + const char *s1, *s2; if (envvar_override) { @@ -151,58 +179,57 @@ } initialized = 1; - errfp = stderr; if (e) { + char *p, *r; + unsigned int flags; + debug_level = atoi (e); - s1 = strchr (e, PATHSEP_C); - if (s1) - { -#ifndef HAVE_DOSISH_SYSTEM - if (getuid () == geteuid () -#if defined(HAVE_GETGID) && defined(HAVE_GETEGID) - && getgid () == getegid () -#endif - ) - { -#endif - char *p; - FILE *fp; - - s1++; - if (!(s2 = strchr (s1, PATHSEP_C))) - s2 = s1 + strlen (s1); - p = malloc (s2 - s1 + 1); - if (p) - { - memcpy (p, s1, s2 - s1); - ps2-s1 = 0; - trim_spaces (p); - fp = fopen (p,"a"); - if (fp) - { - setvbuf (fp, NULL, _IOLBF, 0); - errfp = fp; - } - free (p); - } -#ifndef HAVE_DOSISH_SYSTEM - } -#endif - } + s1 = strchr (e, PATHSEP_C); + if (s1 && safe_to_use_debug_file ()) + { + s1++; + if (!(s2 = strchr (s1, PATHSEP_C))) + s2 = s1 + strlen (s1); + p = malloc (s2 - s1 + 1); + if (p) + { + memcpy (p, s1, s2 - s1); + ps2-s1 = 0; + trim_spaces (p); + if (strstr (p, "^//")) + { + /* map chars to allow socket: and tcp: */ + for (r=p; *r; r++) + if (*r == '^') + *r = ':'; + } + if (*p) + gpgrt_log_set_sink (p, NULL, -1); + free (p); + } + } free (e); + + gpgrt_log_get_prefix (&flags); + flags |= (GPGRT_LOG_WITH_PREFIX + | GPGRT_LOG_WITH_TIME + | GPGRT_LOG_WITH_PID); + gpgrt_log_set_prefix (*gpgrt_log_get_prefix (NULL)?NULL:"gpgme", + flags); + gpgrt_log_set_pid_suffix_cb (tid_log_callback); } } if (debug_level > 0) { _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme_debug: level=%d\n", debug_level); + "gpgme_debug: level=%d", debug_level); #ifdef HAVE_W32_SYSTEM { const char *name = _gpgme_get_inst_dir (); _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme_debug: gpgme='%s'\n", name? name: "?"); + "gpgme_debug: gpgme='%s'", name? name: "?"); } #endif } @@ -250,9 +277,8 @@ { va_list arg_ptr; int saved_errno; - int need_lf; int indent; - char *prefix, *stdinfo, *userinfo; + char *stdinfo, *userinfo; const char *modestr; int no_userinfo = 0; @@ -267,17 +293,6 @@ saved_errno = errno; va_start (arg_ptr, format); - { - struct tm *tp; - time_t atime = time (NULL); - - tp = localtime (&atime); - prefix = gpgrt_bsprintf ("GPGME %04d%02d%02dT%02d%02d%02d %04llX %*s", - 1900+tp->tm_year, tp->tm_mon+1, tp->tm_mday, - tp->tm_hour, tp->tm_min, tp->tm_sec, - (unsigned long long) ath_self (), - indent < 40? indent : 40, ""); - } switch (mode) { @@ -305,33 +320,25 @@ } va_end (arg_ptr); - if (mode != -1 && (!format || !*format)) - need_lf = 1; - else if (userinfo && *userinfo && userinfostrlen (userinfo) - 1 != '\n') - need_lf = 1; - else - need_lf = 0; - if (line) - *line = gpgrt_bsprintf ("%s%s%s", - prefix? prefix : "GPGME out-of-core ", - !modestr? "" : stdinfo? stdinfo : - (!format || !*format)? "" :"out-of-core ", + *line = gpgrt_bsprintf ("%s%s", + (!modestr ? "" : + stdinfo ? stdinfo : + (!format || !*format)? "" :"out-of-core "), userinfo? userinfo : "out-of-core"); else { - fprintf (errfp, "%s%s%s%s", - prefix? prefix : "GPGME out-of-core ", - !modestr? "" : stdinfo? stdinfo : - (!format || !*format)? "" :"out-of-core ", - userinfo? userinfo : no_userinfo? "" : "out-of-core", - need_lf? "\n":""); - fflush (errfp); + gpgrt_log (GPGRT_LOGLVL_INFO, "%*s%s%s", + indent < 40? indent : 40, "", + (!modestr ? "" : + stdinfo ? stdinfo : + (!format || !*format)? "" : "out-of-core "), + (userinfo? userinfo : + no_userinfo? "" : "out-of-core")); } gpgrt_free (userinfo); gpgrt_free (stdinfo); - gpgrt_free (prefix); gpg_err_set_errno (saved_errno); return 0; } @@ -378,10 +385,7 @@ return; string = *line; - fprintf (errfp, "%s%s", - string, - (*string && stringstrlen (string)-1 != '\n')? "\n":""); - fflush (errfp); + gpgrt_log (GPGRT_LOGLVL_INFO, "%s", string); gpgrt_free (*line); *line = NULL; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/debug.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/debug.h
Changed
@@ -180,7 +180,7 @@ _trace_sysres_ssize_t (gpgme_ssize_t res, int lvl, const char *func, int line) { if (res >= 0) - _gpgme_debug (NULL, lvl, 3, func, NULL, NULL, "result=%zd", res); + _gpgme_debug (NULL, lvl, 3, func, NULL, NULL, "result=%zd", (ssize_t)res); else _gpgme_debug (NULL, lvl, -1, NULL, NULL, NULL, "%s:%d: error: %s (%d)\n",
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/decrypt-verify.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/decrypt-verify.c
Changed
@@ -35,13 +35,17 @@ char *args) { gpgme_error_t err; + gpgme_error_t err2; err = _gpgme_progress_status_handler (priv, code, args); if (!err) err = _gpgme_decrypt_status_handler (priv, code, args); - if (!err) - err = _gpgme_verify_status_handler (priv, code, args); - return err; + /* Allow finalization of signature verification even if previous handler + * returned NO DATA error which just means that the data wasn't encrypted. */ + if (!err + || (code == GPGME_STATUS_EOF && gpg_err_code (err) == GPG_ERR_NO_DATA)) + err2 = _gpgme_verify_status_handler (priv, code, args); + return err ? err : err2; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/decrypt.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/decrypt.c
Changed
@@ -44,10 +44,12 @@ int okay; - /* A flag telling that the a decryption failed and an optional error - * code to further specify the failure. */ + /* A flag telling that the a decryption failed and two optional error + * codes to further specify the failure for public key decryption and + * symmetric decryption. */ int failed; gpg_error_t pkdecrypt_failed; + gpg_error_t symdecrypt_failed; /* At least one secret key is not available. gpg issues NO_SECKEY * status lines for each key the message has been encrypted to but @@ -228,7 +230,22 @@ opd->result.legacy_cipher_nomdc = 1; opd->not_integrity_protected = 1; } + else if (!strcmp (field0, "symkey_decrypt.maybe_error")) + { + switch (gpg_err_code (err)) + { + case GPG_ERR_BAD_PASSPHRASE: + /* A bad passphrase is severe enough that we return this + * error code. */ + opd->symdecrypt_failed = err; + break; + default: + /* For now all other error codes are ignored and the + * standard DECRYPT_FAILED is returned. */ + break; + } + } /* Record the first error code. */ if (err && !opd->first_status_error) opd->first_status_error = err; @@ -376,6 +393,8 @@ /* This comes from a specialized ERROR status line. */ if (opd->pkdecrypt_failed) return opd->pkdecrypt_failed; + if (opd->symdecrypt_failed) + return opd->symdecrypt_failed; /* For an integrity failure return just DECRYPTION_FAILED; * the actual cause can be taken from an already set
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/dirinfo.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/dirinfo.c
Changed
@@ -32,6 +32,12 @@ #include "sema.h" #include "sys-util.h" +#ifdef HAVE_DOSISH_SYSTEM +# define EXEEXT_S ".exe" +#else +# define EXEEXT_S "" +#endif + DEFINE_STATIC_LOCK (dirinfo_lock); /* Constants used internally to select the data. */ @@ -59,6 +65,7 @@ WANT_DIRMNGR_NAME, WANT_PINENTRY_NAME, WANT_GPG_WKS_CLIENT_NAME, + WANT_GPGTAR_NAME, WANT_GPG_ONE_MODE }; @@ -88,6 +95,7 @@ char *dirmngr_name; char *pinentry_name; char *gpg_wks_client_name; + char *gpgtar_name; int gpg_one_mode; /* System is in gpg1 mode. */ } dirinfo; @@ -287,13 +295,13 @@ if (pgmname && _gpgme_access (pgmname, F_OK)) { _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: gpgconf='%s' not installed\n", pgmname); + "gpgme-dinfo: gpgconf='%s' not installed", pgmname); free (pgmname); pgmname = NULL; /* Not available. */ } else _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: gpgconf='%s'\n", + "gpgme-dinfo: gpgconf='%s'", pgmname? pgmname : "null"); if (!pgmname) { @@ -320,59 +328,59 @@ dirinfo.valid = 1; if (dirinfo.gpg_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: gpg='%s'\n", + "gpgme-dinfo: gpg='%s'", dirinfo.gpg_name); if (dirinfo.g13_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: g13='%s'\n", + "gpgme-dinfo: g13='%s'", dirinfo.g13_name); if (dirinfo.gpgsm_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: gpgsm='%s'\n", + "gpgme-dinfo: gpgsm='%s'", dirinfo.gpgsm_name); if (dirinfo.keyboxd_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: keyboxd='%s'\n", + "gpgme-dinfo: keyboxd='%s'", dirinfo.keyboxd_name); if (dirinfo.agent_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: gpg-agent='%s'\n", + "gpgme-dinfo: gpg-agent='%s'", dirinfo.agent_name); if (dirinfo.scdaemon_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: scdaemon='%s'\n", + "gpgme-dinfo: scdaemon='%s'", dirinfo.scdaemon_name); if (dirinfo.dirmngr_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: dirmngr='%s'\n", + "gpgme-dinfo: dirmngr='%s'", dirinfo.dirmngr_name); if (dirinfo.pinentry_name) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: pinentry='%s'\n", + "gpgme-dinfo: pinentry='%s'", dirinfo.pinentry_name); if (dirinfo.homedir) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: homedir='%s'\n", + "gpgme-dinfo: homedir='%s'", dirinfo.homedir); if (dirinfo.socketdir) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: sockdir='%s'\n", + "gpgme-dinfo: sockdir='%s'", dirinfo.socketdir); if (dirinfo.agent_socket) - _gpgme_debug (NULL,DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: agent='%s'\n", + _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, + "gpgme-dinfo: agent='%s'", dirinfo.agent_socket); if (dirinfo.agent_ssh_socket) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: ssh='%s'\n", + "gpgme-dinfo: ssh='%s'", dirinfo.agent_ssh_socket); if (dirinfo.dirmngr_socket) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: dirmngr='%s'\n", + "gpgme-dinfo: dirmngr='%s'", dirinfo.dirmngr_socket); if (dirinfo.uisrv_socket) _gpgme_debug (NULL, DEBUG_INIT, -1, NULL, NULL, NULL, - "gpgme-dinfo: uisrv='%s'\n", + "gpgme-dinfo: uisrv='%s'", dirinfo.uisrv_socket); } switch (what) @@ -402,11 +410,21 @@ case WANT_GPG_WKS_CLIENT_NAME: if (!dirinfo.gpg_wks_client_name && dirinfo.libexecdir) dirinfo.gpg_wks_client_name = _gpgme_strconcat (dirinfo.libexecdir, - "/", + DIRSEP_S, "gpg-wks-client", + EXEEXT_S, NULL); result = dirinfo.gpg_wks_client_name; break; + case WANT_GPGTAR_NAME: + if (!dirinfo.gpgtar_name && dirinfo.bindir) + dirinfo.gpgtar_name = _gpgme_strconcat (dirinfo.bindir, + DIRSEP_S, + "gpgtar", + EXEEXT_S, + NULL); + result = dirinfo.gpgtar_name; + break; } UNLOCK (dirinfo_lock); return result; @@ -455,6 +473,13 @@ return get_gpgconf_item (WANT_GPGCONF_NAME); } +/* Return the default gpgtar file name. Returns NULL if not known. */ +const char * +_gpgme_get_default_gpgtar_name (void) +{ + return get_gpgconf_item (WANT_GPGTAR_NAME); +} + /* Return the default UI-server socket name. Returns NULL if not known. */ const char * @@ -524,6 +549,8 @@ return get_gpgconf_item (WANT_PINENTRY_NAME); else if (!strcmp (what, "gpg-wks-client-name")) return get_gpgconf_item (WANT_GPG_WKS_CLIENT_NAME); + else if (!strcmp (what, "gpgtar-name")) + return get_gpgconf_item (WANT_GPGTAR_NAME); else if (!strcmp (what, "agent-ssh-socket")) return get_gpgconf_item (WANT_AGENT_SSH_SOCKET); else if (!strcmp (what, "dirmngr-socket"))
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/edit.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/edit.c
Changed
@@ -122,12 +122,13 @@ gpgme_error_t err; void *hook; op_data_t opd; + int card_edit = (flags & GPGME_INTERACT_CARD)? 1: 0; err = _gpgme_op_reset (ctx, synchronous); if (err) return err; - if (!fnc || !out) + if ((card_edit == 0 && !key) || !fnc || !out) return gpg_error (GPG_ERR_INV_VALUE); err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, sizeof (*opd), NULL); @@ -146,7 +147,7 @@ _gpgme_engine_set_status_handler (ctx->engine, edit_status_handler, ctx); return _gpgme_engine_op_edit (ctx->engine, - (flags & GPGME_INTERACT_CARD)? 1: 0, + card_edit, key, out, ctx); } @@ -206,7 +207,7 @@ if (err) return err; - if (!fnc || !out) + if ((type == 0 && !key) || !fnc || !out) return gpg_error (GPG_ERR_INV_VALUE); err = _gpgme_op_data_lookup (ctx, OPDATA_EDIT, &hook, sizeof (*opd), NULL);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/engine-backend.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/engine-backend.h
Changed
@@ -106,7 +106,8 @@ int secret_only, int reserved, gpgme_keylist_mode_t mode, int engine_flags); - gpgme_error_t (*keylist_data) (void *engine, gpgme_data_t data); + gpgme_error_t (*keylist_data) (void *engine, gpgme_keylist_mode_t mode, + gpgme_data_t data); gpgme_error_t (*keysign) (void *engine, gpgme_key_t key, const char *userid, unsigned long expires, unsigned int flags, @@ -118,12 +119,12 @@ gpgme_key_t key, gpgme_tofu_policy_t policy); gpgme_error_t (*sign) (void *engine, gpgme_data_t in, gpgme_data_t out, - gpgme_sig_mode_t mode, int use_armor, + gpgme_sig_mode_t flags, int use_armor, int use_textmode, int include_certs, gpgme_ctx_t ctx /* FIXME */); - gpgme_error_t (*verify) (void *engine, gpgme_data_t sig, - gpgme_data_t signed_text, gpgme_data_t plaintext, - gpgme_ctx_t ctx); + gpgme_error_t (*verify) (void *engine, gpgme_verify_flags_t flags, + gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext, gpgme_ctx_t ctx); gpgme_error_t (*getauditlog) (void *engine, gpgme_data_t output, unsigned int flags); gpgme_error_t (*setexpire) (void *engine, gpgme_key_t key,
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/engine-gpg.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/engine-gpg.c
Changed
@@ -57,6 +57,7 @@ int inbound; /* True if this is used for reading from gpg. */ int dup_to; int print_fd; /* Print the fd number and not the special form of it. */ + int gpg_arg; /* True if this argument is not known by gpgtar. */ int *arg_locp; /* Write back the argv idx of this argument when building command line to this location. */ char argFLEXIBLE_ARRAY_MEMBER; /* Used if data above is not used. */ @@ -145,11 +146,13 @@ char *trust_model; struct { + unsigned int use_gpgtar : 1; unsigned int no_symkey_cache : 1; unsigned int offline : 1; unsigned int ignore_mdc_error : 1; unsigned int include_key_block : 1; unsigned int auto_key_import : 1; + unsigned int no_auto_check_trustdb : 1; } flags; /* NULL or the data object fed to --override_session_key-fd. */ @@ -221,11 +224,32 @@ } } +static void +_append_to_arglist (engine_gpg_t gpg, struct arg_and_data_s *a) +{ + a->next = NULL; + *gpg->argtail = a; + gpg->argtail = &a->next; +} + +static void +_prepend_to_arglist (engine_gpg_t gpg, struct arg_and_data_s *a) +{ + a->next = gpg->arglist; + if (!gpg->arglist) + { + /* If this is the first argument, we need to update the tail + pointer. */ + gpg->argtail = &a->next; + } + gpg->arglist = a; +} + /* If FRONT is true, push at the front of the list. Use this for options added late in the process. */ static gpgme_error_t _add_arg (engine_gpg_t gpg, const char *prefix, const char *arg, size_t arglen, - int front, int *arg_locp) + int front, int *arg_locp, int gpg_arg) { struct arg_and_data_s *a; size_t prefixlen = prefix? strlen (prefix) : 0; @@ -240,28 +264,16 @@ a->data = NULL; a->dup_to = -1; a->arg_locp = arg_locp; + a->gpg_arg = gpg_arg; if (prefixlen) memcpy (a->arg, prefix, prefixlen); memcpy (a->arg + prefixlen, arg, arglen); a->argprefixlen + arglen = 0; if (front) - { - a->next = gpg->arglist; - if (!gpg->arglist) - { - /* If this is the first argument, we need to update the tail - pointer. */ - gpg->argtail = &a->next; - } - gpg->arglist = a; - } + _prepend_to_arglist (gpg, a); else - { - a->next = NULL; - *gpg->argtail = a; - gpg->argtail = &a->next; - } + _append_to_arglist (gpg, a); return 0; } @@ -270,37 +282,50 @@ static gpgme_error_t add_arg_ext (engine_gpg_t gpg, const char *arg, int front) { - return _add_arg (gpg, NULL, arg, strlen (arg), front, NULL); + return _add_arg (gpg, NULL, arg, strlen (arg), front, NULL, 0); } static gpgme_error_t -add_arg_with_locp (engine_gpg_t gpg, const char *arg, int *locp) +add_arg_with_locp (engine_gpg_t gpg, const char *arg, int *locp, int front) { - return _add_arg (gpg, NULL, arg, strlen (arg), 0, locp); + return _add_arg (gpg, NULL, arg, strlen (arg), front, locp, 0); } static gpgme_error_t add_arg (engine_gpg_t gpg, const char *arg) { - return _add_arg (gpg, NULL, arg, strlen (arg), 0, NULL); + return _add_arg (gpg, NULL, arg, strlen (arg), 0, NULL, 0); } static gpgme_error_t add_arg_pfx (engine_gpg_t gpg, const char *prefix, const char *arg) { - return _add_arg (gpg, prefix, arg, strlen (arg), 0, NULL); + return _add_arg (gpg, prefix, arg, strlen (arg), 0, NULL, 0); +} + +static gpgme_error_t +add_gpg_arg (engine_gpg_t gpg, const char *arg) +{ + return _add_arg (gpg, NULL, arg, strlen (arg), 0, NULL, 1); +} + +static gpgme_error_t +add_gpg_arg_with_value (engine_gpg_t gpg, const char *arg, const char *value, + int front) +{ + return _add_arg (gpg, arg, value, strlen (value), front, NULL, 1); } static gpgme_error_t add_arg_len (engine_gpg_t gpg, const char *prefix, const char *arg, size_t arglen) { - return _add_arg (gpg, prefix, arg, arglen, 0, NULL); + return _add_arg (gpg, prefix, arg, arglen, 0, NULL, 0); } static gpgme_error_t -add_data (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound) +add_data_ext (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound, int front) { struct arg_and_data_s *a; @@ -310,7 +335,6 @@ a = malloc (offsetof (struct arg_and_data_s, arg)); if (!a) return gpg_error_from_syserror (); - a->next = NULL; a->data = data; a->inbound = inbound; a->arg_locp = NULL; @@ -325,12 +349,34 @@ a->print_fd = 0; a->dup_to = dup_to; } - *gpg->argtail = a; - gpg->argtail = &a->next; + + if (front) + _prepend_to_arglist (gpg, a); + else + _append_to_arglist (gpg, a); + return 0; } +static gpgme_error_t +add_data (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound) +{ + return add_data_ext (gpg, data, dup_to, inbound, 0); +} + + +static gpgme_error_t +add_file_name_arg_or_data (engine_gpg_t gpg, gpgme_data_t data, int dup_to, int inbound) +{ + const char *file_name = gpgme_data_get_file_name (data); + if (file_name) + return add_arg (gpg, file_name); + else + return add_data (gpg, data, dup_to, inbound); +} + + /* Return true if the engine's version is at least VERSION. */ static int have_gpg_version (engine_gpg_t gpg, const char *version) @@ -355,6 +401,14 @@ } +static int +have_usable_gpgtar (engine_gpg_t gpg) +{ + return have_gpg_version (gpg, "2.4.1") + || (have_gpg_version (gpg, "2.2.42") && !have_gpg_version (gpg, "2.3.0")); +} + + static void free_argv (char **argv) { @@ -539,34 +593,18 @@ if (home_dir) { - rc = add_arg (gpg, "--homedir"); - if (!rc) - rc = add_arg (gpg, home_dir); + rc = add_gpg_arg_with_value (gpg, "--homedir=", home_dir, 0); if (rc) goto leave; } - rc = add_arg (gpg, "--status-fd"); - if (rc) - goto leave; - - { - char buf25; - _gpgme_io_fd2str (buf, sizeof (buf), gpg->status.fd1); - rc = add_arg_with_locp (gpg, buf, &gpg->status.arg_loc); - if (rc) - goto leave; - } - - rc = add_arg (gpg, "--no-tty"); + rc = add_gpg_arg (gpg, "--no-tty"); if (!rc) - rc = add_arg (gpg, "--charset"); + rc = add_gpg_arg (gpg, "--charset=utf8"); if (!rc) - rc = add_arg (gpg, "utf8"); - if (!rc) - rc = add_arg (gpg, "--enable-progress-filter"); + rc = add_gpg_arg (gpg, "--enable-progress-filter"); if (!rc && have_gpg_version (gpg, "2.1.11")) - rc = add_arg (gpg, "--exit-on-status-write-error"); + rc = add_gpg_arg (gpg, "--exit-on-status-write-error"); if (rc) goto leave; @@ -575,9 +613,7 @@ goto leave; if (dft_display) { - rc = add_arg (gpg, "--display"); - if (!rc) - rc = add_arg (gpg, dft_display); + rc = add_gpg_arg_with_value (gpg, "--display=", dft_display, 0); free (dft_display); if (rc) @@ -604,11 +640,7 @@ if (!err) { if (*dft_ttyname) - { - rc = add_arg (gpg, "--ttyname"); - if (!rc) - rc = add_arg (gpg, dft_ttyname); - } + rc = add_gpg_arg_with_value (gpg, "--ttyname=", dft_ttyname, 0); else rc = 0; if (!rc) @@ -618,11 +650,7 @@ goto leave; if (dft_ttytype) - { - rc = add_arg (gpg, "--ttytype"); - if (!rc) - rc = add_arg (gpg, dft_ttytype); - } + rc = add_gpg_arg_with_value (gpg, "--ttytype=", dft_ttytype, 0); free (dft_ttytype); } @@ -631,16 +659,6 @@ } } - rc = gpgme_data_new (&gpg->diagnostics); - if (rc) - goto leave; - - rc = add_arg (gpg, "--logger-fd"); - if (rc) - goto leave; - - rc = add_data (gpg, gpg->diagnostics, -2, 1); - leave: if (rc) gpg_release (gpg); @@ -695,6 +713,8 @@ if (ctx->include_key_block) gpg->flags.include_key_block = 1; } + + gpg->flags.no_auto_check_trustdb = !!ctx->no_auto_check_trustdb; } @@ -866,11 +886,11 @@ static gpgme_error_t build_argv (engine_gpg_t gpg, const char *pgmname) { - gpgme_error_t err; + gpgme_error_t err = 0; struct arg_and_data_s *a; - struct fd_data_map_s *fd_data_map; + struct fd_data_map_s *fd_data_map = NULL; size_t datac=0, argc=0, allocated_argc=0; - char **argv; + char **argv = NULL; int need_special = 0; int use_agent = 0; char *p; @@ -904,7 +924,7 @@ argc++; /* For argv0. */ for (a = gpg->arglist; a; a = a->next) { - argc++; + argc += 1 + (gpg->flags.use_gpgtar && a->gpg_arg); if (a->data) { /*fprintf (stderr, "build_argv: data\n" );*/ @@ -923,24 +943,24 @@ if (use_agent) argc++; if (*gpg->request_origin) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; if (gpg->auto_key_locate) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; if (gpg->trust_model) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; if (gpg->flags.no_symkey_cache) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; if (gpg->flags.ignore_mdc_error) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; if (gpg->flags.offline) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; + if (gpg->flags.no_auto_check_trustdb) + argc += 1 + !!gpg->flags.use_gpgtar; if (gpg->pinentry_mode) - argc++; + argc += 1 + !!gpg->flags.use_gpgtar; if (!gpg->cmd.used) argc++; /* --batch */ - argc++; /* --no-sk-comments */ - argv = calloc (argc + 1, sizeof *argv); allocated_argc = argc; @@ -949,19 +969,16 @@ fd_data_map = calloc (datac + 1, sizeof *fd_data_map); if (!fd_data_map) { - int saved_err = gpg_error_from_syserror (); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc = datac = 0; argvargc = strdup (_gpgme_get_basename (pgmname)); /* argv0 */ if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; if (need_special) @@ -969,10 +986,8 @@ argvargc = strdup ("--enable-special-filenames"); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } @@ -981,10 +996,8 @@ argvargc = strdup ("--use-agent"); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } @@ -993,79 +1006,148 @@ if (*gpg->request_origin) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = _gpgme_strconcat ("--request-origin=", gpg->request_origin, NULL); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } if (gpg->auto_key_locate) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup (gpg->auto_key_locate); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } if (gpg->trust_model) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup (gpg->trust_model); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } if (gpg->flags.no_symkey_cache) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup ("--no-symkey-cache"); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } if (gpg->flags.ignore_mdc_error) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup ("--ignore-mdc-error"); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } if (gpg->flags.offline) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup ("--disable-dirmngr"); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } + + if (gpg->flags.no_auto_check_trustdb) + { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } + argvargc = strdup ("--no-auto-check-trustdb"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; } argc++; } @@ -1083,13 +1165,21 @@ } if (s) { + if (gpg->flags.use_gpgtar) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup (s); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } @@ -1100,22 +1190,11 @@ argvargc = strdup ("--batch"); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } - argvargc = strdup ("--no-sk-comments"); - if (!argvargc) - { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; - } - argc++; for (a = gpg->arglist; a; a = a->next) { if (a->arg_locp) @@ -1133,10 +1212,8 @@ if (_gpgme_io_pipe (fds, fd_data_mapdatac.inbound ? 1 : 0) == -1) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } if (_gpgme_io_set_close_notify (fds0, close_notify_handler, gpg) @@ -1184,10 +1261,8 @@ argvargc = malloc (buflen); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } ptr = argvargc; @@ -1206,13 +1281,21 @@ } else { + if (gpg->flags.use_gpgtar && a->gpg_arg) + { + argvargc = strdup ("--gpg-args"); + if (!argvargc) + { + err = gpg_error_from_syserror (); + goto leave; + } + argc++; + } argvargc = strdup (a->arg); if (!argvargc) { - int saved_err = gpg_error_from_syserror (); - free (fd_data_map); - free_argv (argv); - return saved_err; + err = gpg_error_from_syserror (); + goto leave; } argc++; } @@ -1223,9 +1306,18 @@ allocated array like ccparray in gnupg. */ assert (argc <= allocated_argc); - gpg->argv = argv; - gpg->fd_data_map = fd_data_map; - return 0; +leave: + if (err) + { + free (fd_data_map); + free_argv (argv); + } + else + { + gpg->argv = argv; + gpg->fd_data_map = fd_data_map; + } + return err; } @@ -1543,28 +1635,61 @@ if (!gpg) return gpg_error (GPG_ERR_INV_VALUE); - if (!gpg->file_name && !_gpgme_get_default_gpg_name ()) + if (!gpg->flags.use_gpgtar) + pgmname = gpg->file_name ? gpg->file_name : _gpgme_get_default_gpg_name (); + else + pgmname = _gpgme_get_default_gpgtar_name (); + if (!pgmname) return trace_gpg_error (GPG_ERR_INV_ENGINE); + rc = gpgme_data_new (&gpg->diagnostics); + if (rc) + return rc; + + if (gpg->flags.use_gpgtar) + { + /* Read the diagnostics output from gpgtar's stderr. */ + rc = add_data (gpg, gpg->diagnostics, 2, 1); + if (rc) + return rc; + } + else + { + rc = add_data_ext (gpg, gpg->diagnostics, -2, 1, 1); + if (rc) + return rc; + + rc = add_arg_ext (gpg, "--logger-fd", 1); + if (rc) + return rc; + } + + { + char buf25; + _gpgme_io_fd2str (buf, sizeof (buf), gpg->status.fd1); + rc = add_arg_with_locp (gpg, buf, &gpg->status.arg_loc, 1); + if (rc) + return rc; + } + + rc = add_arg_ext (gpg, "--status-fd", 1); + if (rc) + return rc; + if (gpg->lc_ctype) { - rc = add_arg_ext (gpg, gpg->lc_ctype, 1); - if (!rc) - rc = add_arg_ext (gpg, "--lc-ctype", 1); + rc = add_gpg_arg_with_value (gpg, "--lc-ctype=", gpg->lc_ctype, 1); if (rc) return rc; } if (gpg->lc_messages) { - rc = add_arg_ext (gpg, gpg->lc_messages, 1); - if (!rc) - rc = add_arg_ext (gpg, "--lc-messages", 1); + rc = add_gpg_arg_with_value (gpg, "--lc-messages=", gpg->lc_messages, 1); if (rc) return rc; } - pgmname = gpg->file_name ? gpg->file_name : _gpgme_get_default_gpg_name (); rc = build_argv (gpg, pgmname); if (rc) return rc; @@ -1661,28 +1786,23 @@ static gpgme_error_t add_input_size_hint (engine_gpg_t gpg, gpgme_data_t data) { - gpgme_error_t err; - gpgme_off_t value = _gpgme_data_get_size_hint (data); + uint64_t value = _gpgme_data_get_size_hint (data); char numbuf50; /* Large enough for even 2^128 in base-10. */ char *p; if (!value || !have_gpg_version (gpg, "2.1.15")) return 0; - err = add_arg (gpg, "--input-size-hint"); - if (!err) + p = numbuf + sizeof numbuf; + *--p = 0; + do { - p = numbuf + sizeof numbuf; - *--p = 0; - do - { - *--p = '0' + (value % 10); - value /= 10; - } - while (value); - err = add_arg (gpg, p); + *--p = '0' + (value % 10); + value /= 10; } - return err; + while (value); + + return add_gpg_arg_with_value (gpg, "--input-size-hint=", p, 0); } @@ -1696,6 +1816,14 @@ engine_gpg_t gpg = engine; gpgme_error_t err; + gpg->flags.use_gpgtar = !!(flags & GPGME_DECRYPT_ARCHIVE); + + if (gpg->flags.use_gpgtar && !have_usable_gpgtar (gpg)) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + + if (gpg->flags.use_gpgtar && (flags & GPGME_DECRYPT_UNWRAP)) + return gpg_error (GPG_ERR_INV_VALUE); + err = add_arg (gpg, "--decrypt"); if (!err && (flags & GPGME_DECRYPT_UNWRAP)) @@ -1707,17 +1835,17 @@ } if (!err && export_session_key) - err = add_arg (gpg, "--show-session-key"); + err = add_gpg_arg (gpg, "--show-session-key"); if (!err && auto_key_retrieve) - err = add_arg (gpg, "--auto-key-retrieve"); + err = add_gpg_arg (gpg, "--auto-key-retrieve"); if (!err && gpg->flags.auto_key_import) - err = add_arg (gpg, "--auto-key-import"); + err = add_gpg_arg (gpg, "--auto-key-import"); if (!err && override_session_key && *override_session_key) { - if (have_gpg_version (gpg, "2.1.16")) + if (have_gpg_version (gpg, "2.1.16") && !gpg->flags.use_gpgtar) { gpgme_data_release (gpg->override_session_key); TRACE (DEBUG_ENGINE, "override", gpg, "seskey='%s' len=%zu\n", @@ -1747,25 +1875,43 @@ else { /* Using that option may leak the session key via ps(1). */ - err = add_arg (gpg, "--override-session-key"); - if (!err) - err = add_arg (gpg, override_session_key); + err = add_gpg_arg_with_value (gpg, "--override-session-key=", + override_session_key, 0); } } /* Tell the gpg object about the data. */ - if (!err) - err = add_arg (gpg, "--output"); - if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_data (gpg, plain, 1, 1); - if (!err) - err = add_input_size_hint (gpg, ciph); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, ciph, -1, 0); + if (gpg->flags.use_gpgtar) + { + const char *file_name = gpgme_data_get_file_name (plain); + if (!err && file_name) + { + err = add_arg (gpg, "--directory"); + if (!err) + err = add_arg (gpg, file_name); + } + if (!err) + err = add_input_size_hint (gpg, ciph); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_file_name_arg_or_data (gpg, ciph, 0, 0); + } + else + { + if (!err) + err = add_arg (gpg, "--output"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_data (gpg, plain, 1, 1); + if (!err) + err = add_input_size_hint (gpg, ciph); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_file_name_arg_or_data (gpg, ciph, -1, 0); + } if (!err) err = start (gpg); @@ -1849,16 +1995,11 @@ static gpgme_error_t append_args_from_sender (engine_gpg_t gpg, gpgme_ctx_t ctx) { - gpgme_error_t err; + gpgme_error_t err = 0; if (ctx->sender && have_gpg_version (gpg, "2.1.15")) - { - err = add_arg (gpg, "--sender"); - if (!err) - err = add_arg (gpg, ctx->sender); - } - else - err = 0; + err = add_gpg_arg_with_value (gpg, "--sender=", ctx->sender, 0); + return err; } @@ -1912,14 +2053,12 @@ if (!err) { if ((flags & NOTATION_FLAG_SET)) - err = add_arg (gpg, "--set-notation"); + err = add_gpg_arg_with_value (gpg, "--set-notation=", arg, 0); else if ((flags & NOTATION_FLAG_CERT)) - err = add_arg (gpg, "--cert-notation"); + err = add_gpg_arg_with_value (gpg, "--cert-notation=", arg, 0); else - err = add_arg (gpg, "--sig-notation"); + err = add_gpg_arg_with_value (gpg, "--sig-notation=", arg, 0); } - if (!err) - err = add_arg (gpg, arg); if (arg) free (arg); @@ -1946,9 +2085,7 @@ value = notation->value; if (!err) - err = add_arg (gpg, "--sig-policy-url"); - if (!err) - err = add_arg (gpg, value); + err = add_gpg_arg_with_value (gpg, "--sig-policy-url=", value, 0); if (value != notation->value) free (value); @@ -2181,6 +2318,14 @@ engine_gpg_t gpg = engine; gpgme_error_t err = 0; + gpg->flags.use_gpgtar = !!(flags & GPGME_ENCRYPT_ARCHIVE); + + if (gpg->flags.use_gpgtar && !have_usable_gpgtar (gpg)) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + + if (gpg->flags.use_gpgtar && (flags & GPGME_ENCRYPT_WRAP)) + return gpg_error (GPG_ERR_INV_VALUE); + if (recp || recpstring) err = add_arg (gpg, "--encrypt"); @@ -2188,7 +2333,7 @@ err = add_arg (gpg, "--symmetric"); if (!err && use_armor) - err = add_arg (gpg, "--armor"); + err = add_gpg_arg (gpg, "--armor"); if (!err && (flags & GPGME_ENCRYPT_WRAP)) { @@ -2198,31 +2343,31 @@ * the encryption would add an additional compression layer. * We better suppress that. */ flags |= GPGME_ENCRYPT_NO_COMPRESS; - err = add_arg (gpg, "--no-literal"); + err = add_gpg_arg (gpg, "--no-literal"); } if (!err && (flags & GPGME_ENCRYPT_NO_COMPRESS)) - err = add_arg (gpg, "--compress-algo=none"); + err = add_gpg_arg (gpg, "--compress-algo=none"); if (!err && (flags & GPGME_ENCRYPT_THROW_KEYIDS)) - err = add_arg (gpg, "--throw-keyids"); + err = add_gpg_arg (gpg, "--throw-keyids"); if (gpgme_data_get_encoding (plain) == GPGME_DATA_ENCODING_MIME && have_gpg_version (gpg, "2.1.14")) - err = add_arg (gpg, "--mimemode"); + err = add_gpg_arg (gpg, "--mimemode"); if (!err && gpg->flags.include_key_block) - err = add_arg (gpg, "--include-key-block"); + err = add_gpg_arg (gpg, "--include-key-block"); if (recp || recpstring) { /* If we know that all recipients are valid (full or ultimate trust) we can suppress further checks. */ if (!err && (flags & GPGME_ENCRYPT_ALWAYS_TRUST)) - err = add_arg (gpg, "--always-trust"); + err = add_gpg_arg (gpg, "--always-trust"); if (!err && (flags & GPGME_ENCRYPT_NO_ENCRYPT_TO)) - err = add_arg (gpg, "--no-encrypt-to"); + err = add_gpg_arg (gpg, "--no-encrypt-to"); if (!err && !recp && recpstring) err = append_args_from_recipients_string (gpg, flags, recpstring); @@ -2234,22 +2379,50 @@ if (!err) err = add_arg (gpg, "--output"); if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_data (gpg, ciph, 1, 1); - if (gpgme_data_get_file_name (plain)) { + const char *output = gpgme_data_get_file_name (ciph); + if (output) + err = add_arg (gpg, output); + else + { + err = add_arg (gpg, "-"); + if (!err) + err = add_data (gpg, ciph, 1, 1); + } + } + if (gpg->flags.use_gpgtar) + { + const char *file_name = gpgme_data_get_file_name (plain); + if (!err && file_name) + { + err = add_arg (gpg, "--directory"); + if (!err) + err = add_arg (gpg, file_name); + } + if (!err) + err = add_arg (gpg, "--files-from"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_arg (gpg, "--null"); + if (!err) + err = add_arg (gpg, "--utf8-strings"); + /* Pass the filenames to gpgtar's stdin. */ + if (!err) + err = add_data (gpg, plain, 0, 0); + } + else + { + const char *file_name = gpgme_data_get_file_name (plain); + if (!err && file_name) + err = add_gpg_arg_with_value (gpg, "--set-filename=", file_name, 0); + if (!err) + err = add_input_size_hint (gpg, plain); if (!err) - err = add_arg (gpg, "--set-filename"); + err = add_arg (gpg, "--"); if (!err) - err = add_arg (gpg, gpgme_data_get_file_name (plain)); + err = add_data (gpg, plain, -1, 0); } - if (!err) - err = add_input_size_hint (gpg, plain); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, plain, -1, 0); if (!err) err = start (gpg); @@ -2268,6 +2441,11 @@ engine_gpg_t gpg = engine; gpgme_error_t err = 0; + gpg->flags.use_gpgtar = !!(flags & GPGME_ENCRYPT_ARCHIVE); + + if (gpg->flags.use_gpgtar && !have_usable_gpgtar (gpg)) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + if (recp || recpstring) err = add_arg (gpg, "--encrypt"); @@ -2277,30 +2455,30 @@ if (!err) err = add_arg (gpg, "--sign"); if (!err && use_armor) - err = add_arg (gpg, "--armor"); + err = add_gpg_arg (gpg, "--armor"); if (!err && (flags & GPGME_ENCRYPT_NO_COMPRESS)) - err = add_arg (gpg, "--compress-algo=none"); + err = add_gpg_arg (gpg, "--compress-algo=none"); if (!err && (flags & GPGME_ENCRYPT_THROW_KEYIDS)) - err = add_arg (gpg, "--throw-keyids"); + err = add_gpg_arg (gpg, "--throw-keyids"); if (gpgme_data_get_encoding (plain) == GPGME_DATA_ENCODING_MIME && have_gpg_version (gpg, "2.1.14")) - err = add_arg (gpg, "--mimemode"); + err = add_gpg_arg (gpg, "--mimemode"); if (!err && gpg->flags.include_key_block) - err = add_arg (gpg, "--include-key-block"); + err = add_gpg_arg (gpg, "--include-key-block"); if (recp || recpstring) { /* If we know that all recipients are valid (full or ultimate trust) we can suppress further checks. */ if (!err && (flags & GPGME_ENCRYPT_ALWAYS_TRUST)) - err = add_arg (gpg, "--always-trust"); + err = add_gpg_arg (gpg, "--always-trust"); if (!err && (flags & GPGME_ENCRYPT_NO_ENCRYPT_TO)) - err = add_arg (gpg, "--no-encrypt-to"); + err = add_gpg_arg (gpg, "--no-encrypt-to"); if (!err && !recp && recpstring) err = append_args_from_recipients_string (gpg, flags, recpstring); @@ -2321,22 +2499,50 @@ if (!err) err = add_arg (gpg, "--output"); if (!err) - err = add_arg (gpg, "-"); - if (!err) - err = add_data (gpg, ciph, 1, 1); - if (gpgme_data_get_file_name (plain)) { + const char *output = gpgme_data_get_file_name (ciph); + if (output) + err = add_arg (gpg, output); + else + { + err = add_arg (gpg, "-"); + if (!err) + err = add_data (gpg, ciph, 1, 1); + } + } + if (gpg->flags.use_gpgtar) + { + const char *file_name = gpgme_data_get_file_name (plain); + if (!err && file_name) + { + err = add_arg (gpg, "--directory"); + if (!err) + err = add_arg (gpg, file_name); + } + if (!err) + err = add_arg (gpg, "--files-from"); if (!err) - err = add_arg (gpg, "--set-filename"); + err = add_arg (gpg, "-"); + if (!err) + err = add_arg (gpg, "--null"); + if (!err) + err = add_arg (gpg, "--utf8-strings"); + /* Pass the filenames to gpgtar's stdin. */ if (!err) - err = add_arg (gpg, gpgme_data_get_file_name (plain)); + err = add_data (gpg, plain, 0, 0); + } + else + { + const char *file_name = gpgme_data_get_file_name (plain); + if (!err && file_name) + err = add_gpg_arg_with_value (gpg, "--set-filename=", file_name, 0); + if (!err) + err = add_input_size_hint (gpg, plain); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_data (gpg, plain, -1, 0); } - if (!err) - err = add_input_size_hint (gpg, plain); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, plain, -1, 0); if (!err) err = start (gpg); @@ -3105,8 +3311,11 @@ code. The problem is that we don't know the context here and thus can't access the cached version number for the engine info structure. */ - err = add_arg (gpg, "--locate-keys"); - if ((mode & GPGME_KEYLIST_MODE_SIGS)) + if ((mode & GPGME_KEYLIST_MODE_FORCE_EXTERN)) + err = add_arg (gpg, "--locate-external-keys"); + else + err = add_arg (gpg, "--locate-keys"); + if (!err && (mode & GPGME_KEYLIST_MODE_SIGS)) err = add_arg (gpg, "--with-sig-check"); } else @@ -3179,7 +3388,7 @@ static gpgme_error_t -gpg_keylist_data (void *engine, gpgme_data_t data) +gpg_keylist_data (void *engine, gpgme_keylist_mode_t mode, gpgme_data_t data) { engine_gpg_t gpg = engine; gpgme_error_t err; @@ -3198,6 +3407,9 @@ err = add_arg (gpg, "--dry-run"); if (!err) err = add_arg (gpg, "--import"); + if (!err && (mode & GPGME_KEYLIST_MODE_SIGS) + && have_gpg_version (gpg, "2.0.10")) + err = add_arg (gpg, "--with-sig-check"); if (!err) err = add_arg (gpg, "--"); if (!err) @@ -3261,7 +3473,7 @@ if (!err) err = add_arg (gpg, key->fpr); - if (!err && userid) + if (!err && userid && *userid) { if ((flags & GPGME_KEYSIGN_LFSEP)) { @@ -3307,7 +3519,7 @@ if (!err) err = add_arg (gpg, signing_key->fpr); - if (!err && userid) + if (!err && userid && *userid) { if ((flags & GPGME_REVSIG_LFSEP)) { @@ -3370,35 +3582,45 @@ static gpgme_error_t gpg_sign (void *engine, gpgme_data_t in, gpgme_data_t out, - gpgme_sig_mode_t mode, int use_armor, int use_textmode, + gpgme_sig_mode_t flags, int use_armor, int use_textmode, int include_certs, gpgme_ctx_t ctx /* FIXME */) { engine_gpg_t gpg = engine; gpgme_error_t err; + const char *output = NULL; (void)include_certs; - if (mode == GPGME_SIG_MODE_CLEAR) + if ((flags != GPGME_SIG_MODE_NORMAL) && (flags != GPGME_SIG_MODE_DETACH) + && (flags != GPGME_SIG_MODE_CLEAR) && (flags != GPGME_SIG_MODE_ARCHIVE)) + return gpg_error (GPG_ERR_INV_VALUE); + + gpg->flags.use_gpgtar = !!(flags & GPGME_SIG_MODE_ARCHIVE); + + if (gpg->flags.use_gpgtar && !have_usable_gpgtar (gpg)) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + + if (flags & GPGME_SIG_MODE_CLEAR) err = add_arg (gpg, "--clearsign"); else { err = add_arg (gpg, "--sign"); - if (!err && mode == GPGME_SIG_MODE_DETACH) + if (!err && (flags & GPGME_SIG_MODE_DETACH)) err = add_arg (gpg, "--detach"); if (!err && use_armor) - err = add_arg (gpg, "--armor"); + err = add_gpg_arg (gpg, "--armor"); if (!err) { if (gpgme_data_get_encoding (in) == GPGME_DATA_ENCODING_MIME && have_gpg_version (gpg, "2.1.14")) - err = add_arg (gpg, "--mimemode"); + err = add_gpg_arg (gpg, "--mimemode"); else if (use_textmode) - err = add_arg (gpg, "--textmode"); + err = add_gpg_arg (gpg, "--textmode"); } } if (!err && gpg->flags.include_key_block) - err = add_arg (gpg, "--include-key-block"); + err = add_gpg_arg (gpg, "--include-key-block"); if (!err) err = append_args_from_signers (gpg, ctx); if (!err) @@ -3406,22 +3628,53 @@ if (!err) err = append_args_from_sig_notations (gpg, ctx, NOTATION_FLAG_SIG); - if (gpgme_data_get_file_name (in)) + if (!err) + { + output = gpgme_data_get_file_name (out); + if (output) + { + err = add_arg (gpg, "--output"); + if (!err) + err = add_arg (gpg, output); + } + } + + /* Tell the gpg object about the data. */ + if (gpg->flags.use_gpgtar) + { + const char *file_name = gpgme_data_get_file_name (in); + if (!err && file_name) + { + err = add_arg (gpg, "--directory"); + if (!err) + err = add_arg (gpg, file_name); + } + if (!err) + err = add_arg (gpg, "--files-from"); + if (!err) + err = add_arg (gpg, "-"); + if (!err) + err = add_arg (gpg, "--null"); + if (!err) + err = add_arg (gpg, "--utf8-strings"); + /* Pass the filenames to gpgtar's stdin. */ + if (!err) + err = add_data (gpg, in, 0, 0); + } + else { + const char *file_name = gpgme_data_get_file_name (in); + if (!err && file_name) + err = add_gpg_arg_with_value (gpg, "--set-filename=", file_name, 0); + if (!err) + err = add_input_size_hint (gpg, in); if (!err) - err = add_arg (gpg, "--set-filename"); + err = add_arg (gpg, "--"); if (!err) - err = add_arg (gpg, gpgme_data_get_file_name (in)); + err = add_data (gpg, in, -1, 0); } - /* Tell the gpg object about the data. */ - if (!err) - err = add_input_size_hint (gpg, in); - if (!err) - err = add_arg (gpg, "--"); - if (!err) - err = add_data (gpg, in, -1, 0); - if (!err) + if (!err && !output) err = add_data (gpg, out, 1, 1); if (!err) @@ -3431,20 +3684,43 @@ } static gpgme_error_t -gpg_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, - gpgme_data_t plaintext, gpgme_ctx_t ctx) +gpg_verify (void *engine, gpgme_verify_flags_t flags, gpgme_data_t sig, + gpgme_data_t signed_text, gpgme_data_t plaintext, gpgme_ctx_t ctx) { engine_gpg_t gpg = engine; gpgme_error_t err; + gpg->flags.use_gpgtar = !!(flags & GPGME_VERIFY_ARCHIVE); + + if (gpg->flags.use_gpgtar && !have_usable_gpgtar (gpg)) + return gpg_error (GPG_ERR_NOT_SUPPORTED); + err = append_args_from_sender (gpg, ctx); if (!err && gpg->flags.auto_key_import) - err = add_arg (gpg, "--auto-key-import"); + err = add_gpg_arg (gpg, "--auto-key-import"); if (!err && ctx->auto_key_retrieve) - err = add_arg (gpg, "--auto-key-retrieve"); + err = add_gpg_arg (gpg, "--auto-key-retrieve"); if (err) ; + else if (gpg->flags.use_gpgtar) + { + const char *file_name = gpgme_data_get_file_name (plaintext); + if (!err && file_name) + { + err = add_arg (gpg, "--directory"); + if (!err) + err = add_arg (gpg, file_name); + } + /* gpgtar uses --decrypt also for signed-only archives */ + err = add_arg (gpg, "--decrypt"); + if (!err) + err = add_input_size_hint (gpg, sig); + if (!err) + err = add_arg (gpg, "--"); + if (!err) + err = add_file_name_arg_or_data (gpg, sig, 0, 0); + } else if (plaintext) { /* Normal or cleartext signature. */ @@ -3456,7 +3732,7 @@ if (!err) err = add_arg (gpg, "--"); if (!err) - err = add_data (gpg, sig, -1, 0); + err = add_file_name_arg_or_data (gpg, sig, -1, 0); if (!err) err = add_data (gpg, plaintext, 1, 1); } @@ -3468,9 +3744,9 @@ if (!err) err = add_arg (gpg, "--"); if (!err) - err = add_data (gpg, sig, -1, 0); + err = add_file_name_arg_or_data (gpg, sig, -1, 0); if (!err && signed_text) - err = add_data (gpg, signed_text, -1, 0); + err = add_file_name_arg_or_data (gpg, signed_text, -1, 0); } if (!err)
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/engine-gpgsm.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/engine-gpgsm.c
Changed
@@ -1232,6 +1232,38 @@ #endif +/* Send the input-size-hint option. Note that we need to send it + * always so that we don't actually use a wrong hint from the last + * command. */ +static gpgme_error_t +send_input_size_hint (engine_gpgsm_t gpgsm, gpgme_data_t data) +{ + gpg_error_t err; + uint64_t value; + char numbuf50; /* Large enough for even 2^128 in base-10. */ + char cmd100; + char *p; + + value = _gpgme_data_get_size_hint (data); + if (!value) + value = 0; + + p = numbuf + sizeof numbuf; + *--p = 0; + do + { + *--p = '0' + (value % 10); + value /= 10; + } + while (value); + + snprintf (cmd, sizeof cmd, "OPTION input-size-hint=%s", p); + err = gpgsm_assuan_simple_command (gpgsm, cmd, NULL, NULL); + if (gpg_err_code (err) == GPG_ERR_UNKNOWN_OPTION) + err = 0; /* Ignore error from older gpgsm versions. */ + return err; +} + static gpgme_error_t gpgsm_decrypt (void *engine, @@ -1256,6 +1288,10 @@ if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); + err = send_input_size_hint (gpgsm, ciph); + if (err) + return err; + gpgsm->input_cb.data = ciph; err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); if (err) @@ -1469,6 +1505,9 @@ if (!recp && !recpstring) /* Symmetric only */ return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + if (flags & GPGME_ENCRYPT_ARCHIVE) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + if ((flags & GPGME_ENCRYPT_NO_ENCRYPT_TO)) { err = gpgsm_assuan_simple_command (gpgsm, @@ -1477,6 +1516,10 @@ return err; } + err = send_input_size_hint (gpgsm, plain); + if (err) + return err; + gpgsm->input_cb.data = plain; err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); if (err) @@ -2040,7 +2083,7 @@ static gpgme_error_t gpgsm_sign (void *engine, gpgme_data_t in, gpgme_data_t out, - gpgme_sig_mode_t mode, int use_armor, int use_textmode, + gpgme_sig_mode_t flags, int use_armor, int use_textmode, int include_certs, gpgme_ctx_t ctx /* FIXME */) { engine_gpgsm_t gpgsm = engine; @@ -2054,6 +2097,9 @@ if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); + if (flags & (GPGME_SIG_MODE_CLEAR | GPGME_SIG_MODE_ARCHIVE)) + return gpg_error (GPG_ERR_INV_VALUE); + /* FIXME: This does not work as RESET does not reset it so we can't revert back to default. */ if (include_certs != GPGME_INCLUDE_CERTS_DEFAULT) @@ -2090,6 +2136,10 @@ return err; } + err = send_input_size_hint (gpgsm, in); + if (err) + return err; + gpgsm->input_cb.data = in; err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); if (err) @@ -2102,15 +2152,16 @@ gpgsm_clear_fd (gpgsm, MESSAGE_FD); gpgsm->inline_data = NULL; - err = start (gpgsm, mode == GPGME_SIG_MODE_DETACH + err = start (gpgsm, (flags & GPGME_SIG_MODE_DETACH) ? "SIGN --detached" : "SIGN"); return err; } static gpgme_error_t -gpgsm_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, - gpgme_data_t plaintext, gpgme_ctx_t ctx) +gpgsm_verify (void *engine, gpgme_verify_flags_t flags, gpgme_data_t sig, + gpgme_data_t signed_text, gpgme_data_t plaintext, + gpgme_ctx_t ctx) { engine_gpgsm_t gpgsm = engine; gpgme_error_t err; @@ -2120,6 +2171,9 @@ if (!gpgsm) return gpg_error (GPG_ERR_INV_VALUE); + if (flags & GPGME_VERIFY_ARCHIVE) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + gpgsm->input_cb.data = sig; err = gpgsm_set_fd (gpgsm, INPUT_FD, map_data_enc (gpgsm->input_cb.data)); if (err) @@ -2127,6 +2181,10 @@ if (!signed_text) { /* Normal or cleartext signature. */ + err = send_input_size_hint (gpgsm, sig); + if (err) + return err; + if (plaintext) { gpgsm->output_cb.data = plaintext; @@ -2142,6 +2200,10 @@ else { /* Detached signature. */ + err = send_input_size_hint (gpgsm, signed_text); + if (err) + return err; + gpgsm->message_cb.data = signed_text; err = gpgsm_set_fd (gpgsm, MESSAGE_FD, 0); gpgsm_clear_fd (gpgsm, OUTPUT_FD);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/engine-uiserver.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/engine-uiserver.c
Changed
@@ -1145,6 +1145,9 @@ else return gpgme_error (GPG_ERR_UNSUPPORTED_PROTOCOL); + if (flags & GPGME_ENCRYPT_ARCHIVE) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + if (flags & GPGME_ENCRYPT_PREPARE) { if (!recp || plain || ciph) @@ -1211,7 +1214,7 @@ static gpgme_error_t uiserver_sign (void *engine, gpgme_data_t in, gpgme_data_t out, - gpgme_sig_mode_t mode, int use_armor, int use_textmode, + gpgme_sig_mode_t flags, int use_armor, int use_textmode, int include_certs, gpgme_ctx_t ctx /* FIXME */) { engine_uiserver_t uiserver = engine; @@ -1234,8 +1237,11 @@ else return gpgme_error (GPG_ERR_UNSUPPORTED_PROTOCOL); + if (flags & (GPGME_SIG_MODE_CLEAR | GPGME_SIG_MODE_ARCHIVE)) + return gpg_error (GPG_ERR_INV_VALUE); + if (gpgrt_asprintf (&cmd, "SIGN%s%s", protocol, - (mode == GPGME_SIG_MODE_DETACH) ? " --detached" : "") < 0) + (flags & GPGME_SIG_MODE_DETACH) ? " --detached" : "") < 0) return gpg_error_from_syserror (); key = gpgme_signers_enum (ctx, 0); @@ -1291,8 +1297,9 @@ /* FIXME: Missing a way to specify --silent. */ static gpgme_error_t -uiserver_verify (void *engine, gpgme_data_t sig, gpgme_data_t signed_text, - gpgme_data_t plaintext, gpgme_ctx_t ctx) +uiserver_verify (void *engine, gpgme_verify_flags_t flags, gpgme_data_t sig, + gpgme_data_t signed_text, gpgme_data_t plaintext, + gpgme_ctx_t ctx) { engine_uiserver_t uiserver = engine; gpgme_error_t err; @@ -1313,6 +1320,9 @@ else return gpgme_error (GPG_ERR_UNSUPPORTED_PROTOCOL); + if (flags & GPGME_VERIFY_ARCHIVE) + return gpg_error (GPG_ERR_NOT_IMPLEMENTED); + if (gpgrt_asprintf (&cmd, "VERIFY%s", protocol) < 0) return gpg_error_from_syserror ();
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/engine.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/engine.c
Changed
@@ -897,7 +897,8 @@ gpgme_error_t -_gpgme_engine_op_keylist_data (engine_t engine, gpgme_data_t data) +_gpgme_engine_op_keylist_data (engine_t engine, gpgme_keylist_mode_t mode, + gpgme_data_t data) { if (!engine) return gpg_error (GPG_ERR_INV_VALUE); @@ -905,13 +906,13 @@ if (!engine->ops->keylist_data) return gpg_error (GPG_ERR_NOT_IMPLEMENTED); - return (*engine->ops->keylist_data) (engine->engine, data); + return (*engine->ops->keylist_data) (engine->engine, mode, data); } gpgme_error_t _gpgme_engine_op_sign (engine_t engine, gpgme_data_t in, gpgme_data_t out, - gpgme_sig_mode_t mode, int use_armor, + gpgme_sig_mode_t flags, int use_armor, int use_textmode, int include_certs, gpgme_ctx_t ctx /* FIXME */) { @@ -921,7 +922,7 @@ if (!engine->ops->sign) return gpg_error (GPG_ERR_NOT_IMPLEMENTED); - return (*engine->ops->sign) (engine->engine, in, out, mode, use_armor, + return (*engine->ops->sign) (engine->engine, in, out, flags, use_armor, use_textmode, include_certs, ctx); } @@ -939,9 +940,9 @@ gpgme_error_t -_gpgme_engine_op_verify (engine_t engine, gpgme_data_t sig, - gpgme_data_t signed_text, gpgme_data_t plaintext, - gpgme_ctx_t ctx) +_gpgme_engine_op_verify (engine_t engine, gpgme_verify_flags_t flags, + gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext, gpgme_ctx_t ctx) { if (!engine) return gpg_error (GPG_ERR_INV_VALUE); @@ -949,8 +950,8 @@ if (!engine->ops->verify) return gpg_error (GPG_ERR_NOT_IMPLEMENTED); - return (*engine->ops->verify) (engine->engine, sig, signed_text, plaintext, - ctx); + return (*engine->ops->verify) (engine->engine, flags, sig, signed_text, + plaintext, ctx); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/engine.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/engine.h
Changed
@@ -157,15 +157,18 @@ gpgme_keylist_mode_t mode, int engine_flags); gpgme_error_t _gpgme_engine_op_keylist_data (engine_t engine, + gpgme_keylist_mode_t mode, gpgme_data_t data); gpgme_error_t _gpgme_engine_op_sign (engine_t engine, gpgme_data_t in, - gpgme_data_t out, gpgme_sig_mode_t mode, + gpgme_data_t out, gpgme_sig_mode_t flags, int use_armor, int use_textmode, int include_certs, gpgme_ctx_t ctx /* FIXME */); gpgme_error_t _gpgme_engine_op_trustlist (engine_t engine, const char *pattern); -gpgme_error_t _gpgme_engine_op_verify (engine_t engine, gpgme_data_t sig, +gpgme_error_t _gpgme_engine_op_verify (engine_t engine, + gpgme_verify_flags_t flags, + gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext, gpgme_ctx_t ctx);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme-json.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme-json.c
Changed
@@ -2471,6 +2471,11 @@ if (abool) mode |= GPGME_KEYLIST_MODE_LOCATE; + if ((err = get_boolean_flag (request, "force-extern", 0, &abool))) + goto leave; + if (abool) + mode |= GPGME_KEYLIST_MODE_FORCE_EXTERN; + if (!mode) { /* default to local */ @@ -3059,6 +3064,59 @@  +static const char * +data_type_to_string (gpgme_data_type_t dt) +{ + const char *s = "?"; + + switch (dt) + { + case GPGME_DATA_TYPE_INVALID : s = "invalid"; break; + case GPGME_DATA_TYPE_UNKNOWN : s = "unknown"; break; + case GPGME_DATA_TYPE_PGP_SIGNED : s = "PGP-signed"; break; + case GPGME_DATA_TYPE_PGP_SIGNATURE: s = "PGP-signature"; break; + case GPGME_DATA_TYPE_PGP_ENCRYPTED: s = "PGP-encrypted"; break; + case GPGME_DATA_TYPE_PGP_OTHER : s = "PGP"; break; + case GPGME_DATA_TYPE_PGP_KEY : s = "PGP-key"; break; + case GPGME_DATA_TYPE_CMS_SIGNED : s = "CMS-signed"; break; + case GPGME_DATA_TYPE_CMS_ENCRYPTED: s = "CMS-encrypted"; break; + case GPGME_DATA_TYPE_CMS_OTHER : s = "CMS"; break; + case GPGME_DATA_TYPE_X509_CERT : s = "X.509"; break; + case GPGME_DATA_TYPE_PKCS12 : s = "PKCS12"; break; + } + return s; +} + + +static const char hlp_identify = + "op: \"identify\"\n" + "data: The data to identify.\n" + "\n" + "Optional boolean flags (default is false):\n" + "base64: Input data is base64 encoded.\n" + "\n" + "Response:\n" + "result: A string describing the object.\n"; +static gpg_error_t +op_identify (cjson_t request, cjson_t result) +{ + gpg_error_t err; + gpgme_data_t input = NULL; + gpgme_data_type_t dt; + + if ((err = get_string_data (request, result, "data", &input))) + goto leave; + + dt = gpgme_data_identify (input, 0); + xjson_AddStringToObject (result, "result", data_type_to_string (dt)); + + leave: + gpgme_data_release (input); + return err; +} + + + static const char hlp_getmore = "op: \"getmore\"\n" "\n" @@ -3158,6 +3216,7 @@ " keylist List keys.\n" " sign Sign data.\n" " verify Verify data.\n" + " identify Identify the type of the data\n" " version Get engine information.\n" " getmore Retrieve remaining data if chunksize was used.\n" " help Help overview.\n" @@ -3213,6 +3272,7 @@ { "createkey", op_createkey, hlp_createkey }, { "keylist", op_keylist, hlp_keylist }, { "import", op_import, hlp_import }, + { "identify", op_identify, hlp_identify }, { "sign", op_sign, hlp_sign }, { "verify", op_verify, hlp_verify }, { "version", op_version, hlp_version }, @@ -3782,6 +3842,64 @@ } +/* Run the --identify command. */ +static gpg_error_t +cmd_identify (const char *fname) +{ + gpg_error_t err; + estream_t fp; + gpgme_data_t data; + gpgme_data_type_t dt; + + if (fname) + { + fp = es_fopen (fname, "rb"); + if (!fp) + { + err = gpg_error_from_syserror (); + log_error ("can't open '%s': %s\n", fname, gpg_strerror (err)); + return err; + } + err = gpgme_data_new_from_estream (&data, fp); + } + else + { + char *buffer; + int n; + + fp = NULL; + es_set_binary (es_stdin); + + /* Urgs: gpgme_data_identify does a seek and that fails for stdin. */ + buffer = xmalloc (2048+1); + n = es_fread (buffer, 1, 2048, es_stdin); + if (n < 0 || es_ferror (es_stdin)) + { + err = gpg_error_from_syserror (); + log_error ("error reading '%s': %s\n", "stdin", gpg_strerror (err)); + xfree (buffer); + return err; + } + buffern = 0; + err = gpgme_data_new_from_mem (&data, buffer, n, 1); + xfree (buffer); + } + + if (err) + { + log_error ("error creating data object: %s\n", gpg_strerror (err)); + return err; + } + + dt = gpgme_data_identify (data, 0); + if (dt == GPGME_DATA_TYPE_INVALID) + log_error ("error identifying data\n"); + printf ("%s\n", data_type_to_string (dt)); + gpgme_data_release (data); + es_fclose (fp); + return 0; +} +  static const char * my_strusage( int level ) @@ -3817,6 +3935,7 @@ CMD_INTERACTIVE = 'i', CMD_SINGLE = 's', CMD_LIBVERSION = 501, + CMD_IDENTIFY } cmd = CMD_DEFAULT; enum { OPT_DEBUG = 600 @@ -3825,13 +3944,13 @@ static gpgrt_opt_t opts = { ARGPARSE_c (CMD_INTERACTIVE, "interactive", "Interactive REPL"), ARGPARSE_c (CMD_SINGLE, "single", "Single request mode"), + ARGPARSE_c (CMD_IDENTIFY, "identify", "Identify the input"), ARGPARSE_c (CMD_LIBVERSION, "lib-version", "Show library version"), ARGPARSE_s_n(OPT_DEBUG, "debug", "Flyswatter"), ARGPARSE_end() }; gpgrt_argparse_t pargs = { &argc, &argv}; - int log_file_set = 0; gpgrt_set_strusage (my_strusage); @@ -3855,6 +3974,7 @@ opt_interactive = 1; /*FALLTHROUGH*/ case CMD_SINGLE: + case CMD_IDENTIFY: case CMD_LIBVERSION: cmd = pargs.r_opt; break; @@ -3917,6 +4037,16 @@ interactive_repl (); break; + case CMD_IDENTIFY: + if (argc > 1) + { + log_error ("usage: %s --identify filename|-\n", + gpgrt_strusage (11)); + exit (1); + } + cmd_identify (argc && strcmp (*argv, "-")? *argv : NULL); + break; + case CMD_LIBVERSION: printf ("Version from header: %s (0x%06x)\n", GPGME_VERSION, GPGME_VERSION_NUMBER);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme-tool.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme-tool.c
Changed
@@ -1459,6 +1459,8 @@ modesidx++ = "ephemeral"; if (mode & GPGME_KEYLIST_MODE_VALIDATE) modesidx++ = "validate"; + if (mode & GPGME_KEYLIST_MODE_FORCE_EXTERN) + modesidx++ = "force_extern"; modesidx++ = NULL; gt_write_status (gt, STATUS_KEYLIST_MODE, modes0, modes1, modes2, @@ -2200,6 +2202,8 @@ mode |= GPGME_KEYLIST_MODE_EPHEMERAL; if (strstr (line, "validate")) mode |= GPGME_KEYLIST_MODE_VALIDATE; + if (strstr (line, "force_extern")) + mode |= GPGME_KEYLIST_MODE_FORCE_EXTERN; return gt_set_keylist_mode (server->gt, mode); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme-w32spawn.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme-w32spawn.c
Changed
@@ -40,10 +40,18 @@ #include "priv-io.h" +/* #define DEBUG_TO_FILE 1 */ + /* Name of this program. */ #define PGM "gpgme-w32spawn" +#ifdef DEBUG_TO_FILE +static FILE *mystderr; +#else +#define mystderr stderr +#endif +  static char * @@ -126,7 +134,7 @@ i = 0; while (argvi) { - fprintf (stderr, PGM": argv%2i = %s\n", i, argvi); + fprintf (mystderr, PGM": argv%2i = %s\n", i, argvi); i++; } @@ -146,8 +154,6 @@ si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE); si.hStdError = GetStdHandle (STD_ERROR_HANDLE); - fprintf (stderr, PGM": spawning: %s\n", arg_string); - for (i = 0; fd_listi.fd != -1; i++) { /* The handle already is inheritable. */ @@ -155,19 +161,19 @@ { si.hStdInput = (HANDLE) fd_listi.peer_name; duped_stdin = 1; - fprintf (stderr, PGM": dup 0x%x to stdin\n", fd_listi.peer_name); + fprintf (mystderr, PGM": dup 0x%x to stdin\n", fd_listi.peer_name); } else if (fd_listi.dup_to == 1) { si.hStdOutput = (HANDLE) fd_listi.peer_name; duped_stdout = 1; - fprintf (stderr, PGM": dup 0x%x to stdout\n", fd_listi.peer_name); + fprintf (mystderr, PGM": dup 0x%x to stdout\n", fd_listi.peer_name); } else if (fd_listi.dup_to == 2) { si.hStdError = (HANDLE) fd_listi.peer_name; duped_stderr = 1; - fprintf (stderr, PGM":dup 0x%x to stderr\n", fd_listi.peer_name); + fprintf (mystderr, PGM":dup 0x%x to stderr\n", fd_listi.peer_name); } } @@ -216,6 +222,7 @@ &pi)) /* returns process information */ { free (arg_string); + fprintf (mystderr, PGM": spawn error: %d\n", (int)GetLastError ()); /* FIXME: Should translate the error code. */ errno = EIO; return -1; @@ -252,7 +259,7 @@ if (func) { int rc = func (pi.dwProcessId); - fprintf (stderr, PGM": AllowSetForegroundWindow(%d): rc=%d\n", + fprintf (mystderr, PGM": AllowSetForegroundWindow(%d): rc=%d\n", (int)pi.dwProcessId, rc); } } @@ -418,7 +425,7 @@ if (aidx >= n_args) { - fprintf (stderr, PGM": translation file does not match args\n"); + fprintf (mystderr, PGM": translation file does not match args\n"); return NULL; } @@ -455,6 +462,10 @@ goto leave; } +#ifdef DEBUG_TO_FILE + mystderr = fopen ("h:/gpgme-w32spawn.log", "w"); +#endif + argv_spawn = translate_handles (argv1, &argv2, fd_list, &flags); if (!argv_spawn) { @@ -468,7 +479,7 @@ rc = my_spawn (argv_spawn, fd_list, flags); if (rc < 0) { - fprintf (stderr, PGM": executing `%s' failed: %s\n", + fprintf (mystderr, PGM": executing `%s' failed: %s\n", argv0, strerror (errno)); rc = 2; goto leave; @@ -476,12 +487,12 @@ leave: if (rc) - fprintf (stderr, PGM": internal error\n"); + fprintf (mystderr, PGM": internal error\n"); /* Always try to delete the temporary file. */ if (argc >= 2) { if (DeleteFile (argv1) == 0) - fprintf (stderr, PGM": failed to delete %s: ec=%ld\n", + fprintf (mystderr, PGM": failed to delete %s: ec=%ld\n", argv1, GetLastError ()); } return rc;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme.c
Changed
@@ -79,6 +79,11 @@ return _gpgme_set_default_gpgconf_name (value); else if (!strcmp (name, "gpg-name")) return _gpgme_set_default_gpg_name (value); + else if (!strcmp (name, "inst-type")) + { + _gpgme_set_get_inst_type (value); + return 0; + } else if (!strcmp (name, "w32-inst-dir")) return _gpgme_set_override_inst_dir (value); else @@ -602,6 +607,10 @@ if (!ctx->import_filter) err = gpg_error_from_syserror (); } + else if (!strcmp (name, "no-auto-check-trustdb")) + { + ctx->no_auto_check_trustdb = abool; + } else err = gpg_error (GPG_ERR_UNKNOWN_NAME); @@ -683,6 +692,10 @@ { return ctx->import_filter? ctx->import_filter : ""; } + else if (!strcmp (name, "no-auto-check-trustdb")) + { + return ctx->no_auto_check_trustdb? "1":""; + } else return NULL; } @@ -782,6 +795,10 @@ if (!ctx) return gpg_error (GPG_ERR_INV_VALUE); + if ((mode & GPGME_KEYLIST_MODE_LOCATE_EXTERNAL) == + (GPGME_KEYLIST_MODE_LOCAL|GPGME_KEYLIST_MODE_FORCE_EXTERN)) + return gpg_error (GPG_ERR_INV_VALUE); + ctx->keylist_mode = mode; return 0; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme.def -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme.def
Changed
@@ -283,5 +283,7 @@ gpgme_op_receive_keys @209 gpgme_op_receive_keys_start @210 + gpgme_op_verify_ext @211 + gpgme_op_verify_ext_start @212 ; END
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme.h.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme.h.in
Changed
@@ -303,12 +303,13 @@ gpgme_hash_algo_t; -/* The available signature modes. */ +/* The available signature mode flags. */ typedef enum { GPGME_SIG_MODE_NORMAL = 0, GPGME_SIG_MODE_DETACH = 1, - GPGME_SIG_MODE_CLEAR = 2 + GPGME_SIG_MODE_CLEAR = 2, + GPGME_SIG_MODE_ARCHIVE = 4 } gpgme_sig_mode_t; @@ -382,8 +383,10 @@ #define GPGME_KEYLIST_MODE_WITH_KEYGRIP 64 #define GPGME_KEYLIST_MODE_EPHEMERAL 128 #define GPGME_KEYLIST_MODE_VALIDATE 256 +#define GPGME_KEYLIST_MODE_FORCE_EXTERN 512 #define GPGME_KEYLIST_MODE_LOCATE (1|2) +#define GPGME_KEYLIST_MODE_LOCATE_EXTERNAL (1|2|512) typedef unsigned int gpgme_keylist_mode_t; @@ -572,8 +575,17 @@ /* True if the key is compliant to the de-vs mode. */ unsigned int is_de_vs : 1; + /* True if the key can be used for restricted encryption (ADSK). */ + unsigned int can_renc : 1; + + /* True if the key can be used for timestamping. */ + unsigned int can_timestamp : 1; + + /* True if the private key is possessed by more than one person. */ + unsigned int is_group_owned : 1; + /* Internal to GPGME, do not use. */ - unsigned int _unused : 20; + unsigned int _unused : 17; /* Public key algorithm supported by this subkey. */ gpgme_pubkey_algo_t pubkey_algo; @@ -1297,7 +1309,8 @@ GPGME_ENCRYPT_SYMMETRIC = 32, GPGME_ENCRYPT_THROW_KEYIDS = 64, GPGME_ENCRYPT_WRAP = 128, - GPGME_ENCRYPT_WANT_ADDRESS = 256 + GPGME_ENCRYPT_WANT_ADDRESS = 256, + GPGME_ENCRYPT_ARCHIVE = 512 } gpgme_encrypt_flags_t; @@ -1422,6 +1435,7 @@ typedef enum { GPGME_DECRYPT_VERIFY = 1, + GPGME_DECRYPT_ARCHIVE = 2, GPGME_DECRYPT_UNWRAP = 128 } gpgme_decrypt_flags_t; @@ -1517,10 +1531,10 @@ /* Sign the plaintext PLAIN and store the signature in SIG. */ gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, - gpgme_sig_mode_t mode); + gpgme_sig_mode_t flags); gpgme_error_t gpgme_op_sign (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, - gpgme_sig_mode_t mode); + gpgme_sig_mode_t flags);  /* @@ -1629,6 +1643,13 @@ /* Retrieve a pointer to the result of the verify operation. */ gpgme_verify_result_t gpgme_op_verify_result (gpgme_ctx_t ctx); +/* The valid verify flags. */ +typedef enum + { + GPGME_VERIFY_ARCHIVE = 1 + } +gpgme_verify_flags_t; + /* Verify within CTX that SIG is a valid signature for TEXT. */ gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, @@ -1636,6 +1657,16 @@ gpgme_error_t gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext); +gpgme_error_t gpgme_op_verify_ext_start (gpgme_ctx_t ctx, + gpgme_verify_flags_t flags, + gpgme_data_t sig, + gpgme_data_t signed_text, + gpgme_data_t plaintext); +gpgme_error_t gpgme_op_verify_ext (gpgme_ctx_t ctx, + gpgme_verify_flags_t flags, + gpgme_data_t sig, + gpgme_data_t signed_text, + gpgme_data_t plaintext);  /*
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme.m4 -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme.m4
Changed
@@ -1,5 +1,5 @@ # gpgme.m4 - autoconf macro to detect GPGME. -# Copyright (C) 2002, 2003, 2004, 2014, 2018 g10 Code GmbH +# Copyright (C) 2002, 2003, 2004, 2014, 2018, 2022 g10 Code GmbH # # This file is free software; as a special exception the author gives # unlimited permission to copy and/or distribute it, with or without @@ -9,13 +9,102 @@ # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # -# Last-changed: 2020-11-20 +# Last-changed: 2022-11-25 -AC_DEFUN(_AM_PATH_GPGME_CONFIG, - AC_ARG_WITH(gpgme-prefix, - AS_HELP_STRING(--with-gpgme-prefix=PFX, - prefix where GPGME is installed (optional)), +dnl +dnl Find gpgrt-config, which uses .pc file +dnl (minimum pkg-config functionality, supporting cross build) +dnl +dnl _AM_PATH_GPGRT_CONFIG +AC_DEFUN(_AM_PATH_GPGRT_CONFIG,dnl + AC_PATH_PROG(GPGRT_CONFIG, gpgrt-config, no, $prefix/bin:$PATH) + if test "$GPGRT_CONFIG" != "no"; then + # Determine gpgrt_libdir + # + # Get the prefix of gpgrt-config assuming it's something like: + # <PREFIX>/bin/gpgrt-config + gpgrt_prefix=${GPGRT_CONFIG%/*/*} + possible_libdir1=${gpgrt_prefix}/lib + # Determine by using system libdir-format with CC, it's like: + # Normal style: /usr/lib + # GNU cross style: /usr/<triplet>/lib + # Debian style: /usr/lib/<multiarch-name> + # Fedora/openSUSE style: /usr/lib, /usr/lib32 or /usr/lib64 + # It is assumed that CC is specified to the one of host on cross build. + if libdir_candidates=$(${CC:-cc} -print-search-dirs | \ + sed -n -e "/^libraries/{s/libraries: =//;s/:/\\ +/g;p;}"); then + # From the output of -print-search-dirs, select valid pkgconfig dirs. + libdir_candidates=$(for dir in $libdir_candidates; do + if p=$(cd $dir 2>/dev/null && pwd); then + test -d "$p/pkgconfig" && echo $p; + fi + done) + + for possible_libdir0 in $libdir_candidates; do + # possible_libdir0: + # Fallback candidate, the one of system-installed (by $CC) + # (/usr/<triplet>/lib, /usr/lib/<multiarch-name> or /usr/lib32) + # possible_libdir1: + # Another candidate, user-locally-installed + # (<gpgrt_prefix>/lib) + # possible_libdir2 + # Most preferred + # (<gpgrt_prefix>/<triplet>/lib, + # <gpgrt_prefix>/lib/<multiarch-name> or <gpgrt_prefix>/lib32) + if test "${possible_libdir0##*/}" = "lib"; then + possible_prefix0=${possible_libdir0%/lib} + possible_prefix0_triplet=${possible_prefix0##*/} + if test -z "$possible_prefix0_triplet"; then + continue + fi + possible_libdir2=${gpgrt_prefix}/$possible_prefix0_triplet/lib + else + possible_prefix0=${possible_libdir0%%/lib*} + possible_libdir2=${gpgrt_prefix}${possible_libdir0#$possible_prefix0} + fi + if test -f ${possible_libdir2}/pkgconfig/gpg-error.pc; then + gpgrt_libdir=${possible_libdir2} + elif test -f ${possible_libdir1}/pkgconfig/gpg-error.pc; then + gpgrt_libdir=${possible_libdir1} + elif test -f ${possible_libdir0}/pkgconfig/gpg-error.pc; then + gpgrt_libdir=${possible_libdir0} + fi + if test -n "$gpgrt_libdir"; then break; fi + done + if test -z "$libdir_candidates"; then + # No valid pkgconfig dir in any of the system directories, fallback + gpgrt_libdir=${possible_libdir1} + fi + else + # When we cannot determine system libdir-format, use this: + gpgrt_libdir=${possible_libdir1} + fi + else + unset GPGRT_CONFIG + fi + + if test -n "$gpgrt_libdir"; then + GPGRT_CONFIG="$GPGRT_CONFIG --libdir=$gpgrt_libdir" + if $GPGRT_CONFIG gpg-error >/dev/null 2>&1; then + GPG_ERROR_CONFIG="$GPGRT_CONFIG gpg-error" + AC_MSG_NOTICE(Use gpgrt-config with $gpgrt_libdir as gpg-error-config) + gpg_error_config_version=`$GPG_ERROR_CONFIG --modversion` + else + unset GPGRT_CONFIG + fi + elif test "$GPG_ERROR_CONFIG" != "no"; then + gpg_error_config_version=`$GPG_ERROR_CONFIG --version` + unset GPGRT_CONFIG + fi +) + +AC_DEFUN(_AM_PATH_GPGME_CONFIG,dnl +AC_REQUIRE(_AM_PATH_GPGRT_CONFIG)dnl + AC_ARG_WITH(gpgme-prefix, + AS_HELP_STRING(--with-gpgme-prefix=PFX, + prefix where GPGME is installed (optional)), gpgme_config_prefix="$withval", gpgme_config_prefix="") if test x"${GPGME_CONFIG}" = x ; then if test x"${gpgme_config_prefix}" != x ; then @@ -37,7 +126,7 @@ fi use_gpgrt_config="" - if test x"${GPGME_CONFIG}" = x -a x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then + if test x"$GPGRT_CONFIG" != x -a "$GPGRT_CONFIG" != "no"; then if $GPGRT_CONFIG gpgme --exists; then GPGME_CONFIG="$GPGRT_CONFIG gpgme" AC_MSG_NOTICE(Use gpgrt-config as gpgme-config) @@ -169,8 +258,9 @@ dnl Test for libgpgme and define GPGME_PTHREAD_CFLAGS dnl and GPGME_PTHREAD_LIBS. dnl -AC_DEFUN(AM_PATH_GPGME_PTHREAD, - AC_REQUIRE(_AM_PATH_GPGME_CONFIG)dnl +AC_DEFUN(AM_PATH_GPGME_PTHREAD, + AC_OBSOLETE($0, ; use AM_PATH_GPGME instead to use GPGME_CFLAGS and GPGME_LIBS)dnl + AC_REQUIRE(_AM_PATH_GPGME_CONFIG)dnl tmp=ifelse($1, ,1:0.4.2,$1) if echo "$tmp" | grep ':' >/dev/null 2>/dev/null ; then req_gpgme_api=`echo "$tmp" | sed 's/\(.*\):\(.*\)/\1/'` @@ -183,35 +273,37 @@ AC_MSG_CHECKING(for GPGME pthread - version >= $min_gpgme_version) ok=no if test "$GPGME_CONFIG" != "no" ; then - if `$GPGME_CONFIG --thread=pthread 2> /dev/null` ; then - req_major=`echo $min_gpgme_version | \ + req_major=`echo $min_gpgme_version | \ sed 's/\(0-9*\)\.\(0-9*\)\.\(0-9*\)/\1/'` - req_minor=`echo $min_gpgme_version | \ + req_minor=`echo $min_gpgme_version | \ sed 's/\(0-9*\)\.\(0-9*\)\.\(0-9*\)/\2/'` - req_micro=`echo $min_gpgme_version | \ + req_micro=`echo $min_gpgme_version | \ sed 's/\(0-9*\)\.\(0-9*\)\.\(0-9*\)/\3/'` - if test "$gpgme_version_major" -gt "$req_major"; then + if test "$gpgme_version_major" -gt "$req_major"; then ok=yes - else + else if test "$gpgme_version_major" -eq "$req_major"; then - if test "$gpgme_version_minor" -gt "$req_minor"; then - ok=yes - else - if test "$gpgme_version_minor" -eq "$req_minor"; then - if test "$gpgme_version_micro" -ge "$req_micro"; then - ok=yes - fi + if test "$gpgme_version_minor" -gt "$req_minor"; then + ok=yes + else + if test "$gpgme_version_minor" -eq "$req_minor"; then + if test "$gpgme_version_micro" -ge "$req_micro"; then + ok=yes + fi + fi fi - fi fi - fi fi fi if test $ok = yes; then # If we have a recent GPGME, we should also check that the # API is compatible. if test "$req_gpgme_api" -gt 0 ; then - tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + if test -z "$use_gpgrt_config"; then + tmp=`$GPGME_CONFIG --api-version 2>/dev/null || echo 0` + else + tmp=`$GPGME_CONFIG --variable=api_version 2>/dev/null || echo 0` + fi if test "$tmp" -gt 0 ; then if test "$req_gpgme_api" -ne "$tmp" ; then ok=no @@ -220,8 +312,8 @@ fi fi if test $ok = yes; then - GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --thread=pthread --cflags` - GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --thread=pthread --libs` + GPGME_PTHREAD_CFLAGS=`$GPGME_CONFIG --cflags` + GPGME_PTHREAD_LIBS=`$GPGME_CONFIG --libs` AC_MSG_RESULT(yes) ifelse($2, , :, $2) _AM_PATH_GPGME_CONFIG_HOST_CHECK
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/gpgme.pc.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/gpgme.pc.in
Changed
@@ -9,6 +9,6 @@ Description: GnuPG Made Easy to access GnuPG Requires.private: gpg-error, libassuan Version: @PACKAGE_VERSION@ -Cflags: -I${includedir} @GPGME_CONFIG_CFLAGS@ -Libs: -L${libdir} @GPGME_CONFIG_LIBS@ +Cflags: @GPGME_CONFIG_CFLAGS@ +Libs: @GPGME_CONFIG_LIBS@ URL: https://www.gnupg.org/software/gpgme/index.html
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/import.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/import.c
Changed
@@ -129,7 +129,7 @@ gpg_err_set_errno (0); nr = strtol (args, &tail, 0); - if (errno || args == tail || *tail != ' ') + if (errno || args == tail) { /* The crypto backend does not behave. */ free (import); @@ -173,12 +173,17 @@ if (tail) *tail = '\0'; - import->fpr = strdup (args); - if (!import->fpr) + if (*args) { - free (import); - return gpg_error_from_syserror (); + import->fpr = strdup (args); + if (!import->fpr) + { + free (import); + return gpg_error_from_syserror (); + } } + else + import->fpr = NULL; *import_status = import; return 0; @@ -266,8 +271,8 @@ } -static gpgme_error_t -import_status_handler (void *priv, gpgme_status_code_t code, char *args) +gpgme_error_t +_gpgme_import_status_handler (void *priv, gpgme_status_code_t code, char *args) { gpgme_ctx_t ctx = (gpgme_ctx_t) priv; gpgme_error_t err; @@ -311,28 +316,42 @@ } -static gpgme_error_t -_gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata) +gpgme_error_t +_gpgme_op_import_init_result (gpgme_ctx_t ctx) { gpgme_error_t err; void *hook; op_data_t opd; - err = _gpgme_op_reset (ctx, synchronous); - if (err) - return err; - err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook, sizeof (*opd), release_op_data); opd = hook; if (err) return err; + opd->lastp = &opd->result.imports; + return 0; +} + + +static gpgme_error_t +_gpgme_op_import_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t keydata) +{ + gpgme_error_t err; + + err = _gpgme_op_reset (ctx, synchronous); + if (err) + return err; + + err = _gpgme_op_import_init_result (ctx); + if (err) + return err; if (!keydata) return gpg_error (GPG_ERR_NO_DATA); - _gpgme_engine_set_status_handler (ctx->engine, import_status_handler, ctx); + _gpgme_engine_set_status_handler (ctx->engine, _gpgme_import_status_handler, + ctx); return _gpgme_engine_op_import (ctx->engine, keydata, NULL, NULL, ctx->import_filter, ctx->key_origin); @@ -380,20 +399,15 @@ gpgme_key_t *keys) { gpgme_error_t err; - void *hook; - op_data_t opd; int idx, firstidx, nkeys; err = _gpgme_op_reset (ctx, synchronous); if (err) return err; - err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook, - sizeof (*opd), release_op_data); - opd = hook; + err = _gpgme_op_import_init_result (ctx); if (err) return err; - opd->lastp = &opd->result.imports; if (!keys) return gpg_error (GPG_ERR_NO_DATA); @@ -416,7 +430,8 @@ if (!nkeys) return gpg_error (GPG_ERR_NO_DATA); - _gpgme_engine_set_status_handler (ctx->engine, import_status_handler, ctx); + _gpgme_engine_set_status_handler (ctx->engine, _gpgme_import_status_handler, + ctx); return _gpgme_engine_op_import (ctx->engine, NULL, keys, NULL, ctx->import_filter, ctx->key_origin); @@ -496,24 +511,20 @@ _gpgme_op_receive_keys_start (gpgme_ctx_t ctx, int synchronous, const char *keyids) { gpgme_error_t err; - void *hook; - op_data_t opd; err = _gpgme_op_reset (ctx, synchronous); if (err) return err; - err = _gpgme_op_data_lookup (ctx, OPDATA_IMPORT, &hook, - sizeof (*opd), release_op_data); - opd = hook; + err = _gpgme_op_import_init_result (ctx); if (err) return err; - opd->lastp = &opd->result.imports; if (!keyids || !*keyids) return gpg_error (GPG_ERR_NO_DATA); - _gpgme_engine_set_status_handler (ctx->engine, import_status_handler, ctx); + _gpgme_engine_set_status_handler (ctx->engine, _gpgme_import_status_handler, + ctx); return _gpgme_engine_op_import (ctx->engine, NULL, NULL, keyids, ctx->import_filter, ctx->key_origin);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/keylist.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/keylist.c
Changed
@@ -146,6 +146,12 @@ err = 0; break; + case GPGME_STATUS_IMPORT_OK: + case GPGME_STATUS_IMPORT_PROBLEM: + case GPGME_STATUS_IMPORT_RES: + err = _gpgme_import_status_handler (priv, code, args); + break; + default: break; } @@ -281,6 +287,18 @@ subkey->can_authenticate = 1; break; + case 'r': + subkey->can_renc = 1; + break; + + case 't': + subkey->can_timestamp = 1; + break; + + case 'g': + subkey->is_group_owned = 1; + break; + case 'q': subkey->is_qualified = 1; break; @@ -417,6 +435,7 @@ { /* Fields starts with a hex digit; thus it is a serial number. */ key->secret = 1; + subkey->secret = 1; subkey->is_cardkey = 1; subkey->card_number = strdup (field); if (!subkey->card_number) @@ -1125,6 +1144,10 @@ if (err) return TRACE_ERR (err); + err = _gpgme_op_import_init_result (ctx); + if (err) + return TRACE_ERR (err); + _gpgme_engine_set_status_handler (ctx->engine, keylist_status_handler, ctx); err = _gpgme_engine_set_colon_line_handler (ctx->engine, @@ -1169,6 +1192,10 @@ if (err) return TRACE_ERR (err); + err = _gpgme_op_import_init_result (ctx); + if (err) + return TRACE_ERR (err); + _gpgme_engine_set_status_handler (ctx->engine, keylist_status_handler, ctx); err = _gpgme_engine_set_colon_line_handler (ctx->engine, keylist_colon_handler, ctx); @@ -1210,13 +1237,17 @@ if (err) return TRACE_ERR (err); + err = _gpgme_op_import_init_result (ctx); + if (err) + return TRACE_ERR (err); + _gpgme_engine_set_status_handler (ctx->engine, keylist_status_handler, ctx); err = _gpgme_engine_set_colon_line_handler (ctx->engine, keylist_colon_handler, ctx); if (err) return TRACE_ERR (err); - err = _gpgme_engine_op_keylist_data (ctx->engine, data); + err = _gpgme_engine_op_keylist_data (ctx->engine, ctx->keylist_mode, data); return TRACE_ERR (err); }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/libgpgme.vers -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/libgpgme.vers
Changed
@@ -282,6 +282,9 @@ gpgme_op_receive_keys; gpgme_op_receive_keys_start; + gpgme_op_verify_ext; + gpgme_op_verify_ext_start; + local: *;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/ops.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/ops.h
Changed
@@ -192,4 +192,16 @@ int type, int pkflags, int len, char *data); + +/* From import.c. */ + +/* Create an initial op data object for import. Needs to be called + once before calling _gpgme_import_status_handler. */ +gpgme_error_t _gpgme_op_import_init_result (gpgme_ctx_t ctx); + +/* Process a status line for import operations. */ +gpgme_error_t _gpgme_import_status_handler (void *priv, + gpgme_status_code_t code, + char *args); + #endif /* OPS_H */
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/parsetlv.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/parsetlv.c
Changed
@@ -98,6 +98,9 @@ ti->length = len; } + if (ti->length > ti->nhdr && (ti->nhdr + ti->length) < ti->length) + return -1; /* Integer overflow. */ + *buffer = (void*)buf; *size = length; return 0;
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/posix-io.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/posix-io.c
Changed
@@ -54,11 +54,18 @@ # include <dirent.h> #endif /*USE_LINUX_GETDENTS*/ +#ifdef HAVE_POLL_H +# include <poll.h> +#else +# ifdef HAVE_SYS_SELECT_H +# include <sys/select.h> +# endif +#endif +#include <sys/socket.h> #include "util.h" #include "priv-io.h" #include "sema.h" -#include "ath.h" #include "debug.h" @@ -178,7 +185,7 @@ do { - nread = _gpgme_ath_read (fd, buffer, count); + nread = read (fd, buffer, count); } while (nread == -1 && errno == EINTR); @@ -197,7 +204,7 @@ do { - nwritten = _gpgme_ath_write (fd, buffer, count); + nwritten = write (fd, buffer, count); } while (nwritten == -1 && errno == EINTR); @@ -490,7 +497,7 @@ *r_status = 0; *r_signal = 0; do - ret = _gpgme_ath_waitpid (pid, &status, hang? 0 : WNOHANG); + ret = waitpid (pid, &status, hang? 0 : WNOHANG); while (ret == (pid_t)(-1) && errno == EINTR); if (ret == pid) @@ -869,8 +876,7 @@ do { - count = _gpgme_ath_select (max_fd + 1, &readfds, &writefds, NULL, - &timeout); + count = select (max_fd + 1, &readfds, &writefds, NULL, &timeout); } while (count < 0 && errno == EINTR); if (count < 0) @@ -946,7 +952,7 @@ do { - nread = _gpgme_ath_recvmsg (fd, msg, flags); + nread = recvmsg (fd, msg, flags); } while (nread == -1 && errno == EINTR); saved_errno = errno; @@ -996,7 +1002,7 @@ do { - nwritten = _gpgme_ath_sendmsg (fd, msg, flags); + nwritten = sendmsg (fd, msg, flags); } while (nwritten == -1 && errno == EINTR); return TRACE_SYSRES (nwritten); @@ -1041,7 +1047,7 @@ "fd=%d addr=%p addrlen=%i", fd, addr, addrlen); do - res = ath_connect (fd, addr, addrlen); + res = connect (fd, addr, addrlen); while (res == -1 && errno == EINTR); return TRACE_SYSRES (res);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/posix-util.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/posix-util.c
Changed
@@ -79,6 +79,15 @@ return 0; } +/* Dummy function - see w32-util.c for the actual code. */ +int +_gpgme_set_get_inst_type (const char *value) +{ + (void)value; + return 0; /* Posix installation type is fixed. */ +} + + /* Find an executable program in the colon seperated paths. */ static char * walk_path_str (const char *path_str, const char *pgm) @@ -135,7 +144,8 @@ /* On apple, especially when started through gpgme-json via the browser interface we should look into some additional fallback paths. */ - const char *additional_path = "/usr/local/bin:/usr/local/MacGPG2/bin"; + const char *additional_path + = "/usr/local/bin:/usr/local/MacGPG2/bin:/opt/homebrew/bin"; if (!ret) { ret = walk_path_str (additional_path, pgm);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/sign.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/sign.c
Changed
@@ -251,7 +251,16 @@ } args = tail; + /* strtol has been used wrongly here. We can't change this anymore + * but we now take care of the 0x1f class which would otherwise let + * us run into an error. */ sig->sig_class = strtol (args, &tail, 0); + if (!errno && args != tail && sig->sig_class == 1 + && (*tail == 'F' || *tail == 'f')) + { + tail++; + sig->sig_class = 131; /* Arbitrary unused value in rfc4880. */ + } sig->class = sig->sig_class; sig->_obsolete_class = sig->sig_class; if (errno || args == tail || *tail != ' ') @@ -422,7 +431,7 @@ static gpgme_error_t sign_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t plain, - gpgme_data_t sig, gpgme_sig_mode_t mode) + gpgme_data_t sig, gpgme_sig_mode_t flags) { gpgme_error_t err; @@ -437,8 +446,9 @@ if (err) return err; - if (mode != GPGME_SIG_MODE_NORMAL && mode != GPGME_SIG_MODE_DETACH - && mode != GPGME_SIG_MODE_CLEAR) + if (flags & ~(GPGME_SIG_MODE_DETACH + |GPGME_SIG_MODE_CLEAR + |GPGME_SIG_MODE_ARCHIVE)) return gpg_error (GPG_ERR_INV_VALUE); if (!plain) @@ -457,7 +467,7 @@ _gpgme_engine_set_status_handler (ctx->engine, sign_status_handler, ctx); - return _gpgme_engine_op_sign (ctx->engine, plain, sig, mode, ctx->use_armor, + return _gpgme_engine_op_sign (ctx->engine, plain, sig, flags, ctx->use_armor, ctx->use_textmode, ctx->include_certs, ctx /* FIXME */); } @@ -466,16 +476,16 @@ /* Sign the plaintext PLAIN and store the signature in SIG. */ gpgme_error_t gpgme_op_sign_start (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, - gpgme_sig_mode_t mode) + gpgme_sig_mode_t flags) { gpg_error_t err; TRACE_BEG (DEBUG_CTX, "gpgme_op_sign_start", ctx, - "plain=%p, sig=%p, mode=%i", plain, sig, mode); + "plain=%p, sig=%p, flags=%i", plain, sig, flags); if (!ctx) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - err = sign_start (ctx, 0, plain, sig, mode); + err = sign_start (ctx, 0, plain, sig, flags); return TRACE_ERR (err); } @@ -483,17 +493,17 @@ /* Sign the plaintext PLAIN and store the signature in SIG. */ gpgme_error_t gpgme_op_sign (gpgme_ctx_t ctx, gpgme_data_t plain, gpgme_data_t sig, - gpgme_sig_mode_t mode) + gpgme_sig_mode_t flags) { gpgme_error_t err; TRACE_BEG (DEBUG_CTX, "gpgme_op_sign", ctx, - "plain=%p, sig=%p, mode=%i", plain, sig, mode); + "plain=%p, sig=%p, flags=%i", plain, sig, flags); if (!ctx) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - err = sign_start (ctx, 1, plain, sig, mode); + err = sign_start (ctx, 1, plain, sig, flags); if (!err) err = _gpgme_wait_one (ctx); return TRACE_ERR (err);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/sys-util.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/sys-util.h
Changed
@@ -24,6 +24,7 @@ int _gpgme_set_default_gpg_name (const char *name); int _gpgme_set_default_gpgconf_name (const char *name); int _gpgme_set_override_inst_dir (const char *dir); +int _gpgme_set_get_inst_type (const char *value); char *_gpgme_get_gpg_path (void); char *_gpgme_get_gpgconf_path (void);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/util.h -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/util.h
Changed
@@ -35,6 +35,8 @@ #ifdef HAVE_UNISTD_H # include <unistd.h> #endif +#include <stdint.h> + #include "gpgme.h" @@ -56,6 +58,7 @@ const char *_gpgme_get_default_gpgsm_name (void); const char *_gpgme_get_default_g13_name (void); const char *_gpgme_get_default_gpgconf_name (void); +const char *_gpgme_get_default_gpgtar_name (void); const char *_gpgme_get_default_uisrv_socket (void); int _gpgme_in_gpg_one_mode (void); @@ -142,7 +145,7 @@ gpgme_error_t _gpgme_strtoul_field (const char *string, unsigned long *result); /* Convert STRING into an offset value similar to atoi(). */ -gpgme_off_t _gpgme_string_to_off (const char *string); +uint64_t _gpgme_string_to_off (const char *string); /* Parse the string TIMESTAMP into a time_t. The string may either be seconds since Epoch or in the ISO 8601 format like
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/verify.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/verify.c
Changed
@@ -1135,8 +1135,9 @@ static gpgme_error_t -verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_data_t sig, - gpgme_data_t signed_text, gpgme_data_t plaintext) +verify_start (gpgme_ctx_t ctx, int synchronous, gpgme_verify_flags_t flags, + gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) { gpgme_error_t err; @@ -1153,26 +1154,45 @@ if (!sig) return gpg_error (GPG_ERR_NO_DATA); - return _gpgme_engine_op_verify (ctx->engine, sig, signed_text, plaintext, - ctx); + return _gpgme_engine_op_verify (ctx->engine, flags, sig, signed_text, + plaintext, ctx); } -/* Decrypt ciphertext CIPHER and make a signature verification within - CTX and store the resulting plaintext in PLAIN. */ +/* Old version of gpgme_op_verify_ext_start without FLAGS. */ gpgme_error_t gpgme_op_verify_start (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, gpgme_data_t plaintext) { + return gpgme_op_verify_ext_start (ctx, 0, sig, signed_text, plaintext); +} + + +/* Old version of gpgme_op_verify_ext without FLAGS. */ +gpgme_error_t +gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) +{ + return gpgme_op_verify_ext (ctx, 0, sig, signed_text, plaintext); +} + + +/* Decrypt ciphertext CIPHER and make a signature verification within + CTX and store the resulting plaintext in PLAIN. */ +gpgme_error_t +gpgme_op_verify_ext_start (gpgme_ctx_t ctx, gpgme_verify_flags_t flags, + gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) +{ gpg_error_t err; TRACE_BEG (DEBUG_CTX, "gpgme_op_verify_start", ctx, - "sig=%p, signed_text=%p, plaintext=%p", - sig, signed_text, plaintext); + "flags=0x%x, sig=%p, signed_text=%p, plaintext=%p", + flags, sig, signed_text, plaintext); if (!ctx) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - err = verify_start (ctx, 0, sig, signed_text, plaintext); + err = verify_start (ctx, 0, flags, sig, signed_text, plaintext); return TRACE_ERR (err); } @@ -1180,19 +1200,20 @@ /* Decrypt ciphertext CIPHER and make a signature verification within CTX and store the resulting plaintext in PLAIN. */ gpgme_error_t -gpgme_op_verify (gpgme_ctx_t ctx, gpgme_data_t sig, gpgme_data_t signed_text, - gpgme_data_t plaintext) +gpgme_op_verify_ext (gpgme_ctx_t ctx, gpgme_verify_flags_t flags, + gpgme_data_t sig, gpgme_data_t signed_text, + gpgme_data_t plaintext) { gpgme_error_t err; TRACE_BEG (DEBUG_CTX, "gpgme_op_verify", ctx, - "sig=%p, signed_text=%p, plaintext=%p", - sig, signed_text, plaintext); + "flags=0x%x, sig=%p, signed_text=%p, plaintext=%p", + flags, sig, signed_text, plaintext); if (!ctx) return TRACE_ERR (gpg_error (GPG_ERR_INV_VALUE)); - err = verify_start (ctx, 1, sig, signed_text, plaintext); + err = verify_start (ctx, 1, flags, sig, signed_text, plaintext); if (!err) err = _gpgme_wait_one (ctx); return TRACE_ERR (err);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/version.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/version.c
Changed
@@ -72,6 +72,9 @@ WSAStartup (0x202, &wsadat); } + + /* We want gpgrt's gettext to always output UTF-8. */ + gettext_use_utf8 (1); #endif _gpgme_debug_subsystem_init ();
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/versioninfo.rc.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/versioninfo.rc.in
Changed
@@ -39,7 +39,7 @@ VALUE "FileDescription", "GPGME - GnuPG Made Easy\0" VALUE "FileVersion", "@LIBGPGME_LT_CURRENT@.@LIBGPGME_LT_AGE@.@LIBGPGME_LT_REVISION@.@BUILD_REVISION@\0" VALUE "InternalName", "gpgme\0" - VALUE "LegalCopyright", "Copyright © 2001-2021 g10 Code GmbH\0" + VALUE "LegalCopyright", "Copyright © 2001-2023 g10 Code GmbH\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename", "gpgme.dll\0" VALUE "PrivateBuild", "\0"
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/src/w32-util.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/src/w32-util.c
Changed
@@ -83,6 +83,17 @@ # define GNUPG_REGKEY_3 "Software\\GnuPG" #endif +/* Installation type constants. */ +#define INST_TYPE_GPG4WIN 1 +#define INST_TYPE_GPGDESK 2 + +/* Relative name parts for different installation types. */ +#define INST_TYPE_GPG4WIN_DIR "\\..\\..\\GnuPG\\bin" +#define INST_TYPE_GPGDESK_DIR "\\..\\GnuPG\\bin" + + + + DEFINE_STATIC_LOCK (get_path_lock); /* The module handle of this DLL. If we are linked statically, @@ -536,6 +547,27 @@ } +/* Used by gpgme_set_global_flag to set the installation type. + * VALUE is a string interpreted as integer with this meaning: + * 0 = standard + * 1 = Gpg4win 4 style (INST_TYPE_GPG4WIN) + * 2 = GnuPG (VS-)Desktop style (INST_TYPE_GPGDESK) + * If VALUE is NULL, nothing is changed. The return value is the + * previous value. + */ +int +_gpgme_set_get_inst_type (const char *value) +{ + static int inst_type; + int previous_type; + + previous_type = inst_type; + if (value) + inst_type = atoi (value); + return previous_type; +} + + /* Return the full file name of the GPG binary. This function is used iff gpgconf was not found and thus it can be assumed that gpg2 is not installed. This function is only called by get_gpgconf_item @@ -586,6 +618,33 @@ } +/* Helper for _gpgme_get_gpgconf_path. */ +static char * +find_version_file (const char *inst_dir) +{ + char *fname; + + fname = _gpgme_strconcat (inst_dir, "\\..\\", "VERSION.sig", NULL); + if (fname && !_gpgme_access (fname, F_OK)) + { + fnamestrlen(fname)-4 = 0; + if (!_gpgme_access (fname, F_OK)) + return fname; + } + free (fname); + /* Check the case that a binary in gnupg/bin uses libgpgme. */ + fname = _gpgme_strconcat (inst_dir, "\\..\\..\\", "VERSION.sig", NULL); + if (fname && !_gpgme_access (fname, F_OK)) + { + fnamestrlen(fname)-4 = 0; + if (!_gpgme_access (fname, F_OK)) + return fname; + } + free (fname); + return NULL; +} + + /* This function is only called by get_gpgconf_item and may not be called concurrently. */ char * @@ -593,12 +652,53 @@ { char *gpgconf = NULL; const char *inst_dir, *name; + int inst_type; + char *dir = NULL; name = default_gpgconf_name? get_basename(default_gpgconf_name):"gpgconf.exe"; - /* 1. Try to find gpgconf.exe in the installation directory of gpgme. */ inst_dir = _gpgme_get_inst_dir (); - if (inst_dir) + inst_type = _gpgme_set_get_inst_type (NULL); + + /* 0.0. If no installation type has been explicitly requested guess + * one by looking at files used by the installation type. */ + if (inst_dir && !inst_type) + { + gpgrt_stream_t fp; + char buffer128; + int n; + + free (dir); + dir = find_version_file (inst_dir); + if (dir && (fp = gpgrt_fopen (dir, "r"))) + { + n = gpgrt_fread (buffer, 1, 128, fp); + if (n > 10) + { + buffern-1 = 0; + if (strstr (buffer, "GnuPG") && strstr (buffer, "Desktop")) + inst_type = INST_TYPE_GPGDESK; + } + gpgrt_fclose (fp); + } + } + + /* 0.1. If an installation type was requested or guessed try to find + * gpgconf.exe depending on that installation type. */ + if (inst_dir + && (inst_type == INST_TYPE_GPG4WIN || inst_type == INST_TYPE_GPGDESK)) + { + free (dir); + dir = _gpgme_strconcat + (inst_dir, + inst_type == INST_TYPE_GPG4WIN? INST_TYPE_GPG4WIN_DIR + /* */ : INST_TYPE_GPGDESK_DIR, + NULL); + gpgconf = find_program_in_dir (dir, name); + } + + /* 1. Try to find gpgconf.exe in the installation directory of gpgme. */ + if (!gpgconf && inst_dir) { gpgconf = find_program_in_dir (inst_dir, name); } @@ -614,8 +714,7 @@ /* 3. Try to find gpgconf.exe using the Windows registry. */ if (!gpgconf) { - char *dir; - + free (dir); dir = read_w32_registry_string (NULL, GNUPG_REGKEY_2, "Install Directory"); @@ -633,10 +732,7 @@ } } if (dir) - { - gpgconf = find_program_in_dir (dir, name); - free (dir); - } + gpgconf = find_program_in_dir (dir, name); } /* 4. Try to find gpgconf.exe from Gpg4win below CSIDL_PROGRAM_FILES. */ @@ -645,19 +741,28 @@ gpgconf = find_program_at_standard_place ("GNU\\GnuPG\\gpgconf.exe"); } - /* 5. Try to find gpgconf.exe relative to us. */ + /* 5. Try to find gpgconf.exe relative to us as Gpg4win installs it. */ if (!gpgconf && inst_dir) { - char *dir = _gpgme_strconcat (inst_dir, "\\..\\..\\GnuPG\\bin", NULL); + free (dir); + dir = _gpgme_strconcat (inst_dir, INST_TYPE_GPG4WIN_DIR, NULL); gpgconf = find_program_in_dir (dir, name); + } + + /* 6. Try to find gpgconf.exe relative to us as GnuPG VSD installs it. */ + if (!gpgconf && inst_dir) + { free (dir); + dir = _gpgme_strconcat (inst_dir, INST_TYPE_GPGDESK_DIR, NULL); + gpgconf = find_program_in_dir (dir, name); } - /* 5. Print a debug message if not found. */ + /* Print a debug message if not found. */ if (!gpgconf) _gpgme_debug (NULL, DEBUG_ENGINE, -1, NULL, NULL, NULL, "_gpgme_get_gpgconf_path: '%s' not found",name); + free (dir); return gpgconf; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/Makefile.in
Changed
@@ -119,6 +119,7 @@ subdir = tests ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -127,8 +128,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ @@ -404,10 +406,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -417,6 +424,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/Makefile.am
Changed
@@ -61,7 +61,7 @@ pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ cipher-3.asc cipher-no-sig.asc \ geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys) \ - gpg.conf.in + gpg.conf.in ownertrust.txt BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \ gpg-sample.stamp @@ -99,15 +99,18 @@ -$(TESTS_ENVIRONMENT) gpgconf --kill all $(MKDIR_P) ./private-keys-v1.d for k in $(private_keys); do \ - cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \ - done + cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \ + done echo x > ./gpg-sample.stamp pubring-stamp: $(srcdir)/pubdemo.asc gpg-sample.stamp $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ - --import $(srcdir)/pubdemo.asc + --import $(srcdir)/pubdemo.asc -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(srcdir)/secdemo.asc + -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ + --import-ownertrust $(srcdir)/ownertrust.txt + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo x > ./pubring-stamp gpg.conf: $(srcdir)/gpg.conf.in
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/Makefile.in
Changed
@@ -114,6 +114,7 @@ subdir = tests/gpg ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -122,8 +123,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ @@ -423,10 +425,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -436,6 +443,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -606,7 +614,7 @@ pubdemo.asc secdemo.asc cipher-1.asc cipher-2.asc \ cipher-3.asc cipher-no-sig.asc \ geheim.txt pubkey-1.asc seckey-1.asc pinentry $(private_keys) \ - gpg.conf.in + gpg.conf.in ownertrust.txt BUILT_SOURCES = gpg.conf gpg-agent.conf pubring-stamp \ gpg-sample.stamp @@ -1274,15 +1282,18 @@ -$(TESTS_ENVIRONMENT) gpgconf --kill all $(MKDIR_P) ./private-keys-v1.d for k in $(private_keys); do \ - cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \ - done + cp $(srcdir)/$$k private-keys-v1.d/$$k.key; \ + done echo x > ./gpg-sample.stamp pubring-stamp: $(srcdir)/pubdemo.asc gpg-sample.stamp $(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ - --import $(srcdir)/pubdemo.asc + --import $(srcdir)/pubdemo.asc -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(srcdir)/secdemo.asc + -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ + --import-ownertrust $(srcdir)/ownertrust.txt + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo x > ./pubring-stamp gpg.conf: $(srcdir)/gpg.conf.in
View file
_service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/ownertrust.txt
Added
@@ -0,0 +1,3 @@ +# List of assigned trustvalues, created Mi 08 Feb 2023 09:52:04 CET +# (Use "gpg --import-ownertrust" to restore them) +A0FF4590BB6122EDEF6E3C542D727CC768697734:6:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-decrypt-verify.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-decrypt-verify.c
Changed
@@ -36,9 +36,19 @@ #include "t-support.h"  +static const char normal_signed_message = +"-----BEGIN PGP MESSAGE-----\n" +"\n" +"owGbwMvMwCSoW1RzPCOz3IRxjXQSR0lqcYleSUWJTZOvjVdpcYmCu1+oQmaJIleH\n" +"GwuDIBMDGysTSIqBi1MApi+nlGGuwDeHao53HBr+FoVGP3xX+kvuu9fCMJvl6IOf\n" +"y1kvP4y+8D5a11ang0udywsA\n" +"=Crq6\n" +"-----END PGP MESSAGE-----\n"; + + static void check_verify_result (gpgme_verify_result_t result, unsigned int summary, - const char *fpr, gpgme_error_t status) + const char *fpr, gpgme_error_t status, int validity) { gpgme_signature_t sig; @@ -79,10 +89,11 @@ __FILE__, __LINE__); exit (1); } - if (sig->validity != GPGME_VALIDITY_UNKNOWN) + if (sig->validity != validity) { - fprintf (stderr, "%s:%i: Unexpected validity: %i\n", - __FILE__, __LINE__, sig->validity); + fprintf (stderr, "%s:%i: Unexpected validity: " + "want=%i have=%i\n", + __FILE__, __LINE__, validity, sig->validity); exit (1); } if (gpgme_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR) @@ -134,12 +145,33 @@ } print_data (out); verify_result = gpgme_op_verify_result (ctx); - check_verify_result (verify_result, 0, + check_verify_result (verify_result, GPGME_SIGSUM_VALID|GPGME_SIGSUM_GREEN, "A0FF4590BB6122EDEF6E3C542D727CC768697734", - GPG_ERR_NO_ERROR); + GPG_ERR_NO_ERROR, GPGME_VALIDITY_FULL); gpgme_data_release (in); gpgme_data_release (out); + + /* Checking a signed, but not encrypted message. */ + err = gpgme_data_new_from_mem (&in, normal_signed_message, strlen (normal_signed_message), 0); + fail_if_err (err); + err = gpgme_data_new (&out); + fail_if_err (err); + err = gpgme_op_decrypt_verify (ctx, in, out); + /* should have returned "no data" because the message is not encrypted */ + if (gpgme_err_code (err) != GPG_ERR_NO_DATA) + { + fprintf (stderr, "%s:%i: Unexpected result of gpgme_op_decrypt_verify: %s\n", + __FILE__, __LINE__, gpgme_strerror (err)); + } + verify_result = gpgme_op_verify_result (ctx); + check_verify_result (verify_result, GPGME_SIGSUM_VALID|GPGME_SIGSUM_GREEN, + "A0FF4590BB6122EDEF6E3C542D727CC768697734", + GPG_ERR_NO_ERROR, GPGME_VALIDITY_FULL); + + gpgme_data_release (in); + gpgme_data_release (out); + gpgme_release (ctx); return 0; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-edit-sign.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-edit-sign.c
Changed
@@ -39,6 +39,58 @@ #include "t-support.h" +static const char *test_key = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n" +"\n" +"mDMEY+NyJBYJKwYBBAHaRw8BAQdA4VfyC5sa6T3xVSus55LjyqQetFuE1shtu/71\n" +"pHLxg8W0KFNpZ24gbWUgKGRlbW8ga2V5KSA8c2lnbi1tZUBleGFtcGxlLm5ldD6I\n" +"kwQTFgoAOxYhBPPHuA+qbf/jPmLyYnJg+w/EtKy+BQJj43IkAhsDBQsJCAcCAiIC\n" +"BhUKCQgLAgQWAgMBAh4HAheAAAoJEHJg+w/EtKy+26gBAMhaI/lYA9BK35525kQT\n" +"OhvpQwgThJxQp8AOQk3UMgkGAP0ahV9lFXwv9ZnoeHEhjECsNpAFbj9fxBlzNmMZ\n" +"Z92+AA==\n" +"=Koy1\n" +"-----END PGP PUBLIC KEY BLOCK-----\n"; +static const char *test_key_fpr = "F3C7B80FAA6DFFE33E62F2627260FB0FC4B4ACBE"; + +static void +import_key (const char *keydata) +{ + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_data_t in; + + err = gpgme_new (&ctx); + fail_if_err (err); + + err = gpgme_data_new_from_mem (&in, keydata, strlen(keydata), 0); + fail_if_err (err); + + err = gpgme_op_import (ctx, in); + fail_if_err (err); + + gpgme_data_release (in); + gpgme_release (ctx); +} + +static void +delete_key (const char *fpr) +{ + gpgme_ctx_t ctx; + gpgme_error_t err; + gpgme_key_t key = NULL; + + err = gpgme_new (&ctx); + fail_if_err (err); + + err = gpgme_get_key (ctx, fpr, &key, 0); + fail_if_err (err); + + err = gpgme_op_delete_ext (ctx, key, GPGME_DELETE_FORCE); + fail_if_err (err); + + gpgme_key_unref (key); + gpgme_release (ctx); +} + static void flush_data (gpgme_data_t dh) { @@ -99,10 +151,8 @@ } if (result) - { - gpgme_io_writen (fd, result, strlen (result)); - gpgme_io_writen (fd, "\n", 1); - } + gpgme_io_writen (fd, result, strlen (result)); + gpgme_io_writen (fd, "\n", 1); return 0; } @@ -207,15 +257,16 @@ { const char *signer_fpr = "A0FF4590BB6122EDEF6E3C542D727CC768697734"; /* Alpha Test */ const char *signer_keyid = signer_fpr + strlen(signer_fpr) - 16; - const char *key_fpr = "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2"; /* Bravo Test */ (void)argc; (void)argv; init_gpgme (GPGME_PROTOCOL_OpenPGP); - sign_key (key_fpr, signer_fpr); - verify_key_signature (key_fpr, signer_keyid); + import_key (test_key); + sign_key (test_key_fpr, signer_fpr); + verify_key_signature (test_key_fpr, signer_keyid); + delete_key (test_key_fpr); return 0; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-import.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-import.c
Changed
@@ -269,6 +269,8 @@ exit (1); } + gpgme_key_unref (key); + gpgme_release (ctx); return 0; }
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-keylist-secret-sig.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-keylist-secret-sig.c
Changed
@@ -167,7 +167,7 @@ key->chain_id); exit (1); } - if (key->owner_trust != GPGME_VALIDITY_UNKNOWN) + if (key->owner_trust != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "Key has unexpected owner trust: %i\n", key->owner_trust); @@ -349,7 +349,7 @@ fprintf (stderr, "First user ID unexpectedly invalid\n"); exit (1); } - if (key->uids && key->uids->validity != GPGME_VALIDITY_UNKNOWN) + if (key->uids && key->uids->validity != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "First user ID has unexpectedly validity: %i\n", key->uids->validity); @@ -435,7 +435,7 @@ exit (1); } if (key->uids && key->uids->next - && key->uids->next->validity != GPGME_VALIDITY_UNKNOWN) + && key->uids->next->validity != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "Second user ID has unexpectedly validity: %i\n", key->uids->next->validity); @@ -526,7 +526,7 @@ exit (1); } if (key->uids && key->uids->next && key->uids->next->next - && key->uids->next->next->validity != GPGME_VALIDITY_UNKNOWN) + && key->uids->next->next->validity != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "Third user ID has unexpectedly validity: %i\n", key->uids->next->next->validity);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-keylist-sig.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-keylist-sig.c
Changed
@@ -167,7 +167,7 @@ key->chain_id); exit (1); } - if (key->owner_trust != GPGME_VALIDITY_UNKNOWN) + if (key->owner_trust != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "Key has unexpected owner trust: %i\n", key->owner_trust); @@ -349,7 +349,7 @@ fprintf (stderr, "First user ID unexpectedly invalid\n"); exit (1); } - if (key->uids && key->uids->validity != GPGME_VALIDITY_UNKNOWN) + if (key->uids && key->uids->validity != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "First user ID has unexpectedly validity: %i\n", key->uids->validity); @@ -435,7 +435,7 @@ exit (1); } if (key->uids && key->uids->next - && key->uids->next->validity != GPGME_VALIDITY_UNKNOWN) + && key->uids->next->validity != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "Second user ID has unexpectedly validity: %i\n", key->uids->next->validity); @@ -526,7 +526,7 @@ exit (1); } if (key->uids && key->uids->next && key->uids->next->next - && key->uids->next->next->validity != GPGME_VALIDITY_UNKNOWN) + && key->uids->next->next->validity != GPGME_VALIDITY_ULTIMATE) { fprintf (stderr, "Third user ID has unexpectedly validity: %i\n", key->uids->next->next->validity);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-keylist.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-keylist.c
Changed
@@ -43,8 +43,10 @@ const char *name; const char *comment; const char *email; + gpgme_validity_t validity; } uid3; int n_subkeys; + gpgme_validity_t owner_trust; void (*misc_check)(struct key_info_s *keyinfo, gpgme_key_t key); }; @@ -56,9 +58,12 @@ struct key_info_s keys = { { "A0FF4590BB6122EDEF6E3C542D727CC768697734", "6AE6D7EE46A871F8", - { { "Alfa Test", "demo key", "alfa@example.net" }, - { "Alpha Test", "demo key", "alpha@example.net" }, - { "Alice", "demo key", NULL } }, 1 }, + { { "Alfa Test", "demo key", "alfa@example.net", + GPGME_VALIDITY_ULTIMATE }, + { "Alpha Test", "demo key", "alpha@example.net", + GPGME_VALIDITY_ULTIMATE }, + { "Alice", "demo key", NULL, GPGME_VALIDITY_ULTIMATE } }, 1, + GPGME_VALIDITY_ULTIMATE }, { "D695676BDCEDCC2CDD6152BCFE180B1DA9E3B0B2", "5381EA4EE29BA37F", { { "Bob", "demo key", NULL }, { "Bravo Test", "demo key", "bravo@example.net" } }, 1 }, @@ -107,7 +112,7 @@ { { "Victor Test", "demo key", "victor@example.org" } }, 1 }, { "E8D6C90B683B0982BD557A99DEF0F7B8EC67DBDE", "D7FBB421FD6E27F6", { { "Whisky Test", "demo key", "whisky@example.net" } }, 3, - check_whisky }, + GPGME_VALIDITY_UNKNOWN, check_whisky }, { "04C1DF62EFA0EBB00519B06A8979A6C5567FB34A", "5CC6F87F41E408BE", { { "XRay Test", "demo key", "xray@example.net" } }, 1 }, { "ED9B316F78644A58D042655A9EEF34CD4B11B25F", "5ADFD255F7B080AD", @@ -219,10 +224,10 @@ key->chain_id); exit (1); } - if (key->owner_trust != GPGME_VALIDITY_UNKNOWN) + if (key->owner_trust != keysi.owner_trust) { - fprintf (stderr, "Key has unexpected owner trust: %i\n", - key->owner_trust); + fprintf (stderr, "Key `%s' has unexpected owner trust: %i\n", + keysi.uid0.name, key->owner_trust); exit (1); } @@ -426,10 +431,10 @@ fprintf (stderr, "First user ID unexpectedly invalid\n"); exit (1); } - if (key->uids && key->uids->validity != GPGME_VALIDITY_UNKNOWN) + if (key->uids && key->uids->validity != keysi.uid0.validity) { - fprintf (stderr, "First user ID has unexpectedly validity: %i\n", - key->uids->validity); + fprintf (stderr, "First user ID `%s' has unexpectedly validity: %i\n", + key->uids->name, key->uids->validity); exit (1); } if (key->uids && key->uids->signatures) @@ -469,7 +474,7 @@ exit (1); } if (key->uids && key->uids->next - && key->uids->next->validity != GPGME_VALIDITY_UNKNOWN) + && key->uids->next->validity != keysi.uid1.validity) { fprintf (stderr, "Second user ID has unexpectedly validity: %i\n", key->uids->next->validity); @@ -514,7 +519,7 @@ exit (1); } if (key->uids && key->uids->next && key->uids->next->next - && key->uids->next->next->validity != GPGME_VALIDITY_UNKNOWN) + && key->uids->next->next->validity != keysi.uid2.validity) { fprintf (stderr, "Third user ID has unexpectedly validity: %i\n", key->uids->next->next->validity);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpg/t-verify.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpg/t-verify.c
Changed
@@ -94,7 +94,7 @@ static void check_result (gpgme_verify_result_t result, int no_of_sigs, int skip_sigs, unsigned int summary, const char *fpr, - gpgme_error_t status, int notation) + gpgme_error_t status, int notation, int validity) { gpgme_signature_t sig; int n; @@ -206,10 +206,11 @@ PGM, __LINE__, skip_sigs); exit (1); } - if (sig->validity != GPGME_VALIDITY_UNKNOWN) + if (sig->validity != validity) { - fprintf (stderr, "%s:%i:sig-%d: Unexpected validity: %i\n", - PGM, __LINE__, skip_sigs, sig->validity); + fprintf (stderr, "%s:%i:sig-%d: Unexpected validity: " + "want=%i have=%i\n", + PGM, __LINE__, skip_sigs, validity, sig->validity); exit (1); } if (gpgme_err_code (sig->validity_reason) != GPG_ERR_NO_ERROR) @@ -247,8 +248,9 @@ err = gpgme_op_verify (ctx, sig, text, NULL); fail_if_err (err); result = gpgme_op_verify_result (ctx); - check_result (result, 1, 0, 0, "A0FF4590BB6122EDEF6E3C542D727CC768697734", - GPG_ERR_NO_ERROR, 1); + check_result (result, 1, 0, GPGME_SIGSUM_VALID|GPGME_SIGSUM_GREEN, + "A0FF4590BB6122EDEF6E3C542D727CC768697734", + GPG_ERR_NO_ERROR, 1, GPGME_VALIDITY_FULL); /* Checking a manipulated message. */ gpgme_data_release (text); @@ -259,9 +261,9 @@ fail_if_err (err); result = gpgme_op_verify_result (ctx); check_result (result, 1, 0, GPGME_SIGSUM_RED, "2D727CC768697734", - GPG_ERR_BAD_SIGNATURE, 0); + GPG_ERR_BAD_SIGNATURE, 0, GPGME_VALIDITY_UNKNOWN); - /* Checking a valid message. Bu that one has a second signature + /* Checking a valid message. But that one has a second signature * made by an unknown key. */ gpgme_data_release (text); gpgme_data_release (sig); @@ -273,12 +275,12 @@ err = gpgme_op_verify (ctx, sig, text, NULL); fail_if_err (err); result = gpgme_op_verify_result (ctx); - check_result (result, 2, 0, 0, + check_result (result, 2, 0, GPGME_SIGSUM_VALID|GPGME_SIGSUM_GREEN, "A0FF4590BB6122EDEF6E3C542D727CC768697734", - GPG_ERR_NO_ERROR, 1); + GPG_ERR_NO_ERROR, 1, GPGME_VALIDITY_FULL); check_result (result, 2, 1, GPGME_SIGSUM_KEY_MISSING, "36EC2A70C6426EB0FCE5BB4DF91C98F049D4204C", - GPG_ERR_NO_PUBKEY, 0); + GPG_ERR_NO_PUBKEY, 0, GPGME_VALIDITY_UNKNOWN); /* Checking a normal signature. */ @@ -291,8 +293,9 @@ err = gpgme_op_verify (ctx, sig, NULL, text); fail_if_err (err); result = gpgme_op_verify_result (ctx); - check_result (result, 1, 0, 0, "A0FF4590BB6122EDEF6E3C542D727CC768697734", - GPG_ERR_NO_ERROR, 0); + check_result (result, 1, 0, GPGME_SIGSUM_VALID|GPGME_SIGSUM_GREEN, + "A0FF4590BB6122EDEF6E3C542D727CC768697734", + GPG_ERR_NO_ERROR, 0, GPGME_VALIDITY_FULL); /* Checking an invalid message. */
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/gpgsm/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/gpgsm/Makefile.in
Changed
@@ -114,6 +114,7 @@ subdir = tests/gpgsm ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -122,8 +123,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ @@ -326,10 +328,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -339,6 +346,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/json/Makefile.am -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/json/Makefile.am
Changed
@@ -93,6 +93,7 @@ --import $(top_srcdir)/tests/gpg/pubdemo.asc -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(top_srcdir)/tests/gpg/secdemo.asc + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo x > ./pubring-stamp gpg.conf:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/json/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/json/Makefile.in
Changed
@@ -112,6 +112,7 @@ subdir = tests/json ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -120,8 +121,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) @@ -274,10 +276,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -287,6 +294,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ @@ -888,6 +896,7 @@ --import $(top_srcdir)/tests/gpg/pubdemo.asc -$(TESTS_ENVIRONMENT) $(GPG) --batch --no-permission-warning \ --import $(top_srcdir)/tests/gpg/secdemo.asc + -$(TESTS_ENVIRONMENT) gpgconf --kill all echo x > ./pubring-stamp gpg.conf:
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/opassuan/Makefile.in -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/opassuan/Makefile.in
Changed
@@ -112,6 +112,7 @@ subdir = tests/opassuan ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_cxx_compile_stdcxx.m4 \ + $(top_srcdir)/m4/ax_gcc_func_attribute.m4 \ $(top_srcdir)/m4/ax_pkg_swig.m4 \ $(top_srcdir)/m4/ax_python_devel.m4 \ $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/glibc21.m4 \ @@ -120,8 +121,9 @@ $(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \ $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/pkg.m4 \ - $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt.m4 \ - $(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/python.m4 $(top_srcdir)/m4/qt5.m4 \ + $(top_srcdir)/m4/qt6.m4 $(top_srcdir)/acinclude.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \ @@ -277,10 +279,15 @@ GPGME_CONFIG_CFLAGS = @GPGME_CONFIG_CFLAGS@ GPGME_CONFIG_HOST = @GPGME_CONFIG_HOST@ GPGME_CONFIG_LIBS = @GPGME_CONFIG_LIBS@ -GPGME_QTTEST_CFLAGS = @GPGME_QTTEST_CFLAGS@ -GPGME_QTTEST_LIBS = @GPGME_QTTEST_LIBS@ -GPGME_QT_CFLAGS = @GPGME_QT_CFLAGS@ -GPGME_QT_LIBS = @GPGME_QT_LIBS@ +GPGME_CPP_CFLAGS = @GPGME_CPP_CFLAGS@ +GPGME_QT5TEST_CFLAGS = @GPGME_QT5TEST_CFLAGS@ +GPGME_QT5TEST_LIBS = @GPGME_QT5TEST_LIBS@ +GPGME_QT5_CFLAGS = @GPGME_QT5_CFLAGS@ +GPGME_QT5_LIBS = @GPGME_QT5_LIBS@ +GPGME_QT6TEST_CFLAGS = @GPGME_QT6TEST_CFLAGS@ +GPGME_QT6TEST_LIBS = @GPGME_QT6TEST_LIBS@ +GPGME_QT6_CFLAGS = @GPGME_QT6_CFLAGS@ +GPGME_QT6_LIBS = @GPGME_QT6_LIBS@ GPGRT_CONFIG = @GPGRT_CONFIG@ GPG_ERROR_CFLAGS = @GPG_ERROR_CFLAGS@ GPG_ERROR_CONFIG = @GPG_ERROR_CONFIG@ @@ -290,6 +297,7 @@ GRAPHVIZ = @GRAPHVIZ@ GREP = @GREP@ HAVE_CXX11 = @HAVE_CXX11@ +HAVE_CXX17 = @HAVE_CXX17@ HAVE_DOT = @HAVE_DOT@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/run-decrypt.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/run-decrypt.c
Changed
@@ -91,7 +91,10 @@ " --unwrap remove only the encryption layer\n" " --large-buffers use large I/O buffer\n" " --sensitive mark data objects as sensitive\n" + " --archive extract files from an encrypted archive\n" + " --directory DIR extract the files into the directory DIR\n" " --diagnostics print diagnostics\n" + " --direct-file-io pass FILE instead of stream with content of FILE to backend\n" , stderr); exit (ex); } @@ -113,12 +116,14 @@ int export_session_key = 0; const char *override_session_key = NULL; const char *request_origin = NULL; + const char *directory = NULL; int no_symkey_cache = 0; int ignore_mdc_error = 0; int raw_output = 0; int large_buffers = 0; int sensitive = 0; int diagnostics = 0; + int direct_file_io = 0; if (argc) { argc--; argv++; } @@ -205,6 +210,24 @@ raw_output = 1; argc--; argv++; } + else if (!strcmp (*argv, "--archive")) + { + flags |= GPGME_DECRYPT_ARCHIVE; + argc--; argv++; + } + else if (!strcmp (*argv, "--directory")) + { + argc--; argv++; + if (!argc) + show_usage (1); + directory = *argv; + argc--; argv++; + } + else if (!strcmp (*argv, "--direct-file-io")) + { + direct_file_io = 1; + argc--; argv++; + } else if (!strncmp (*argv, "--", 2)) show_usage (1); @@ -213,13 +236,16 @@ if (argc < 1 || argc > 2) show_usage (1); - fp_in = fopen (argv0, "rb"); - if (!fp_in) + if (!direct_file_io) { - err = gpgme_error_from_syserror (); - fprintf (stderr, PGM ": can't open `%s': %s\n", - argv0, gpgme_strerror (err)); - exit (1); + fp_in = fopen (argv0, "rb"); + if (!fp_in) + { + err = gpgme_error_from_syserror (); + fprintf (stderr, PGM ": can't open `%s': %s\n", + argv0, gpgme_strerror (err)); + exit (1); + } } init_gpgme (protocol); @@ -287,13 +313,26 @@ } } - err = gpgme_data_new_from_stream (&in, fp_in); + if (direct_file_io) + err = gpgme_data_new (&in); + else + err = gpgme_data_new_from_stream (&in, fp_in); if (err) { fprintf (stderr, PGM ": error allocating data object: %s\n", gpgme_strerror (err)); exit (1); } + if (direct_file_io) + { + err = gpgme_data_set_file_name (in, argv0); + if (err) + { + fprintf (stderr, PGM ": error setting file name (in): %s\n", + gpgme_strerror (err)); + exit (1); + } + } err = gpgme_data_new (&out); if (err) @@ -302,6 +341,16 @@ gpgme_strerror (err)); exit (1); } + if (directory && (flags & GPGME_DECRYPT_ARCHIVE)) + { + err = gpgme_data_set_file_name (out, directory); + if (err) + { + fprintf (stderr, PGM ": error setting file name (out): %s\n", + gpgme_strerror (err)); + exit (1); + } + } if (large_buffers) { err = gpgme_data_set_flag (out, "io-buffer-size", "1000000");
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/run-encrypt.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/run-encrypt.c
Changed
@@ -36,6 +36,7 @@ static int verbose; +static int cancel_after_progress; static char * @@ -63,7 +64,10 @@ static void progress_cb (void *opaque, const char *what, int type, int current, int total) { - (void)opaque; + static int count; + gpgme_ctx_t ctx = opaque; + gpg_error_t err; + (void)type; if (total) @@ -73,14 +77,28 @@ else fprintf (stderr, "progress for '%s' %d\n", nonnull(what), current); fflush (stderr); + count++; + if (cancel_after_progress && count > cancel_after_progress) + { + err = gpgme_cancel_async (ctx); + if (err) + fprintf (stderr, "gpgme_cancel failed: %s <%s>\n", + gpg_strerror (err), gpg_strsource (err)); + else + { + fprintf (stderr, "operation canceled\n"); + cancel_after_progress = 0; + } + } } static void -print_result (gpgme_encrypt_result_t result) +print_encrypt_result (gpgme_encrypt_result_t result) { gpgme_invalid_key_t invkey; + printf ("\nEncryption results\n"); for (invkey = result->invalid_recipients; invkey; invkey = invkey->next) printf ("Encryption key `%s' not used: %s <%s>\n", nonnull (invkey->fpr), @@ -88,6 +106,30 @@ } +static void +print_sign_result (gpgme_sign_result_t result) +{ + gpgme_invalid_key_t invkey; + gpgme_new_signature_t sig; + + printf ("\nSigning results\n"); + for (invkey = result->invalid_signers; invkey; invkey = invkey->next) + printf ("Signing key `%s' not used: %s <%s>\n", + nonnull (invkey->fpr), + gpg_strerror (invkey->reason), gpg_strsource (invkey->reason)); + + for (sig = result->signatures; sig; sig = sig->next) + { + printf ("Key fingerprint: %s\n", nonnull (sig->fpr)); + printf ("Signature type : %d\n", sig->type); + printf ("Public key algo: %d\n", sig->pubkey_algo); + printf ("Hash algo .....: %d\n", sig->hash_algo); + printf ("Creation time .: %ld\n", sig->timestamp); + printf ("Sig class .....: 0x%u\n", sig->sig_class); + } +} + + static int show_usage (int ex) @@ -95,6 +137,7 @@ fputs ("usage: " PGM " options FILE\n\n" "Options:\n" " --verbose run in verbose mode\n" + " --sign sign data before encryption\n" " --status print status lines from the backend\n" " --progress print progress info\n" " --openpgp use the OpenPGP protocol (default)\n" @@ -107,6 +150,11 @@ " --no-symkey-cache disable the use of that cache\n" " --wrap assume input is valid OpenPGP message\n" " --symmetric encrypt symmetric (OpenPGP only)\n" + " --archive encrypt given file or directory into an archive\n" + " --directory DIR switch to directory DIR before encrypting into an archive\n" + " --output FILE write output to FILE instead of stdout\n" + " --diagnostics print diagnostics\n" + " --cancel N cancel after N progress lines\n" , stderr); exit (ex); } @@ -120,7 +168,8 @@ gpgme_ctx_t ctx; gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP; gpgme_data_t in, out; - gpgme_encrypt_result_t result; + gpgme_encrypt_result_t encrypt_result; + gpgme_sign_result_t sign_result; int print_status = 0; int print_progress = 0; int use_loopback = 0; @@ -128,10 +177,14 @@ gpgme_key_t keys10+1; int keycount = 0; char *keystring = NULL; + const char *directory = NULL; + const char *output = NULL; int i; gpgme_encrypt_flags_t flags = GPGME_ENCRYPT_ALWAYS_TRUST; gpgme_off_t offset; int no_symkey_cache = 0; + int diagnostics = 0; + int sign = 0; if (argc) { argc--; argv++; } @@ -154,6 +207,11 @@ verbose = 1; argc--; argv++; } + else if (!strcmp (*argv, "--sign")) + { + sign = 1; + argc--; argv++; + } else if (!strcmp (*argv, "--status")) { print_status = 1; @@ -225,6 +283,40 @@ no_symkey_cache = 1; argc--; argv++; } + else if (!strcmp (*argv, "--archive")) + { + flags |= GPGME_ENCRYPT_ARCHIVE; + argc--; argv++; + } + else if (!strcmp (*argv, "--directory")) + { + argc--; argv++; + if (!argc) + show_usage (1); + directory = *argv; + argc--; argv++; + } + else if (!strcmp (*argv, "--output")) + { + argc--; argv++; + if (!argc) + show_usage (1); + output = *argv; + argc--; argv++; + } + else if (!strcmp (*argv, "--diagnostics")) + { + diagnostics = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "--cancel")) + { + argc--; argv++; + if (!argc) + show_usage (1); + cancel_after_progress = atoi (*argv); + argc--; argv++; + } else if (!strncmp (*argv, "--", 2)) show_usage (1); @@ -244,8 +336,8 @@ gpgme_set_status_cb (ctx, status_cb, NULL); gpgme_set_ctx_flag (ctx, "full-status", "1"); } - if (print_progress) - gpgme_set_progress_cb (ctx, progress_cb, NULL); + if (print_progress || cancel_after_progress) + gpgme_set_progress_cb (ctx, progress_cb, ctx); if (use_loopback) { gpgme_set_pinentry_mode (ctx, GPGME_PINENTRY_MODE_LOOPBACK); @@ -269,66 +361,117 @@ } keysi = NULL; - err = gpgme_data_new_from_file (&in, *argv, 1); - if (err) + if (flags & GPGME_ENCRYPT_ARCHIVE) { - fprintf (stderr, PGM ": error reading `%s': %s\n", - *argv, gpg_strerror (err)); - exit (1); - } - offset = gpgme_data_seek (in, 0, SEEK_END); - if (offset == (gpgme_off_t)(-1)) - { - err = gpg_error_from_syserror (); - fprintf (stderr, PGM ": error seeking `%s': %s\n", - *argv, gpg_strerror (err)); - exit (1); + const char *path = *argv; + err = gpgme_data_new_from_mem (&in, path, strlen (path), 0); + fail_if_err (err); + if (directory) + { + err = gpgme_data_set_file_name (in, directory); + fail_if_err (err); + } } - if (gpgme_data_seek (in, 0, SEEK_SET) == (gpgme_off_t)(-1)) + else { - err = gpg_error_from_syserror (); - fprintf (stderr, PGM ": error seeking `%s': %s\n", - *argv, gpg_strerror (err)); - exit (1); - } - { - char numbuf50; - char *p; - - p = numbuf + sizeof numbuf; - *--p = 0; - do - { - *--p = '0' + (offset % 10); - offset /= 10; - } - while (offset); - err = gpgme_data_set_flag (in, "size-hint", p); - if (err) + err = gpgme_data_new_from_file (&in, *argv, 1); + if (err) + { + fprintf (stderr, PGM ": error reading `%s': %s\n", + *argv, gpg_strerror (err)); + exit (1); + } + offset = gpgme_data_seek (in, 0, SEEK_END); + if (offset == (gpgme_off_t)(-1)) + { + err = gpg_error_from_syserror (); + fprintf (stderr, PGM ": error seeking `%s': %s\n", + *argv, gpg_strerror (err)); + exit (1); + } + if (gpgme_data_seek (in, 0, SEEK_SET) == (gpgme_off_t)(-1)) + { + err = gpg_error_from_syserror (); + fprintf (stderr, PGM ": error seeking `%s': %s\n", + *argv, gpg_strerror (err)); + exit (1); + } { - fprintf (stderr, PGM ": error setting size-hint for `%s': %s\n", - *argv, gpg_strerror (err)); - exit (1); + char numbuf50; + char *p; + + p = numbuf + sizeof numbuf; + *--p = 0; + do + { + *--p = '0' + (offset % 10); + offset /= 10; + } + while (offset); + err = gpgme_data_set_flag (in, "size-hint", p); + if (err) + { + fprintf (stderr, PGM ": error setting size-hint for `%s': %s\n", + *argv, gpg_strerror (err)); + exit (1); + } } - } + } err = gpgme_data_new (&out); fail_if_err (err); + if (output) + { + err = gpgme_data_set_file_name (out, output); + fail_if_err (err); + } + + if (sign) + err = gpgme_op_encrypt_sign_ext (ctx, keycount ? keys : NULL, keystring, + flags, in, out); + else + err = gpgme_op_encrypt_ext (ctx, keycount ? keys : NULL, keystring, + flags, in, out); - err = gpgme_op_encrypt_ext (ctx, keycount ? keys : NULL, keystring, - flags, in, out); - result = gpgme_op_encrypt_result (ctx); - if (result) - print_result (result); + if (diagnostics) + { + gpgme_data_t diag; + gpgme_error_t diag_err; + + gpgme_data_new (&diag); + diag_err = gpgme_op_getauditlog (ctx, diag, GPGME_AUDITLOG_DIAG); + if (diag_err) + { + fprintf (stderr, PGM ": getting diagnostics failed: %s\n", + gpgme_strerror (diag_err)); + } + else + { + fputs ("Begin Diagnostics:\n", stdout); + print_data (diag); + fputs ("End Diagnostics.\n", stdout); + } + gpgme_data_release (diag); + } + + sign_result = gpgme_op_sign_result (ctx); + if (sign_result) + print_sign_result (sign_result); + encrypt_result = gpgme_op_encrypt_result (ctx); + if (encrypt_result) + print_encrypt_result (encrypt_result); if (err) { fprintf (stderr, PGM ": encrypting failed: %s\n", gpg_strerror (err)); exit (1); } - fputs ("Begin Output:\n", stdout); - print_data (out); - fputs ("End Output.\n", stdout); + if (!output) + { + fputs ("Begin Output:\n", stdout); + print_data (out); + fputs ("End Output.\n", stdout); + } gpgme_data_release (out); gpgme_data_release (in);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/run-keylist.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/run-keylist.c
Changed
@@ -58,6 +58,7 @@ " --validate use GPGME_KEYLIST_MODE_VALIDATE\n" " --import import all keys\n" " --offline use offline mode\n" + " --no-trust-check disable automatic trust database check\n" " --from-file list all keys in the given file\n" " --from-wkd list key from a web key directory\n" " --require-gnupg required at least the given GnuPG version\n" @@ -103,6 +104,7 @@ gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP; int only_secret = 0; int offline = 0; + int no_trust_check = 0; int from_file = 0; int from_wkd = 0; gpgme_data_t data = NULL; @@ -192,6 +194,11 @@ offline = 1; argc--; argv++; } + else if (!strcmp (*argv, "--no-trust-check")) + { + no_trust_check = 1; + argc--; argv++; + } else if (!strcmp (*argv, "--from-file")) { from_file = 1; @@ -238,6 +245,12 @@ gpgme_set_offline (ctx, offline); + if (no_trust_check) + { + err = gpgme_set_ctx_flag (ctx, "no-auto-check-trustdb", "1"); + fail_if_err (err); + } + if (trust_model) { err = gpgme_set_ctx_flag (ctx, "trust-model", trust_model); @@ -296,19 +309,22 @@ printf ("grip %2d: %s\n", nsub, subkey->keygrip); if (subkey->curve) printf ("curve %2d: %s\n", nsub, subkey->curve); - printf ("caps %2d: %s%s%s%s\n", + printf ("caps %2d: %s%s%s%s%s%s\n", nsub, subkey->can_encrypt? "e":"", subkey->can_sign? "s":"", subkey->can_certify? "c":"", - subkey->can_authenticate? "a":""); - printf ("flags %2d:%s%s%s%s%s%s%s%s\n", + subkey->can_authenticate? "a":"", + subkey->can_renc? "r":"", + subkey->can_timestamp? "t":""); + printf ("flags %2d:%s%s%s%s%s%s%s%s%s\n", nsub, subkey->secret? " secret":"", subkey->revoked? " revoked":"", subkey->expired? " expired":"", subkey->disabled? " disabled":"", subkey->invalid? " invalid":"", + subkey->is_group_owned? " group":"", subkey->is_qualified? " qualified":"", subkey->is_de_vs? " de-vs":"", subkey->is_cardkey? " cardkey":"");
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/run-sign.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/run-sign.c
Changed
@@ -86,6 +86,11 @@ " --key NAME use key NAME for signing\n" " --sender MBOX use MBOX as sender address\n" " --include-key-block use this option with gpg\n" + " --clear create a clear text signature\n" + " --archive create a signed archive with the given file or directory\n" + " --directory DIR switch to directory DIR before creating the archive\n" + " --output FILE write output to FILE instead of stdout\n" + " --diagnostics print diagnostics\n" , stderr); exit (ex); } @@ -98,6 +103,8 @@ gpgme_error_t err; gpgme_ctx_t ctx; const char *key_string = NULL; + const char *directory = NULL; + const char *output = NULL; gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP; gpgme_sig_mode_t sigmode = GPGME_SIG_MODE_NORMAL; gpgme_data_t in, out; @@ -105,6 +112,7 @@ int print_status = 0; int use_loopback = 0; int include_key_block = 0; + int diagnostics = 0; const char *sender = NULL; const char *s; @@ -172,6 +180,37 @@ include_key_block = 1; argc--; argv++; } + else if (!strcmp (*argv, "--clear")) + { + sigmode = GPGME_SIG_MODE_CLEAR; + argc--; argv++; + } + else if (!strcmp (*argv, "--archive")) + { + sigmode = GPGME_SIG_MODE_ARCHIVE; + argc--; argv++; + } + else if (!strcmp (*argv, "--directory")) + { + argc--; argv++; + if (!argc) + show_usage (1); + directory = *argv; + argc--; argv++; + } + else if (!strcmp (*argv, "--output")) + { + argc--; argv++; + if (!argc) + show_usage (1); + output = *argv; + argc--; argv++; + } + else if (!strcmp (*argv, "--diagnostics")) + { + diagnostics = 1; + argc--; argv++; + } else if (!strncmp (*argv, "--", 2)) show_usage (1); @@ -230,19 +269,60 @@ } } - err = gpgme_data_new_from_file (&in, *argv, 1); - if (err) + if (sigmode == GPGME_SIG_MODE_ARCHIVE) { - fprintf (stderr, PGM ": error reading `%s': %s\n", - *argv, gpg_strerror (err)); - exit (1); + const char *path = *argv; + err = gpgme_data_new_from_mem (&in, path, strlen (path), 0); + fail_if_err (err); + if (directory) + { + err = gpgme_data_set_file_name (in, directory); + fail_if_err (err); + } + } + else + { + err = gpgme_data_new_from_file (&in, *argv, 1); + if (err) + { + fprintf (stderr, PGM ": error reading `%s': %s\n", + *argv, gpg_strerror (err)); + exit (1); + } } err = gpgme_data_new (&out); fail_if_err (err); + if (output) + { + err = gpgme_data_set_file_name (out, output); + fail_if_err (err); + } err = gpgme_op_sign (ctx, in, out, sigmode); result = gpgme_op_sign_result (ctx); + + if (diagnostics) + { + gpgme_data_t diag; + gpgme_error_t diag_err; + + gpgme_data_new (&diag); + diag_err = gpgme_op_getauditlog (ctx, diag, GPGME_AUDITLOG_DIAG); + if (diag_err) + { + fprintf (stderr, PGM ": getting diagnostics failed: %s\n", + gpgme_strerror (diag_err)); + } + else + { + fputs ("Begin Diagnostics:\n", stdout); + print_data (diag); + fputs ("End Diagnostics.\n", stdout); + } + gpgme_data_release (diag); + } + if (result) print_result (result, sigmode); if (err) @@ -254,9 +334,12 @@ if ((s = gpgme_get_ctx_flag (ctx, "redraw")) && *s) fputs ("Screen redraw suggested\n", stdout); - fputs ("Begin Output:\n", stdout); - print_data (out); - fputs ("End Output.\n", stdout); + if (!output) + { + fputs ("Begin Output:\n", stdout); + print_data (out); + fputs ("End Output.\n", stdout); + } gpgme_data_release (out); gpgme_data_release (in);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/run-verify.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/run-verify.c
Changed
@@ -231,10 +231,15 @@ " --status print status lines from the backend\n" " --openpgp use the OpenPGP protocol (default)\n" " --cms use the CMS protocol\n" + " --binary assume binary signature\n" " --sender MBOX use MBOX as sender address\n" " --repeat N repeat the operation N times\n" " --auto-key-retrieve\n" " --auto-key-import\n" + " --archive extract files from a signed archive FILE\n" + " --directory DIR extract the files into the directory DIR\n" + " --diagnostics print diagnostics\n" + " --direct-file-io pass file names instead of streams with content of files to backend\n" , stderr); exit (ex); } @@ -246,10 +251,15 @@ int last_argc = -1; const char *s; gpgme_protocol_t protocol = GPGME_PROTOCOL_OpenPGP; + gpgme_verify_flags_t flags = 0; int print_status = 0; const char *sender = NULL; + const char *directory = NULL; int auto_key_retrieve = 0; int auto_key_import = 0; + gpgme_data_encoding_t encoding = GPGME_DATA_ENCODING_NONE; + int diagnostics = 0; + int direct_file_io = 0; int repeats = 1; int i; @@ -286,6 +296,11 @@ protocol = GPGME_PROTOCOL_CMS; argc--; argv++; } + else if (!strcmp (*argv, "--binary")) + { + encoding = GPGME_DATA_ENCODING_BINARY; + argc--; argv++; + } else if (!strcmp (*argv, "--sender")) { argc--; argv++; @@ -312,12 +327,35 @@ auto_key_import = 1; argc--; argv++; } + else if (!strcmp (*argv, "--archive")) + { + flags |= GPGME_VERIFY_ARCHIVE; + argc--; argv++; + } + else if (!strcmp (*argv, "--directory")) + { + argc--; argv++; + if (!argc) + show_usage (1); + directory = *argv; + argc--; argv++; + } + else if (!strcmp (*argv, "--diagnostics")) + { + diagnostics = 1; + argc--; argv++; + } + else if (!strcmp (*argv, "--direct-file-io")) + { + direct_file_io = 1; + argc--; argv++; + } else if (!strncmp (*argv, "--", 2)) show_usage (1); } - if (argc < 1 || argc > 2) + if (argc < 1 || argc > 2 || (argc > 1 && (flags & GPGME_VERIFY_ARCHIVE))) show_usage (1); init_gpgme (protocol); @@ -330,6 +368,7 @@ gpgme_data_t sig = NULL; FILE *fp_msg = NULL; gpgme_data_t msg = NULL; + gpgme_data_t out = NULL; gpgme_verify_result_t result; if (repeats > 1) @@ -337,24 +376,27 @@ printf ("Repeat: %i\n", i); } - fp_sig = fopen (argv0, "rb"); - if (!fp_sig) - { - err = gpgme_error_from_syserror (); - fprintf (stderr, PGM ": can't open `%s': %s\n", - argv0, gpgme_strerror (err)); - exit (1); - } - if (argc > 1) + if (!direct_file_io) { - fp_msg = fopen (argv1, "rb"); - if (!fp_msg) + fp_sig = fopen (argv0, "rb"); + if (!fp_sig) { err = gpgme_error_from_syserror (); fprintf (stderr, PGM ": can't open `%s': %s\n", - argv1, gpgme_strerror (err)); + argv0, gpgme_strerror (err)); exit (1); } + if (argc > 1) + { + fp_msg = fopen (argv1, "rb"); + if (!fp_msg) + { + err = gpgme_error_from_syserror (); + fprintf (stderr, PGM ": can't open `%s': %s\n", + argv1, gpgme_strerror (err)); + exit (1); + } + } } err = gpgme_new (&ctx); @@ -397,26 +439,93 @@ fail_if_err (err); } - err = gpgme_data_new_from_stream (&sig, fp_sig); + if (direct_file_io) + err = gpgme_data_new (&sig); + else + err = gpgme_data_new_from_stream (&sig, fp_sig); if (err) { fprintf (stderr, PGM ": error allocating data object: %s\n", gpgme_strerror (err)); exit (1); } - if (fp_msg) + gpgme_data_set_encoding (sig, encoding); + if (direct_file_io) + { + err = gpgme_data_set_file_name (sig, argv0); + if (err) + { + fprintf (stderr, PGM ": error setting file name (sig): %s\n", + gpgme_strerror (err)); + exit (1); + } + } + if (argc > 1) + { + if (direct_file_io) + err = gpgme_data_new (&msg); + else + err = gpgme_data_new_from_stream (&msg, fp_msg); + if (err) + { + fprintf (stderr, PGM ": error allocating data object: %s\n", + gpgme_strerror (err)); + exit (1); + } + if (direct_file_io) + { + err = gpgme_data_set_file_name (msg, argv1); + if (err) + { + fprintf (stderr, PGM ": error setting file name (msg): %s\n", + gpgme_strerror (err)); + exit (1); + } + } + } + + if (directory && (flags & GPGME_VERIFY_ARCHIVE)) { - err = gpgme_data_new_from_stream (&msg, fp_msg); + err = gpgme_data_new (&out); if (err) { fprintf (stderr, PGM ": error allocating data object: %s\n", gpgme_strerror (err)); exit (1); } + err = gpgme_data_set_file_name (out, directory); + if (err) + { + fprintf (stderr, PGM ": error setting file name (out): %s\n", + gpgme_strerror (err)); + exit (1); + } } - err = gpgme_op_verify (ctx, sig, msg, NULL); + err = gpgme_op_verify_ext (ctx, flags, sig, msg, out); result = gpgme_op_verify_result (ctx); + + if (diagnostics) + { + gpgme_data_t diag; + gpgme_error_t diag_err; + + gpgme_data_new (&diag); + diag_err = gpgme_op_getauditlog (ctx, diag, GPGME_AUDITLOG_DIAG); + if (diag_err) + { + fprintf (stderr, PGM ": getting diagnostics failed: %s\n", + gpgme_strerror (diag_err)); + } + else + { + fputs ("Begin Diagnostics:\n", stdout); + print_data (diag); + fputs ("End Diagnostics.\n", stdout); + } + gpgme_data_release (diag); + } + if (result) print_result (result); if (err) @@ -425,6 +534,7 @@ exit (1); } + gpgme_data_release (out); gpgme_data_release (msg); gpgme_data_release (sig);
View file
_service:tar_scm:gpgme-1.17.0.tar.bz2/tests/t-engine-info.c -> _service:tar_scm:gpgme-1.21.0.tar.bz2/tests/t-engine-info.c
Changed
@@ -133,6 +133,7 @@ "dirmngr-name", "pinentry-name", "gpg-wks-client-name", + "gpgtar-name", NULL }; const char *s; int i;
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2