You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2023/02/23 07:23:10 UTC

[maven-assembly-plugin] branch MASSEMBLY-941_2 created (now 8b2885d5)

This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a change to branch MASSEMBLY-941_2
in repository https://gitbox.apache.org/repos/asf/maven-assembly-plugin.git


      at 8b2885d5 [MASSEMBLY-941] improve IT description to ease failure investigations

This branch includes the following new commits:

     new 8b2885d5 [MASSEMBLY-941] improve IT description to ease failure investigations

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven-assembly-plugin] 01/01: [MASSEMBLY-941] improve IT description to ease failure investigations

Posted by hb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MASSEMBLY-941_2
in repository https://gitbox.apache.org/repos/asf/maven-assembly-plugin.git

commit 8b2885d523c8cc07731bb9a44984bddfd995c55c
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Thu Feb 23 08:22:47 2023 +0100

    [MASSEMBLY-941] improve IT description to ease failure investigations
---
 src/it/projects/reproducible/verify.groovy       | 31 ++++++++++++++++++++++--
 src/it/projects/reproducible/zip-content-755.txt |  5 ++++
 src/it/projects/reproducible/zip-content-775.txt |  5 ++++
 src/it/projects/reproducible/zip-content-win.txt |  5 ++++
 4 files changed, 44 insertions(+), 2 deletions(-)

diff --git a/src/it/projects/reproducible/verify.groovy b/src/it/projects/reproducible/verify.groovy
index b706e3df..61cdc328 100644
--- a/src/it/projects/reproducible/verify.groovy
+++ b/src/it/projects/reproducible/verify.groovy
@@ -27,10 +27,29 @@ assert deployDir.exists()
 
 ZipFile zip = new ZipFile( new File( deployDir, "reproducible-1.0-src.zip" ) )
 StringBuilder sb = new StringBuilder()
+StringBuilder sb2 = new StringBuilder()
+int i = 0
 for( ZipArchiveEntry entry : zip.getEntries() )
 {
     sb.append( String.format("%o %s\n", entry.getUnixMode(), entry.getName() ) )
+    switch (++i)
+    {
+        case 1:
+            sb2.append( String.format(" directory: %o\n", entry.getUnixMode() ) )
+            break
+        case 9:
+            sb2.append( String.format("      file: %o\n", entry.getUnixMode() ) )
+            break
+        case 21:
+            sb2.append( String.format("executable: %o\n", entry.getUnixMode() ) )
+            break
+        default:
+            break
+    }
 }
+sb.append( '\n' )
+sb.append( sb2.toString() )
+sb.append( '\n' )
 for( String type : [ "zip", "jar", "tar" ] )
 {
     String name = "reproducible-1.0-src." + type + ".sha1"
@@ -40,9 +59,17 @@ for( String type : [ "zip", "jar", "tar" ] )
 effective = sb.toString()
 
 // 3 different reference results:
-// 1. Windows does not support executable flag
-// 2. on *nix, based on system configuration, group flag differs
+// 1. Windows does not support executable flag:
+//    => reference result is zip-content-win.txt: directory=40755, file=100644, executable=100644
+// 2. on *nix, based on system configuration, group flag differs based on umask:
+//    - umask == 002: many Linux distro and MacOS create group writable files/directories:
+//      => reference result is zip-content-775.txt: directory=40775, file=100664, executable=100775
+//    - umask == 022: some Linux distros like Fedora is create group read-only files/directories:
+//      => reference result is zip-content-755.txt: directory=40755, file=100644, executable=100755
 reference = "zip-content-" + ( effective.contains( "644 executable" ) ? "win" : effective.contains( "0775" ) ? "775" : "755" ) + ".txt"
 content = new File( basedir, reference ).text.replace( "\r\n", "\n" )
 
+println( 'effective content:' )
+println( effective )
+println( 'comparing against reference ' + reference )
 assert content == effective
diff --git a/src/it/projects/reproducible/zip-content-755.txt b/src/it/projects/reproducible/zip-content-755.txt
index 92aa7ecb..636f3181 100644
--- a/src/it/projects/reproducible/zip-content-755.txt
+++ b/src/it/projects/reproducible/zip-content-755.txt
@@ -20,6 +20,11 @@
 100644 dir-d/d.txt
 100755 executable.txt
 100644 lowercase.txt
+
+ directory: 40755
+      file: 100644
+executable: 100755
+
 97d0ea3b4a87cd3ea78edd1c3c25914d69ea97f3 reproducible-1.0-src.zip.sha1
 a0c4cf1ed244e60221e12367f50ff676066b8e65 reproducible-1.0-src.jar.sha1
 bf93dd529253157352b87097d9d23eba8c9ca61a reproducible-1.0-src.tar.sha1
diff --git a/src/it/projects/reproducible/zip-content-775.txt b/src/it/projects/reproducible/zip-content-775.txt
index cb672762..8e3cce3d 100644
--- a/src/it/projects/reproducible/zip-content-775.txt
+++ b/src/it/projects/reproducible/zip-content-775.txt
@@ -20,6 +20,11 @@
 100664 dir-d/d.txt
 100775 executable.txt
 100664 lowercase.txt
+
+ directory: 40775
+      file: 100664
+executable: 100775
+
 50116502c6107740c2a35ef296b5abda08c5dec7 reproducible-1.0-src.zip.sha1
 cc7e3a984179f63d6b37bc86c61e9cc461c62288 reproducible-1.0-src.jar.sha1
 3efc10ec9c3099ba061e58d5b2a935ba643da237 reproducible-1.0-src.tar.sha1
diff --git a/src/it/projects/reproducible/zip-content-win.txt b/src/it/projects/reproducible/zip-content-win.txt
index 571758ce..333c9fa9 100644
--- a/src/it/projects/reproducible/zip-content-win.txt
+++ b/src/it/projects/reproducible/zip-content-win.txt
@@ -20,6 +20,11 @@
 100644 dir-d/d.txt
 100644 executable.txt
 100644 lowercase.txt
+
+ directory: 40755
+      file: 100644
+executable: 100644
+
 cb1dc226d702733bfa405b7090b74ab7e77bf39e reproducible-1.0-src.zip.sha1
 3b31d88a36985f526fb3fe6ba5987387e4887f23 reproducible-1.0-src.jar.sha1
 b85f960069d6a444f928a87761b63fde60ea687d reproducible-1.0-src.tar.sha1