From: Werner Koch Date: Mon, 17 Sep 2007 10:21:20 +0000 (+0000) Subject: Fixed a W32bug in rungpg.c X-Git-Tag: gpgme-1.2.0@1385~127 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=589ac1dcfa5e25c2749690d75aa075f1718cc077;p=gpgme.git Fixed a W32bug in rungpg.c --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index f45f6e3..392733f 100644 --- a/trunk/ChangeLog +++ b/trunk/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/trunk/README.CVS b/trunk/README.SVN similarity index 76% rename from trunk/README.CVS rename to trunk/README.SVN index 642dda0..c642282 100644 --- a/trunk/README.CVS +++ b/trunk/README.SVN @@ -1,9 +1,11 @@ -If you are building from CVS, run the script +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. Then run +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 @@ -40,20 +42,10 @@ 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 +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. -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/trunk/configure.ac b/trunk/configure.ac index 963ab6c..ca63939 100644 --- a/trunk/configure.ac +++ b/trunk/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/trunk/gpgme/ChangeLog b/trunk/gpgme/ChangeLog index 53a1d0b..9465509 100644 --- a/trunk/gpgme/ChangeLog +++ b/trunk/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/trunk/gpgme/gpgme.h b/trunk/gpgme/gpgme.h index 5bdd103..1b2c882 100644 --- a/trunk/gpgme/gpgme.h +++ b/trunk/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/trunk/gpgme/rungpg.c b/trunk/gpgme/rungpg.c index 70293f8..5618f84 100644 --- a/trunk/gpgme/rungpg.c +++ b/trunk/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); }