From 68f6c707117643ce439618e5b5277a42c1c01355 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 17 Sep 2007 10:21:20 +0000 Subject: Fixed a W32bug in rungpg.c --- ChangeLog | 4 ++++ README.CVS | 59 --------------------------------------------------------- README.SVN | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 33 ++++++++++++++------------------ gpgme/ChangeLog | 5 +++++ gpgme/gpgme.h | 2 +- gpgme/rungpg.c | 24 +++++++++++++++-------- 7 files changed, 91 insertions(+), 87 deletions(-) delete mode 100644 README.CVS create mode 100644 README.SVN diff --git a/ChangeLog b/ChangeLog index f45f6e32..392733f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-09-17 Werner Koch + + * configure.ac: Use the svn version magic. + 2007-09-07 Marcus Brinkmann * configure.ac: Check for C++, Qt and support --enable-w32-qt. diff --git a/README.CVS b/README.CVS deleted file mode 100644 index 642dda0a..00000000 --- a/README.CVS +++ /dev/null @@ -1,59 +0,0 @@ -If you are building from CVS, run the script - -./autogen.sh - -first, to make sure that you have all the necessary maintainer tools -are installed and to build the actual configuration files. Then run - -./configure --enable-maintainer-mode - -followed by the usual make. - -If autogen.sh complains about insufficient versions of the required -tools, or the tools are not installed, you may use environment -variables to override the default tool names: - - AUTOMAKE_SUFFIX is used as a suffix for all tools from the automake - package. For example - AUTOMAKE_SUFFIX="-1.7" ./autogen.sh - uses "automake-1.7" and "aclocal-1.7. - AUTOMAKE_PREFIX is used as a prefix for all tools from the automake - page and may be combined with AUTOMAKE_SUFFIX. e.g.: - AUTOMAKE_PREFIX=/usr/foo/bin ./autogen.sh - uses "automake" and "aclocal" in the /usr/foo/bin - directory. - AUTOCONF_SUFFIX is used as a suffix for all tools from the automake - package - AUTOCONF_PREFIX is used as a prefix for all tools from the automake - package - GETTEXT_SUFFIX is used as a suffix for all tools from the gettext - package - GETTEXT_PREFIX is used as a prefix for all tools from the gettext - package - -It is also possible to use the variable name AUTOMAKE, AUTOCONF, -ACLOCAL, AUTOHEADER, GETTEXT and MSGMERGE to directly specify the name -of the programs to run. It is however better to use the suffix and -prefix forms as described above because that does not require -knowledge about the actual tools used by autgen.sh. - - -Please don't use autopoint, libtoolize or autoreconf unless you are -the current maintainer and want to update the standard configuration -files. All those files should be in the CVS and only updated manually -if the maintainer decides that newer versions are required. The -maintainer should also make sure that the required version of automake -et al. are properly indicated at the top of configure.ac and take care -to copy the files and not merely use symlinks. - - -Copyright 2004 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 -modifications, as long as this notice is preserved. - -This file is distributed in the hope that it will be useful, but -WITHOUT ANY WARRANTY, to the extent permitted by law; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -PURPOSE. diff --git a/README.SVN b/README.SVN new file mode 100644 index 00000000..c6422829 --- /dev/null +++ b/README.SVN @@ -0,0 +1,51 @@ +If you are building from Subversion, run the script + +./autogen.sh + +first, to make sure that you have all the necessary maintainer tools +are installed and to build the actual configuration files. If you +have just updated from SVN, you should add the option "--force" to +autogen.sh so that meta data from SVN is noticed. Then run + +./configure --enable-maintainer-mode + +followed by the usual make. + +If autogen.sh complains about insufficient versions of the required +tools, or the tools are not installed, you may use environment +variables to override the default tool names: + + AUTOMAKE_SUFFIX is used as a suffix for all tools from the automake + package. For example + AUTOMAKE_SUFFIX="-1.7" ./autogen.sh + uses "automake-1.7" and "aclocal-1.7. + AUTOMAKE_PREFIX is used as a prefix for all tools from the automake + page and may be combined with AUTOMAKE_SUFFIX. e.g.: + AUTOMAKE_PREFIX=/usr/foo/bin ./autogen.sh + uses "automake" and "aclocal" in the /usr/foo/bin + directory. + AUTOCONF_SUFFIX is used as a suffix for all tools from the automake + package + AUTOCONF_PREFIX is used as a prefix for all tools from the automake + package + GETTEXT_SUFFIX is used as a suffix for all tools from the gettext + package + GETTEXT_PREFIX is used as a prefix for all tools from the gettext + package + +It is also possible to use the variable name AUTOMAKE, AUTOCONF, +ACLOCAL, AUTOHEADER, GETTEXT and MSGMERGE to directly specify the name +of the programs to run. It is however better to use the suffix and +prefix forms as described above because that does not require +knowledge about the actual tools used by autgen.sh. + + +Please don't use autopoint, libtoolize or autoreconf unless you are +the current maintainer and want to update the standard configuration +files. All those files should be in the SVN and only updated manually +if the maintainer decides that newer versions are required. The +maintainer should also make sure that the required version of automake +et al. are properly indicated at the top of configure.ac and take care +to copy the files and not merely use symlinks. + + diff --git a/configure.ac b/configure.ac index 963ab6c0..ca639398 100644 --- a/configure.ac +++ b/configure.ac @@ -23,24 +23,22 @@ AC_PREREQ(2.59) min_automake_version="1.9.3" # Version number: Remember to change it immediately *after* a release. -# Make sure to run "svn up" before a "make dist". -# See below for the LT versions. +# Make sure to run "svn up" and "./autogen.sh --force" +# before a "make dist". See below for the LT versions. # -# The CVS version is usually the next intended release version with -# the string "-cvs" appended. The reason for this is that tests for a +# The SVN version is usually the next intended release version with +# the string "-svnNNN" appended. The reason for this is that tests for a # specific feature can already be done under the assumption that the -# CVS version is the most recent one in a branch. To disable the CVS -# version for the real release, just comment out the my_iscvs macro. -# Note, that we are now using Subversion instead of CVS and append the -# SVN revision number to the "cvs" suffix. To make this most useful -# for snapshot releases please do an "svn up" right before recreating -# the configure script, so that a proper revision number for all files -# is available when running a "make distcheck". +# SVN version is the most recent one in a branch. To disable the SVN +# version for the real release, set the my_issvn macro to no. m4_define(my_version, [1.1.5]) -m4_define(my_iscvs, yes) -AC_INIT([gpgme], my_version[]m4_ifdef([my_iscvs], [-cvs[]m4_translit( - [$Revision$],[Ra-z $:])]), - [bug-gpgme@gnupg.org]) +m4_define(my_issvn, [yes]) + +m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \ + || echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')])) +AC_INIT([gpgme], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]), + [bug-gpgme@gnupg.org]) + # LT Version numbers, remember to change them just *before* a release. # (Code changed: REVISION++) @@ -59,6 +57,7 @@ GPGME_CONFIG_API_VERSION=1 ############################################## +BUILD_REVISION=svn_revision PACKAGE=$PACKAGE_NAME VERSION=$PACKAGE_VERSION @@ -577,10 +576,6 @@ AM_CONDITIONAL(BUILD_COMPLUS, test "$component_system" = "COM+") GNUPG_FIX_HDR_VERSION(gpgme/gpgme.h, GPGME_VERSION) # Generate values for the DLL version info -changequote(,)dnl -BUILD_REVISION="`echo '$Revision$' | sed 's/[^0-9]//g'`" -changequote([,])dnl -test -z "$BUILD_REVISION" && BUILD_REVISION="0" if test "$have_w32_system" = yes; then BUILD_TIMESTAMP=`date --iso-8601=minutes` changequote(,)dnl diff --git a/gpgme/ChangeLog b/gpgme/ChangeLog index 53a1d0b8..9465509e 100644 --- a/gpgme/ChangeLog +++ b/gpgme/ChangeLog @@ -1,3 +1,8 @@ +2007-09-17 Werner Koch + + * rungpg.c (gpg_new): Make robust against undefined ttyname or + ttytype. + 2007-09-14 Werner Koch * data-mem.c (gpgme_data_release_and_get_mem): Fix tracing bug. diff --git a/gpgme/gpgme.h b/gpgme/gpgme.h index 5bdd1035..1b2c8823 100644 --- a/gpgme/gpgme.h +++ b/gpgme/gpgme.h @@ -73,7 +73,7 @@ extern "C" { AM_PATH_GPGME macro) check that this header matches the installed library. Warning: Do not edit the next line. configure will do that for you! */ -#define GPGME_VERSION "1.1.5-cvs1251" +#define GPGME_VERSION "1.1.5-svn1255" diff --git a/gpgme/rungpg.c b/gpgme/rungpg.c index 70293f83..5618f849 100644 --- a/gpgme/rungpg.c +++ b/gpgme/rungpg.c @@ -483,18 +483,26 @@ gpg_new (void **engine, const char *file_name, const char *home_dir) rc = gpg_error_from_errno (errno); else { - rc = add_arg (gpg, "--ttyname"); - if (!rc) - rc = add_arg (gpg, dft_ttyname); - if (!rc) + if (dft_ttyname) + { + rc = add_arg (gpg, "--ttyname"); + if (!rc) + rc = add_arg (gpg, dft_ttyname); + } + else + rc = 0; + if (!rc) { rc = _gpgme_getenv ("TERM", &dft_ttytype); if (rc) goto leave; - - rc = add_arg (gpg, "--ttytype"); - if (!rc) - rc = add_arg (gpg, dft_ttytype); + + if (dft_ttytype) + { + rc = add_arg (gpg, "--ttytype"); + if (!rc) + rc = add_arg (gpg, dft_ttytype); + } free (dft_ttytype); } -- cgit v1.2.3