[git] GnuPG - branch, master, updated. gnupg-2.1.15-218-gcbbf0a7

by Justus Winter cvs at cvs.gnupg.org
Fri Oct 7 16:26:22 CEST 2016


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  cbbf0a7a8da1757fea29cff0daaa42a6bbb95b26 (commit)
       via  1f76f8d8bc65fad98927c977baf4d5e36dafe52b (commit)
       via  11eac7eb2fa3392a9aa052f8f5bb9875129ab84b (commit)
       via  dff266059813d22d1e2ba7e77279999cd41ceb75 (commit)
       via  5afbfdfd59540cb882d891ff1f4afa73fe48f99a (commit)
      from  fb3b3e1e7a4219f61a834fd07809898918611c2f (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 cbbf0a7a8da1757fea29cff0daaa42a6bbb95b26
Author: Justus Winter <justus at g10code.com>
Date:   Fri Oct 7 16:17:49 2016 +0200

    tests: Rework test environment setup.
    
    * tests/openpgp/setup.scm: Import one keyring at a time.  This works
    around a yet to be investigated hang on Windows.  It is also much
    prettier.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/openpgp/setup.scm b/tests/openpgp/setup.scm
index 0a9a153..75310d1 100755
--- a/tests/openpgp/setup.scm
+++ b/tests/openpgp/setup.scm
@@ -84,11 +84,12 @@
 		 "C6A6390E9388CDBAD71EAEA698233FE5E04F001E"
 		 "D69102E0F5AC6B6DB8E4D16DA8E18CF46D88CAE3"))
 
-  (info "Importing public demo and test keys")
-  (call-check `(, at GPG --yes --import
-		      ,(in-srcdir "pubdemo.asc")
-		      ,(in-srcdir "pubring.asc")
-		      ,(in-srcdir key-file1)))
+  (for-each-p
+   "Importing public demo and test keys"
+   (lambda (file)
+     (call-check `(, at GPG --yes --import ,(in-srcdir file))))
+   (list "pubdemo.asc" "pubring.asc" key-file1))
+
   (pipe:do
    (pipe:open (in-srcdir "pubring.pkr.asc") (logior O_RDONLY O_BINARY))
    (pipe:spawn `(, at GPG --dearmor))

commit 1f76f8d8bc65fad98927c977baf4d5e36dafe52b
Author: Justus Winter <justus at g10code.com>
Date:   Fri Oct 7 16:16:15 2016 +0200

    tests: Improve handling of Windows newlines.
    
    * tests/gpgscm/lib.scm (string-split-newlines): New function.
    * tests/openpgp/default-key.scm: Use new function.
    * tests/openpgp/defs.scm: Likewise.
    * tests/openpgp/export.scm: Likewise.
    * tests/openpgp/import.scm: Likewise.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/lib.scm b/tests/gpgscm/lib.scm
index fe28262..e4ab483 100644
--- a/tests/gpgscm/lib.scm
+++ b/tests/gpgscm/lib.scm
@@ -92,6 +92,15 @@
 (assert (string=? "bar" (cadr (string-split "foo:bar:baz" #\:))))
 (assert (string=? "baz" (caddr (string-split "foo:bar:baz" #\:))))
 
+;; Split haystack at newlines.
+(define (string-split-newlines haystack)
+  (if *win32*
+      (map (lambda (line) (if (string-suffix? line "\r")
+			      (substring line 0 (- (string-length line) 1))
+			      line))
+	   (string-split haystack #\newline))
+      (string-split haystack #\newline)))
+
 ;; Trim the prefix of S containing only characters that make PREDICATE
 ;; true.
 (define (string-ltrim predicate s)
diff --git a/tests/openpgp/default-key.scm b/tests/openpgp/default-key.scm
index 4433658..07cc8c0 100755
--- a/tests/openpgp/default-key.scm
+++ b/tests/openpgp/default-key.scm
@@ -71,6 +71,6 @@
 	(unless (any (lambda (line)
 		       (and (string-prefix? line ":pubkey enc packet:")
 			    (string-suffix? line "45117079")))
-		     (string-split c #\newline))
+		     (string-split-newlines c))
 	    (exit 1))))))
  '("8BC90111" "3E880CFF" "F5F77B83" "45117079" "1EA97479"))
diff --git a/tests/openpgp/defs.scm b/tests/openpgp/defs.scm
index 4a968da..e484e86 100644
--- a/tests/openpgp/defs.scm
+++ b/tests/openpgp/defs.scm
@@ -91,7 +91,7 @@
 (define (gpg-with-colons args)
   (let ((s (call-popen `(, at GPG --with-colons , at args) "")))
     (map (lambda (line) (string-split line #\:))
-	 (string-split s #\newline))))
+	 (string-split-newlines s))))
 
 (define (get-config what)
   (string-split (caddar (gpg-with-colons `(--list-config ,what))) #\;))
@@ -133,8 +133,8 @@
    (lambda (line)
      (let ((p (string-split line #\:)))
        (list (string->number (cadr p)) (caddr p))))
-   (string-split
-    (call-popen `(, at GPG --with-colons , at args) input) #\newline)))
+   (string-split-newlines
+    (call-popen `(, at GPG --with-colons , at args) input))))
 
 ;; Dearmor a file.
 (define (dearmor source-name sink-name)
diff --git a/tests/openpgp/export.scm b/tests/openpgp/export.scm
index 8291705..f7a23f4 100755
--- a/tests/openpgp/export.scm
+++ b/tests/openpgp/export.scm
@@ -37,13 +37,13 @@
 		    "Signature packet not found"))
 
 (define (check-exported-public-key packet-dump keyid)
-  (let ((dump (string-split packet-dump #\newline)))
+  (let ((dump (string-split-newlines packet-dump)))
     (check-for (lambda (l) (string-prefix? l ":public key packet:")) dump
 	       "Public key packet not found")
     (check-exported-key dump keyid)))
 
 (define (check-exported-private-key packet-dump keyid)
-  (let ((dump (string-split packet-dump #\newline)))
+  (let ((dump (string-split-newlines packet-dump)))
     (check-for (lambda (l) (string-prefix? l ":secret key packet:")) dump
 	       "Secret key packet not found")
     (check-exported-key dump keyid)))
diff --git a/tests/openpgp/import.scm b/tests/openpgp/import.scm
index 580acea..98f3ad9 100755
--- a/tests/openpgp/import.scm
+++ b/tests/openpgp/import.scm
@@ -36,7 +36,7 @@
     (unless (any (lambda (line)
 		   (and (string-prefix? line "rvk:")
 			(string-contains? line ":0EE5BE979282D80B9F7540F1CCD2ED94D21739E9:")))
-		 (string-split c #\newline))
+		 (string-split-newlines c))
 	    (exit 1)))))
 
 (define fpr1 "9E669861368BCA0BE42DAF7DDDA252EBB8EBE1AF")
@@ -55,6 +55,6 @@
 		 (lambda (line)
 		   (and (string-prefix? line "pub:")
 			(string-contains? line ":4096:1:DDA252EBB8EBE1AF:")))
-		 (string-split c #\newline))))
+		 (string-split-newlines c))))
       (unless (= 2 (length keys))
 	      (error "Importing keys with long id collision failed"))))))

commit 11eac7eb2fa3392a9aa052f8f5bb9875129ab84b
Author: Justus Winter <justus at g10code.com>
Date:   Fri Oct 7 16:13:08 2016 +0200

    gpgscm: Improve test of low-level functions.
    
    * tests/gpgscm/t-child.c: Print large amounts of data.
    * tests/gpgscm/t-child.scm: Test that this works.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/t-child.c b/tests/gpgscm/t-child.c
index fe2e7b4..ae1a635 100644
--- a/tests/gpgscm/t-child.c
+++ b/tests/gpgscm/t-child.c
@@ -30,6 +30,8 @@
 int
 main (int argc, char **argv)
 {
+  char buffer[4096];
+  memset (buffer, 'A', sizeof buffer);
 #if _WIN32
   if (! setmode (stdin, O_BINARY))
     return 23;
@@ -49,10 +51,16 @@ main (int argc, char **argv)
     fprintf (stdout, "hello");
   else if (strcmp (argv[1], "hello_stderr") == 0)
     fprintf (stderr, "hello");
+  else if (strcmp (argv[1], "stdout4096") == 0)
+    fwrite (buffer, 1, sizeof buffer, stdout);
+  else if (strcmp (argv[1], "stdout8192") == 0)
+    {
+      fwrite (buffer, 1, sizeof buffer, stdout);
+      fwrite (buffer, 1, sizeof buffer, stdout);
+    }
   else if (strcmp (argv[1], "cat") == 0)
     while (! feof (stdin))
       {
-        char buffer[4096];
         size_t bytes_read;
         bytes_read = fread (buffer, 1, sizeof buffer, stdin);
         fwrite (buffer, 1, bytes_read, stdout);
diff --git a/tests/gpgscm/t-child.scm b/tests/gpgscm/t-child.scm
index 27928f6..93208f4 100644
--- a/tests/gpgscm/t-child.scm
+++ b/tests/gpgscm/t-child.scm
@@ -22,6 +22,8 @@
 (define (qualify executable)
   (string-append executable (getenv "EXEEXT")))
 
+(define child (qualify "t-child"))
+
 (assert (= 0 (call `(,(qualify "t-child") "return0"))))
 (assert (= 1 (call `(,(qualify "t-child") "return1"))))
 (assert (= 77 (call `(,(qualify "t-child") "return77"))))
@@ -51,6 +53,16 @@
   (assert (string=? "" (:stdout r)))
   (assert (string=? "hello" (:stderr r))))
 
+(let ((r (call-with-io `(,(qualify "t-child") "stdout4096") "")))
+  (assert (= 0 (:retcode r)))
+  (assert (= 4096 (string-length (:stdout r))))
+  (assert (string=? "" (:stderr r))))
+
+(let ((r (call-with-io `(,(qualify "t-child") "stdout8192") "")))
+  (assert (= 0 (:retcode r)))
+  (assert (= 8192 (string-length (:stdout r))))
+  (assert (string=? "" (:stderr r))))
+
 (let ((r (call-with-io `(,(qualify "t-child") "cat") "hellohello")))
   (assert (= 0 (:retcode r)))
   (assert (string=? "hellohello" (:stdout r)))
@@ -90,4 +102,17 @@
 	   (wait-processes '("child0" "child1") (list pid0 pid1) #t))))
 (echo " world.")
 
+(tr:do
+ (tr:pipe-do
+  (pipe:spawn `(,child stdout4096))
+  (pipe:spawn `(,child cat)))
+ (tr:call-with-content (lambda (c)
+			 (assert (= 4096 (length c))))))
+(tr:do
+ (tr:pipe-do
+  (pipe:spawn `(,child stdout8192))
+  (pipe:spawn `(,child cat)))
+ (tr:call-with-content (lambda (c)
+			 (assert (= 8192 (length c))))))
+
 (echo "All good.")

commit dff266059813d22d1e2ba7e77279999cd41ceb75
Author: Justus Winter <justus at g10code.com>
Date:   Fri Oct 7 12:53:25 2016 +0200

    gpgscm: Improve path handling.
    
    * tests/gpgscm/ffi.c (ffi_init): New Scheme variable '*win32*'.
    * tests/gpgscm/tests.scm (canonical-path): Correctly handle paths with
    drive letter on Windows.  Use 'path-join'.
    (path-expand): Use 'path-join'.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tests/gpgscm/ffi.c b/tests/gpgscm/ffi.c
index 44db6bb..a0fbe2e 100644
--- a/tests/gpgscm/ffi.c
+++ b/tests/gpgscm/ffi.c
@@ -1276,6 +1276,15 @@ ffi_init (scheme *sc, const char *argv0, const char *scriptname,
   ffi_define (sc, "*pathsep*", sc->vptr->mk_character (sc, ':'));
 #endif
 
+  ffi_define (sc, "*win32*",
+#if _WIN32
+              sc->T
+#else
+              sc->F
+#endif
+              );
+
+
   ffi_define (sc, "*stdin*",
               sc->vptr->mk_port_from_file (sc, stdin, port_input));
   ffi_define (sc, "*stdout*",
diff --git a/tests/gpgscm/tests.scm b/tests/gpgscm/tests.scm
index 71ca369..8986a70 100644
--- a/tests/gpgscm/tests.scm
+++ b/tests/gpgscm/tests.scm
@@ -181,9 +181,15 @@
 (assert (string=? (path-join "" "bar" "baz") "bar/baz"))
 
 (define (canonical-path path)
-  (if (char=? #\/ (string-ref path 0))
+  (if (or (char=? #\/ (string-ref path 0))
+	  (and *win32* (char=? #\\ (string-ref path 0)))
+	  (and *win32*
+	       (char-alphabetic? (string-ref path 0))
+	       (char=? #\: (string-ref path 1))
+	       (or (char=? #\/ (string-ref path 2))
+		   (char=? #\\ (string-ref path 2)))))
       path
-      (string-append (getcwd) "/" path)))
+      (path-join (getcwd) path)))
 
 (define (in-srcdir . names)
   (canonical-path (apply path-join (cons (getenv "srcdir") names))))
@@ -194,7 +200,7 @@
   (let loop ((path paths))
     (if (null? path)
 	(throw "Could not find" name "in" paths)
-	(let* ((qualified-name (string-append (car path) "/" name))
+	(let* ((qualified-name (path-join (car path) name))
 	       (file-exists (call-with-input-file qualified-name
 			      (lambda (x) #t))))
 	  (if file-exists

commit 5afbfdfd59540cb882d891ff1f4afa73fe48f99a
Author: Justus Winter <justus at g10code.com>
Date:   Fri Oct 7 12:52:09 2016 +0200

    tools: Fix error handling.
    
    * tools/gpgtar-create.c (gpgtar_create): Do not crash if opening the
    tarball failed.
    
    Signed-off-by: Justus Winter <justus at g10code.com>

diff --git a/tools/gpgtar-create.c b/tools/gpgtar-create.c
index 6adc1f5..6780eff 100644
--- a/tools/gpgtar-create.c
+++ b/tools/gpgtar-create.c
@@ -853,8 +853,6 @@ gpgtar_create (char **inpattern, int encrypt, int sign)
       if (!outstream)
         {
           err = gpg_error_from_syserror ();
-          log_error (_("can't create '%s': %s\n"),
-                     opt.outfile, gpg_strerror (err));
           goto leave;
         }
     }
@@ -958,7 +956,7 @@ gpgtar_create (char **inpattern, int encrypt, int sign)
   if (err)
     {
       log_error ("creating tarball '%s' failed: %s\n",
-                 es_fname_get (outstream), gpg_strerror (err));
+                 opt.outfile ? opt.outfile : "-", gpg_strerror (err));
       if (outstream && outstream != es_stdout)
         es_fclose (outstream);
       if (cipher_stream && cipher_stream != es_stdout)

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

Summary of changes:
 tests/gpgscm/ffi.c            |  9 +++++++++
 tests/gpgscm/lib.scm          |  9 +++++++++
 tests/gpgscm/t-child.c        | 10 +++++++++-
 tests/gpgscm/t-child.scm      | 25 +++++++++++++++++++++++++
 tests/gpgscm/tests.scm        | 12 +++++++++---
 tests/openpgp/default-key.scm |  2 +-
 tests/openpgp/defs.scm        |  6 +++---
 tests/openpgp/export.scm      |  4 ++--
 tests/openpgp/import.scm      |  4 ++--
 tests/openpgp/setup.scm       | 11 ++++++-----
 tools/gpgtar-create.c         |  4 +---
 11 files changed, 76 insertions(+), 20 deletions(-)


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




More information about the Gnupg-commits mailing list