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 2022/11/26 10:57:09 UTC
[maven-assembly-plugin] branch master updated: MASSEMBLY-941 keep file permission in Reproducible mode (#96)
This is an automated email from the ASF dual-hosted git repository.
hboutemy pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-assembly-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new f42194b6 MASSEMBLY-941 keep file permission in Reproducible mode (#96)
f42194b6 is described below
commit f42194b6c0e49bedad506821e524be076e839a79
Author: Hervé Boutemy <hb...@apache.org>
AuthorDate: Sat Nov 26 11:57:04 2022 +0100
MASSEMBLY-941 keep file permission in Reproducible mode (#96)
[MASSEMBLY-941] keep file permission in Reproducible mode
---
pom.xml | 4 ++--
src/it/projects/reproducible/src/assemble/src.xml | 6 ++---
src/it/projects/reproducible/verify.groovy | 28 +++++++++++++++++++----
src/it/projects/reproducible/zip-content-755.txt | 25 ++++++++++++++++++++
src/it/projects/reproducible/zip-content-775.txt | 25 ++++++++++++++++++++
src/it/projects/reproducible/zip-content-win.txt | 25 ++++++++++++++++++++
6 files changed, 103 insertions(+), 10 deletions(-)
diff --git a/pom.xml b/pom.xml
index ff550a55..0c4d55bf 100644
--- a/pom.xml
+++ b/pom.xml
@@ -30,7 +30,7 @@ under the License.
</parent>
<artifactId>maven-assembly-plugin</artifactId>
- <version>3.4.3-SNAPSHOT</version>
+ <version>3.5.0-SNAPSHOT</version>
<packaging>maven-plugin</packaging>
<name>Apache Maven Assembly Plugin</name>
@@ -175,7 +175,7 @@ under the License.
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-archiver</artifactId>
- <version>4.4.0</version>
+ <version>4.6.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
diff --git a/src/it/projects/reproducible/src/assemble/src.xml b/src/it/projects/reproducible/src/assemble/src.xml
index 3f4ab153..4d5c33ee 100644
--- a/src/it/projects/reproducible/src/assemble/src.xml
+++ b/src/it/projects/reproducible/src/assemble/src.xml
@@ -31,17 +31,17 @@ under the License.
<fileSets>
<fileSet>
<outputDirectory></outputDirectory>
- <directory>src</directory>
+ <directory>src/main/resources</directory>
<filtered>true</filtered>
<lineEnding>lf</lineEnding>
</fileSet>
</fileSets>
- <files>
+ <!--files>
<file>
<source>src/main/resources/executable.txt</source>
<fileMode>0755</fileMode>
<filtered>true</filtered>
<lineEnding>lf</lineEnding>
</file>
- </files>
+ </files-->
</assembly>
diff --git a/src/it/projects/reproducible/verify.groovy b/src/it/projects/reproducible/verify.groovy
index 798c2fb8..b706e3df 100644
--- a/src/it/projects/reproducible/verify.groovy
+++ b/src/it/projects/reproducible/verify.groovy
@@ -18,13 +18,31 @@
* under the License.
*/
-//import java.util.zip.*;
-import org.apache.commons.compress.archivers.zip.*;
+//import java.util.zip.*
+import org.apache.commons.compress.archivers.zip.*
File deployDir = new File( basedir, 'target/repo/org/apache/maven/its/reproducible/1.0' )
assert deployDir.exists()
-assert new File( deployDir, 'reproducible-1.0-src.zip.sha1' ).text == '5ce34fc133d47cbc9c81195877dbe10b9ec7d864'
-assert new File( deployDir, 'reproducible-1.0-src.tar.sha1' ).text == '0b9dc1da069705a93b4954a198c18bd248822bf8'
-assert new File( deployDir, 'reproducible-1.0-src.jar.sha1' ).text == '289cb3ecd418b8099deefb930dc7aa39c06888cb'
+ZipFile zip = new ZipFile( new File( deployDir, "reproducible-1.0-src.zip" ) )
+StringBuilder sb = new StringBuilder()
+for( ZipArchiveEntry entry : zip.getEntries() )
+{
+ sb.append( String.format("%o %s\n", entry.getUnixMode(), entry.getName() ) )
+}
+for( String type : [ "zip", "jar", "tar" ] )
+{
+ String name = "reproducible-1.0-src." + type + ".sha1"
+ sb.append( String.format("%s %s\n", new File( deployDir, name ).text, name ) )
+}
+
+effective = sb.toString()
+
+// 3 different reference results:
+// 1. Windows does not support executable flag
+// 2. on *nix, based on system configuration, group flag differs
+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
diff --git a/src/it/projects/reproducible/zip-content-755.txt b/src/it/projects/reproducible/zip-content-755.txt
new file mode 100644
index 00000000..92aa7ecb
--- /dev/null
+++ b/src/it/projects/reproducible/zip-content-755.txt
@@ -0,0 +1,25 @@
+40755 dir-A/
+40755 dir-C/
+40755 dir-b/
+40755 dir-b/B2/
+40755 dir-b/B4/
+40755 dir-b/b1/
+40755 dir-b/b3/
+40755 dir-d/
+100644 Uppercase.txt
+100644 dir-A/A2.txt
+100644 dir-A/A4.txt
+100644 dir-A/a1.txt
+100644 dir-A/a3.txt
+100644 dir-C/C.txt
+100644 dir-b/B2/B2.txt
+100644 dir-b/B4/B4.txt
+100644 dir-b/b.txt
+100644 dir-b/b1/b1.txt
+100644 dir-b/b3/b3.txt
+100644 dir-d/d.txt
+100755 executable.txt
+100644 lowercase.txt
+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
new file mode 100644
index 00000000..cb672762
--- /dev/null
+++ b/src/it/projects/reproducible/zip-content-775.txt
@@ -0,0 +1,25 @@
+40775 dir-A/
+40775 dir-C/
+40775 dir-b/
+40775 dir-b/B2/
+40775 dir-b/B4/
+40775 dir-b/b1/
+40775 dir-b/b3/
+40775 dir-d/
+100664 Uppercase.txt
+100664 dir-A/A2.txt
+100664 dir-A/A4.txt
+100664 dir-A/a1.txt
+100664 dir-A/a3.txt
+100664 dir-C/C.txt
+100664 dir-b/B2/B2.txt
+100664 dir-b/B4/B4.txt
+100664 dir-b/b.txt
+100664 dir-b/b1/b1.txt
+100664 dir-b/b3/b3.txt
+100664 dir-d/d.txt
+100775 executable.txt
+100664 lowercase.txt
+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
new file mode 100644
index 00000000..571758ce
--- /dev/null
+++ b/src/it/projects/reproducible/zip-content-win.txt
@@ -0,0 +1,25 @@
+40755 dir-A/
+40755 dir-C/
+40755 dir-b/
+40755 dir-b/B2/
+40755 dir-b/B4/
+40755 dir-b/b1/
+40755 dir-b/b3/
+40755 dir-d/
+100644 Uppercase.txt
+100644 dir-A/A2.txt
+100644 dir-A/A4.txt
+100644 dir-A/a1.txt
+100644 dir-A/a3.txt
+100644 dir-C/C.txt
+100644 dir-b/B2/B2.txt
+100644 dir-b/B4/B4.txt
+100644 dir-b/b.txt
+100644 dir-b/b1/b1.txt
+100644 dir-b/b3/b3.txt
+100644 dir-d/d.txt
+100644 executable.txt
+100644 lowercase.txt
+cb1dc226d702733bfa405b7090b74ab7e77bf39e reproducible-1.0-src.zip.sha1
+3b31d88a36985f526fb3fe6ba5987387e4887f23 reproducible-1.0-src.jar.sha1
+b85f960069d6a444f928a87761b63fde60ea687d reproducible-1.0-src.tar.sha1