]> git.notmuchmail.org Git - notmuch/commitdiff
Merge branch 'release'
authorDavid Bremner <david@tethera.net>
Tue, 21 Feb 2017 12:16:07 +0000 (08:16 -0400)
committerDavid Bremner <david@tethera.net>
Tue, 21 Feb 2017 12:16:07 +0000 (08:16 -0400)
Merge changes to use gpgconf --create-socketdir

1  2 
configure
test/test-lib.sh

diff --combined configure
index fa77eb8fd4b7b406f2b3a097137c4c5001c285f9,46063b5d2eeffabe893c70639ed74f754e5e0ed8..d0d8f18acef8a3d2f5cfbbf2c70361b0410e0af0
+++ b/configure
@@@ -70,7 -70,6 +70,7 @@@ LIBDIR
  WITH_DOCS=1
  WITH_API_DOCS=1
  WITH_EMACS=1
 +WITH_DESKTOP=1
  WITH_BASH=1
  WITH_RUBY=1
  WITH_ZSH=1
@@@ -142,7 -141,6 +142,7 @@@ Some features can be disabled (--with-f
        --without-docs                  Do not install documentation
        --without-api-docs              Do not install API man page
        --without-emacs                 Do not install lisp file
 +      --without-desktop               Do not install desktop file
        --without-ruby                  Do not install ruby bindings
        --without-zsh-completion        Do not install zsh completions files
        --without-retry-lock            Do not use blocking xapian opens, even if available
@@@ -211,14 -209,6 +211,14 @@@ for option; d
        fi
      elif [ "${option}" = '--without-emacs' ] ; then
        WITH_EMACS=0
 +    elif [ "${option%%=*}" = '--with-desktop' ]; then
 +      if [ "${option#*=}" = 'no' ]; then
 +          WITH_DESKTOP=0
 +      else
 +          WITH_DESKTOP=1
 +      fi
 +    elif [ "${option}" = '--without-desktop' ] ; then
 +      WITH_DESKTOP=0
      elif [ "${option%%=*}" = '--with-bash-completion' ]; then
        if [ "${option#*=}" = 'no' ]; then
            WITH_BASH=0
@@@ -612,16 -602,19 +612,29 @@@ if [ $WITH_DOCS = "1" ] ; the
      fi
  fi
  
+ have_gpgconf_socketdir=0
+ printf "Checking for gpgconf --{create,remove}-socketdir... "
+ if gpgconf --dump-options > /dev/null ; then
+     if gpgconf --dump-options | grep -q create-socketdir ; then
+       printf "Yes.\n"
+       have_gpgconf_socketdir=1
+     else
+       printf "No.\n"
+     fi
+ else
+     printf "No. (missing or broken gpgconf?)\n"
+ fi
 +if [ $WITH_DESKTOP = "1" ]; then
 +    printf "Checking if desktop-file-install is available... "
 +    if command -v desktop-file-install > /dev/null; then
 +      printf "Yes.\n"
 +    else
 +      printf "No (so will not install .desktop file).\n"
 +      WITH_DESKTOP=0
 +    fi
 +fi
 +
  libdir_in_ldconfig=0
  
  printf "Checking which platform we are on... "
@@@ -680,6 -673,19 +693,6 @@@ els
  EOF
  fi
  
 -printf "Checking byte order... "
 -cat> _byteorder.c <<EOF
 -#include <stdio.h>
 -#include <stdint.h>
 -uint32_t test = 0x34333231;
 -int main() { printf("%.4s\n", (const char*)&test); return 0; }
 -EOF
 -${CC} ${CFLAGS} _byteorder.c -o _byteorder > /dev/null 2>&1
 -util_byte_order=$(./_byteorder)
 -echo $util_byte_order
 -
 -rm -f _byteorder _byteorder.c
 -
  if [ $errors -gt 0 ]; then
      cat <<EOF
  
@@@ -999,6 -1005,9 +1012,6 @@@ prefix = ${PREFIX
  # LIBDIR_IN_LDCONFIG value below is still set correctly.
  libdir = ${LIBDIR:=\$(prefix)/lib}
  
 -# byte order within a 32 bit word. 1234 = little, 4321 = big, 0 = guess
 -UTIL_BYTE_ORDER = ${util_byte_order}
 -
  # Whether libdir is in a path configured into ldconfig
  LIBDIR_IN_LDCONFIG = ${libdir_in_ldconfig}
  
@@@ -1127,9 -1136,6 +1140,9 @@@ VALGRIND_CFLAGS = ${valgrind_cflags
  # Support for emacs
  WITH_EMACS = ${WITH_EMACS}
  
 +# Support for desktop file
 +WITH_DESKTOP = ${WITH_DESKTOP}
 +
  # Support for bash completion
  WITH_BASH = ${WITH_BASH}
  
@@@ -1149,9 -1155,9 +1162,9 @@@ COMMON_CONFIGURE_CFLAGS = \
        -DSTD_GETPWUID=\$(STD_GETPWUID)                         \\
        -DSTD_ASCTIME=\$(STD_ASCTIME)                           \\
        -DHAVE_XAPIAN_COMPACT=\$(HAVE_XAPIAN_COMPACT)           \\
 +      -DSILENCE_XAPIAN_DEPRECATION_WARNINGS                   \\
        -DHAVE_XAPIAN_FIELD_PROCESSOR=\$(HAVE_XAPIAN_FIELD_PROCESSOR) \\
 -      -DHAVE_XAPIAN_DB_RETRY_LOCK=\$(HAVE_XAPIAN_DB_RETRY_LOCK) \\
 -      -DUTIL_BYTE_ORDER=\$(UTIL_BYTE_ORDER)
 +      -DHAVE_XAPIAN_DB_RETRY_LOCK=\$(HAVE_XAPIAN_DB_RETRY_LOCK)
  
  CONFIGURE_CFLAGS = \$(COMMON_CONFIGURE_CFLAGS)
  
@@@ -1186,6 -1192,9 +1199,9 @@@ NOTMUCH_PYTHON=${python
  # Are the ruby development files (and ruby) available? If not skip
  # building/testing ruby bindings.
  NOTMUCH_HAVE_RUBY_DEV=${have_ruby_dev}
+ # Recent enough gnupg to support gpgconf --create-socketdir?
+ NOTMUCH_HAVE_GPGCONF_SOCKETDIR=${have_gpgconf_socketdir}
  EOF
  
  # Finally, after everything configured, inform the user how to continue.
diff --combined test/test-lib.sh
index 6f9468ae43bc22760b11b72ed7547d8cacb0b8d6,ba1580cd1f3e803130a373c09a766fc82dbf1e7e..67be917eb94299c609773ab31a2d798c5b172daa
@@@ -80,7 -80,6 +80,7 @@@ if [[ ( -n "$TEST_EMACS" && -z "$TEST_E
  fi
  TEST_EMACS=${TEST_EMACS:-${EMACS:-emacs}}
  TEST_EMACSCLIENT=${TEST_EMACSCLIENT:-emacsclient}
 +TEST_GDB=${TEST_GDB:-gdb}
  TEST_CC=${TEST_CC:-cc}
  TEST_CFLAGS=${TEST_CFLAGS:-"-g -O0"}
  
@@@ -230,10 -229,19 +230,19 @@@ test_fixed=
  test_broken=0
  test_success=0
  
+ _shutdown_gpg_agent () {
+     if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} = 1 ]; then
+       gpgconf --kill gpg-agent
+       gpgconf --remove-socketdir
+     fi
+ }
  _exit_common () {
        code=$?
        trap - EXIT
        set +ex
+       _shutdown_gpg_agent
        rm -rf "$TEST_TMPDIR"
  }
  
@@@ -625,15 -633,15 +634,15 @@@ test_expect_equal_file (
        error "bug in the test script: not 2 or 3 parameters to test_expect_equal"
  
        file1="$1"
 -      basename1=`basename "$file1"`
        file2="$2"
 -      basename2=`basename "$file2"`
        if ! test_skip "$test_subtest_name"
        then
                if diff -q "$file1" "$file2" >/dev/null ; then
                        test_ok_
                else
                        testname=$this_test.$test_count
 +                      basename1=`basename "$file1"`
 +                      basename2=`basename "$file2"`
                        cp "$file1" "$testname.$basename1"
                        cp "$file2" "$testname.$basename2"
                        test_failure_ "$(diff -u "$testname.$basename1" "$testname.$basename2")"
@@@ -1277,6 -1285,11 +1286,11 @@@ test_init_ () 
  
  . ./test-lib-common.sh || exit 1
  
+ # we need the setting of GNUPGHOME in test-lib-common.sh
+ if [ ${NOTMUCH_HAVE_GPGCONF_SOCKETDIR} = 1 ]; then
+     gpgconf --create-socketdir
+ fi
  emacs_generate_script
  
  
@@@ -1380,7 -1393,7 +1394,7 @@@ esa
  test_declare_external_prereq dtach
  test_declare_external_prereq emacs
  test_declare_external_prereq ${TEST_EMACSCLIENT}
 -test_declare_external_prereq gdb
 +test_declare_external_prereq ${TEST_GDB}
  test_declare_external_prereq gpg
  test_declare_external_prereq openssl
  test_declare_external_prereq gpgsm