File 0175-stdlib-Update-contract-of-zip-create.patch of Package erlang

From aade6bda3c4363890ed9e3ae986f291a8a0dd687 Mon Sep 17 00:00:00 2001
From: Hans Bolinder <hasse@erlang.org>
Date: Thu, 12 Sep 2019 08:49:32 +0200
Subject: [PATCH 1/2] stdlib: Update contract of zip:create()

---
 lib/stdlib/doc/src/zip.xml |  4 +++-
 lib/stdlib/src/zip.erl     | 23 +++++++++++------------
 2 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/lib/stdlib/doc/src/zip.xml b/lib/stdlib/doc/src/zip.xml
index bb2ed7727a..0d36478b05 100644
--- a/lib/stdlib/doc/src/zip.xml
+++ b/lib/stdlib/doc/src/zip.xml
@@ -4,7 +4,7 @@
 <erlref>
   <header>
     <copyright>
-      <year>2006</year><year>2016</year>
+      <year>2006</year><year>2019</year>
       <holder>Ericsson AB. All Rights Reserved.</holder>
     </copyright>
     <legalnotice>
@@ -358,6 +358,8 @@
       <name name="create" arity="2"/>
       <name name="create" arity="3"/>
       <fsummary>Create a zip archive with options.</fsummary>
+      <type name="create_option"/>
+      <type name="extension_spec"/>
       <desc>
         <p>Creates a zip archive containing the files specified in
           <c><anno>FileList</anno></c>.</p>
diff --git a/lib/stdlib/src/zip.erl b/lib/stdlib/src/zip.erl
index a922bf3fbe..345e046e4c 100644
--- a/lib/stdlib/src/zip.erl
+++ b/lib/stdlib/src/zip.erl
@@ -1,7 +1,7 @@
 %%
 %% %CopyrightBegin%
 %%
-%% Copyright Ericsson AB 2006-2017. All Rights Reserved.
+%% Copyright Ericsson AB 2006-2019. All Rights Reserved.
 %%
 %% Licensed under the Apache License, Version 2.0 (the "License");
 %% you may not use this file except in compliance with the License.
@@ -191,12 +191,16 @@
 	       zip_comment_length}).
 
 
--type create_option() :: memory | cooked | verbose | {comment, string()}
-                       | {cwd, file:filename()}
-                       | {compress, extension_spec()}
-                       | {uncompress, extension_spec()}.
+-type create_option() :: memory | cooked | verbose
+                       | {comment, Comment ::string()}
+                       | {cwd, CWD :: file:filename()}
+                       | {compress, What :: extension_spec()}
+                       | {uncompress, What :: extension_spec()}.
 -type extension() :: string().
--type extension_spec() :: all | [extension()] | {add, [extension()]} | {del, [extension()]}.
+-type extension_spec() :: all
+                        | [Extension :: extension()]
+                        | {add, [Extension :: extension()]}
+                        | {del, [Extension :: extension()]}.
 -type filename() :: file:filename().
 
 -type zip_comment() :: #zip_comment{}.
@@ -429,12 +433,7 @@ zip(F, Files) -> zip(F, Files, []).
       FileSpec :: file:name() | {file:name(), binary()}
                 | {file:name(), binary(), file:file_info()},
       Options  :: [Option],
-      Option   :: memory | cooked | verbose | {comment, Comment}
-                | {cwd, CWD} | {compress, What} | {uncompress, What},
-      What     :: all | [Extension] | {add, [Extension]} | {del, [Extension]},
-      Extension :: string(),
-      Comment  :: string(),
-      CWD      :: file:filename(),
+      Option   :: create_option(),
       RetValue :: {ok, FileName :: file:name()}
                 | {ok, {FileName :: file:name(), binary()}}
                 | {error, Reason :: term()}).
-- 
2.16.4

openSUSE Build Service is sponsored by