[git] GnuPG - branch, master, updated. gnupg-2.1.8-83-g2eee292

by Werner Koch cvs at cvs.gnupg.org
Thu Oct 8 18:38:47 CEST 2015


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  2eee29253d5940e6da9cb2f44e9c44033675ec12 (commit)
       via  4c298525903f844eee95ecbcdc45f5ac034fa148 (commit)
      from  d7b8e76f9930750d669405dee3108c9bc8e87b91 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 2eee29253d5940e6da9cb2f44e9c44033675ec12
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 8 18:24:26 2015 +0200

    speedo: Add a w32-release target.
    
    --
    
    This simplifies building a release to:
    
      git tag -s gnupg-2.n.m
      ./autogen.sh --force
      cd ~/b/gnupg
      ~/s/gnupg/configure --enable-maintainer-mode
      make distcheck
      tar xJf gnupg-2.n.m.tar.bz2
      make -f gnupg-2.n.m/build-aux/speedo.mk w32-release
      gpg -sbvu KEYID gnupg-2.n.m.tar.bz2
      gpg -sbvu KEYID gnupg-w32-2.n.m-20151008.tar.xz
      gpg -sbvu KEYID gnupg-w32-2.n.m-20151008.exe
      scp gnupg-2.n.m.tar.bz2              $TARGET
      scp gnupg-w32-2.n.m-20151008.tar.xz  $TARGET
      scp gnupg-w32-2.n.m-20151008.exe     $TARGET

diff --git a/build-aux/speedo.mk b/build-aux/speedo.mk
index dc949ba..cd3a66d 100644
--- a/build-aux/speedo.mk
+++ b/build-aux/speedo.mk
@@ -57,6 +57,7 @@ help:
 	@echo '  native-gui     Ditto but with pinentry and GPA'
 	@echo '  w32-installer  Build a Windows installer'
 	@echo '  w32-source     Pack a source archive'
+	@echo '  w32-release    Build a Windows release'
 	@echo
 	@echo 'You may append INSTALL_PREFIX=<dir> for native builds.'
 	@echo 'Prepend TARGET with "git-" to build from GIT repos.'
@@ -104,6 +105,11 @@ this-w32-source: check-tools
 	$(SPEEDOMAKE) TARGETOS=w32    WHAT=this    WITH_GUI=0 \
 	                                           CUSTOM_SWDB=1 dist-source
 
+w32-release: check-tools
+	$(SPEEDOMAKE) TARGETOS=w32 WHAT=release    WITH_GUI=0 SELFCHECK=0 \
+                                                   installer-from-source
+
+
 
 # Set this to "git" to build from git,
 #          to "release" from tarballs,
@@ -1050,7 +1056,7 @@ clean-speedo:
 # {{{
 ifeq ($(TARGETOS),w32)
 
-dist-source: all
+dist-source: installer
 	for i in 00 01 02 03; do sleep 1;touch PLAY/stamps/stamp-*-${i}-*;done
 	(set -e;\
 	 tarname="$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar" ;\
@@ -1061,6 +1067,7 @@ dist-source: all
 	 tar --totals -rf "$$tarname" --exclude-backups --exclude-vc \
               --transform='s,^,$(INST_NAME)-$(INST_VERSION)/,' \
 	     PLAY/stamps/stamp-*-00-unpack PLAY/src swdb.lst swdb.lst.sig ;\
+	 [ -f "$$tarname".xz ] && rm "$$tarname".xz;\
          xz "$$tarname" ;\
 	)
 
@@ -1112,6 +1119,18 @@ installer: all w32_insthelpers $(w32src)/inst-options.ini $(bdir)/README.txt
 		    $(extra_installer_options) $(w32src)/inst.nsi
 	@echo "Ready: $(idir)/$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe"
 
+# Build the installer from the source tarball.
+installer-from-source: dist-source
+	(set -e;\
+	 [ -d PLAY-release ] && rm -rf PLAY-release; \
+	 mkdir PLAY-release;\
+	 cd PLAY-release; \
+	 tar xJf "../$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).tar.xz";\
+	 cd $(INST_NAME)-$(INST_VERSION); \
+         $(MAKE) -f build-aux/speedo.mk this-w32-installer SELFCHECK=0;\
+	 mv "PLAY/inst/$(INST_NAME)-$(INST_VERSION)_$(BUILD_DATESTR).exe" ../.. ;\
+	)
+
 endif
 # }}} W32
 

commit 4c298525903f844eee95ecbcdc45f5ac034fa148
Author: Werner Koch <wk at gnupg.org>
Date:   Thu Oct 8 16:42:14 2015 +0200

    common: Allow building of mkdir_p.c for Windows.
    
    * common/mkdir_p.c: Change license and comment debug statements.
    (amkdir_p, mkdir_p): Fail on malloc error and use default_errsource to
    build an error code.  Change return value to gpg_error_t.
    (amkdir_p): Use gnupg_mkdir.
    
    * common/membuf.c: Include util.h first to avoid redefined macro
    warnings.
    
    Signed-off-by: Werner Koch <wk at gnupg.org>

diff --git a/common/membuf.c b/common/membuf.c
index cc7772f..f4430a9 100644
--- a/common/membuf.c
+++ b/common/membuf.c
@@ -33,9 +33,8 @@
 #include <errno.h>
 #include <stdarg.h>
 
-#include "membuf.h"
-
 #include "util.h"
+#include "membuf.h"
 
 
 /* A simple implementation of a dynamic buffer.  Use init_membuf() to
diff --git a/common/mkdir_p.c b/common/mkdir_p.c
index 53c3f0f..42469f8 100644
--- a/common/mkdir_p.c
+++ b/common/mkdir_p.c
@@ -3,12 +3,22 @@
  *
  * This file is part of GnuPG.
  *
- * GnuPG 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
- * (at your option) any later version.
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of either
  *
- * GnuPG is distributed in the hope that it will be useful,
+ *   - the GNU Lesser General Public License as published by the Free
+ *     Software Foundation; either version 3 of the License, or (at
+ *     your option) any later version.
+ *
+ * or
+ *
+ *   - 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.
+ *
+ * or both in parallel, as here.
+ *
+ * This file 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.
@@ -23,28 +33,30 @@
 #include <assert.h>
 #include <stdarg.h>
 
-#include "mkdir_p.h"
+#include "util.h"
 #include "stringhelp.h"
 #include "logging.h"
-#include "util.h"
+#include "sysutils.h"
+#include "mkdir_p.h"
 
-#define DEBUG 0
 
-int
+gpg_error_t
 amkdir_p (char **directory_components)
 {
+  gpg_error_t err = 0;
   int count;
   char **dirs;
   int i;
-  int rc = 0;
 
   for (count = 0; directory_components[count]; count ++)
     ;
 
-  if (DEBUG)
-    log_debug ("%s: %d directory components.\n", __func__, count);
+  /* log_debug ("%s: %d directory components.\n", __func__, count); */
+
+  dirs = xtrycalloc (count, sizeof (char *));
+  if (!dirs)
+    return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
 
-  dirs = xcalloc (count, sizeof (char *));
   for (i = 0; directory_components[i]; i ++)
     {
       if (i == 0)
@@ -52,41 +64,39 @@ amkdir_p (char **directory_components)
       else
 	dirs[i] = make_filename (dirs[i - 1], directory_components[i], NULL);
 
-      if (DEBUG)
-	log_debug ("%s: Directory %d: `%s'.\n", __func__, i, dirs[i]);
+      /* log_debug ("%s: Directory %d: `%s'.\n", __func__, i, dirs[i]); */
     }
 
   for (i = count - 1; i >= 0; i --)
     {
       struct stat s;
 
-      if (DEBUG)
-	log_debug ("%s: stat(%s)\n", __func__, dirs[i]);
-
-      rc = stat (dirs[i], &s);
-      if (rc == 0 && ! S_ISDIR (s.st_mode))
-	{
-	  if (DEBUG)
-	    log_debug ("%s: %s exists, but is not a directory!\n",
-		       __func__, dirs[i]);
-	  rc = gpg_error (GPG_ERR_ENOTDIR);
-	  goto out;
-	}
-      else if (rc == 0)
-	{
-	  /* Got a directory.  */
-	  if (DEBUG)
-	    log_debug ("%s: %s exists and is a directory!\n",
-		       __func__, dirs[i]);
-	  break;
-	}
+      /* log_debug ("%s: stat(%s)\n", __func__, dirs[i]); */
+
+      if (!stat (dirs[i], &s))
+        {
+          if ( ! S_ISDIR (s.st_mode))
+            {
+              /* log_debug ("%s: %s exists, but is not a directory!\n", */
+              /*            __func__, dirs[i]); */
+              err = gpg_err_make (default_errsource, GPG_ERR_ENOTDIR);
+              goto out;
+            }
+          else
+            {
+              /* Got a directory.  */
+              /* log_debug ("%s: %s exists and is a directory!\n",  */
+              /*            __func__, dirs[i]); */
+              err = 0;
+              break;
+            }
+        }
       else if (errno == ENOENT)
 	/* This directory does not exist yet.  Continue walking up the
 	   hierarchy.  */
 	{
-	  if (DEBUG)
-	    log_debug ("%s: %s does not exist!\n",
-		       __func__, dirs[i]);
+          /* log_debug ("%s: %s does not exist!\n", */
+          /*            __func__, dirs[i]); */
 	  continue;
 	}
       else
@@ -94,10 +104,9 @@ amkdir_p (char **directory_components)
 	   (we return this above), which means that a component of the
 	   path prefix is not a directory.  */
 	{
-	  if (DEBUG)
-	    log_debug ("%s: stat(%s) => %s!\n",
-		       __func__, dirs[i], strerror (errno));
-	  rc = gpg_error_from_syserror ();
+          /* log_debug ("%s: stat(%s) => %s!\n", */
+          /*            __func__, dirs[i], strerror (errno)); */
+	  err = gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
 	  goto out;
 	}
     }
@@ -108,13 +117,11 @@ amkdir_p (char **directory_components)
 
   for (; i < count; i ++)
     {
-      if (DEBUG)
-	log_debug ("Creating directory: %s\n", dirs[i]);
+      /* log_debug ("Creating directory: %s\n", dirs[i]); */
 
-      rc = mkdir (dirs[i], S_IRUSR | S_IWUSR | S_IXUSR);
-      if (rc)
+      if (gnupg_mkdir (dirs[i], "-rwx"))
 	{
-	  rc = gpg_error_from_syserror ();
+	  err = gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
 	  goto out;
 	}
     }
@@ -124,20 +131,24 @@ amkdir_p (char **directory_components)
     xfree (dirs[i]);
   xfree (dirs);
 
-  if (DEBUG)
-    log_debug ("%s: Returning %s\n", __func__, gpg_strerror (rc));
+  /* log_debug ("%s: Returning %s\n", __func__, gpg_strerror (rc)); */
 
-  return rc;
+  return err;
 }
 
-int
+
+gpg_error_t
 mkdir_p (char *directory_component, ...)
 {
   va_list ap;
+  gpg_error_t err = 0;
   int i;
   int space = 1;
-  char **dirs = xmalloc (space * sizeof (char *));
-  int rc;
+  char **dirs;
+
+  dirs = xtrymalloc (space * sizeof (char *));
+  if (!dirs)
+    return gpg_err_make (default_errsource, gpg_err_code_from_syserror ());
 
   dirs[0] = directory_component;
 
@@ -146,16 +157,26 @@ mkdir_p (char *directory_component, ...)
     {
       if (i == space)
 	{
+          char **tmp_dirs;
+
 	  space = 2 * space;
-	  dirs = xrealloc (dirs, space * sizeof (char *));
+	  tmp_dirs = xtryrealloc (dirs, space * sizeof (char *));
+          if (!tmp_dirs)
+            {
+              err = gpg_err_make (default_errsource,
+                                  gpg_err_code_from_syserror ());
+              break;
+            }
+          dirs = tmp_dirs;
 	}
       dirs[i] = va_arg (ap, char *);
     }
   va_end (ap);
 
-  rc = amkdir_p (dirs);
+  if (!err)
+    err = amkdir_p (dirs);
 
   xfree (dirs);
 
-  return rc;
+  return err;
 }
diff --git a/common/mkdir_p.h b/common/mkdir_p.h
index ddf412b..0a6cf3d 100644
--- a/common/mkdir_p.h
+++ b/common/mkdir_p.h
@@ -3,12 +3,22 @@
  *
  * This file is part of GnuPG.
  *
- * GnuPG 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
- * (at your option) any later version.
+ * This file is free software; you can redistribute it and/or modify
+ * it under the terms of either
  *
- * GnuPG is distributed in the hope that it will be useful,
+ *   - the GNU Lesser General Public License as published by the Free
+ *     Software Foundation; either version 3 of the License, or (at
+ *     your option) any later version.
+ *
+ * or
+ *
+ *   - 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.
+ *
+ * or both in parallel, as here.
+ *
+ * This file 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.
@@ -29,7 +39,7 @@
    first try to create the directory "foo/bar" and then the directory
    "foo/bar/xyzzy".  On success returns 0, otherwise an error code is
    returned.  */
-int mkdir_p (char *directory_component, ...) GPGRT_ATTR_SENTINEL(0);
+gpg_error_t mkdir_p (char *directory_component, ...) GPGRT_ATTR_SENTINEL(0);
 
 /* Like mkdir_p, but DIRECTORY_COMPONENTS is a NULL terminated
    array, e.g.:
@@ -37,6 +47,6 @@ int mkdir_p (char *directory_component, ...) GPGRT_ATTR_SENTINEL(0);
      char **dirs = { "foo", "bar", NULL };
      amkdir_p (dirs);
  */
-int amkdir_p (char **directory_components);
+gpg_error_t amkdir_p (char **directory_components);
 
 #endif

-----------------------------------------------------------------------

Summary of changes:
 build-aux/speedo.mk |  21 ++++++++-
 common/membuf.c     |   3 +-
 common/mkdir_p.c    | 133 ++++++++++++++++++++++++++++++----------------------
 common/mkdir_p.h    |  24 +++++++---
 4 files changed, 115 insertions(+), 66 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list