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 10:59:15 UTC

[maven-assembly-plugin] branch MASSEMBLY-941_2 updated (dc59d64f -> 17bf1a98)

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


 discard dc59d64f [MASSEMBLY-941] improve IT description to ease failure investigations
     new 17bf1a98 [MASSEMBLY-941] improve IT description to ease failure investigations

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (dc59d64f)
            \
             N -- N -- N   refs/heads/MASSEMBLY-941_2 (17bf1a98)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

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.


Summary of changes:
 src/it/projects/reproducible/verify.groovy | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


[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 17bf1a98e4711efecee23dd618537b66e2baa637
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       | 46 ++++++++++++++++++++++--
 src/it/projects/reproducible/zip-content-755.txt |  7 ++++
 src/it/projects/reproducible/zip-content-775.txt |  7 ++++
 src/it/projects/reproducible/zip-content-win.txt |  7 ++++
 4 files changed, 64 insertions(+), 3 deletions(-)

diff --git a/src/it/projects/reproducible/verify.groovy b/src/it/projects/reproducible/verify.groovy
index b706e3df..d96b38ae 100644
--- a/src/it/projects/reproducible/verify.groovy
+++ b/src/it/projects/reproducible/verify.groovy
@@ -27,10 +27,31 @@ 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( 'unix modes summary:\n' )
+sb.append( sb2.toString() )
+sb.append( '\n' )
+sb.append( 'resulting sha1:\n' )
 for( String type : [ "zip", "jar", "tar" ] )
 {
     String name = "reproducible-1.0-src." + type + ".sha1"
@@ -40,9 +61,28 @@ 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 umask system configuration, group write mode differs:
+//    - 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" )
 
-assert content == effective
+println( 'effective content:' )
+println( effective )
+println( 'comparing against reference ' + reference )
+
+index = content.indexOf( 'resulting sha1:' )
+contentMode = content.substring( 0, index )
+contentSha1 = content.substring( index )
+index = content.indexOf( 'resulting sha1:' )
+effectiveMode = effective.substring( 0, index )
+effectiveSha1 = effective.substring( index )
+
+assert contentMode == effectiveMode
+println( 'unix mode ok')
+assert contentSha1 == effectiveSha1
+println( 'sha1 ok')
diff --git a/src/it/projects/reproducible/zip-content-755.txt b/src/it/projects/reproducible/zip-content-755.txt
index 92aa7ecb..4a978b77 100644
--- a/src/it/projects/reproducible/zip-content-755.txt
+++ b/src/it/projects/reproducible/zip-content-755.txt
@@ -20,6 +20,13 @@
 100644 dir-d/d.txt
 100755 executable.txt
 100644 lowercase.txt
+
+unix modes summary:
+ directory: 40755
+      file: 100644
+executable: 100755
+
+resulting sha1:
 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..0fdde3a3 100644
--- a/src/it/projects/reproducible/zip-content-775.txt
+++ b/src/it/projects/reproducible/zip-content-775.txt
@@ -20,6 +20,13 @@
 100664 dir-d/d.txt
 100775 executable.txt
 100664 lowercase.txt
+
+unix modes summary:
+ directory: 40775
+      file: 100664
+executable: 100775
+
+resulting sha1:
 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..1dd4411d 100644
--- a/src/it/projects/reproducible/zip-content-win.txt
+++ b/src/it/projects/reproducible/zip-content-win.txt
@@ -20,6 +20,13 @@
 100644 dir-d/d.txt
 100644 executable.txt
 100644 lowercase.txt
+
+unix modes summary:
+ directory: 40755
+      file: 100644
+executable: 100644
+
+resulting sha1:
 cb1dc226d702733bfa405b7090b74ab7e77bf39e reproducible-1.0-src.zip.sha1
 3b31d88a36985f526fb3fe6ba5987387e4887f23 reproducible-1.0-src.jar.sha1
 b85f960069d6a444f928a87761b63fde60ea687d reproducible-1.0-src.tar.sha1