maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject [maven-source-plugin] branch MSOURCES-120 updated: display entries Unix mode
Date Sun, 01 Sep 2019 17:39:21 GMT
This is an automated email from the ASF dual-hosted git repository.

hboutemy pushed a commit to branch MSOURCES-120
in repository https://gitbox.apache.org/repos/asf/maven-source-plugin.git


The following commit(s) were added to refs/heads/MSOURCES-120 by this push:
     new 050cdc4  display entries Unix mode
050cdc4 is described below

commit 050cdc4585cd9baface548fdc92844b5c4b39507
Author: Hervé Boutemy <hboutemy@apache.org>
AuthorDate: Sun Sep 1 19:39:17 2019 +0200

    display entries Unix mode
---
 pom.xml                                              |  1 +
 .../reproducible/src/main/resources/executable.txt   | 17 +++++++++++++++++
 src/it/reproducible/verify.groovy                    | 20 +++++++++-----------
 3 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/pom.xml b/pom.xml
index f0f4eec..ec06343 100644
--- a/pom.xml
+++ b/pom.xml
@@ -155,6 +155,7 @@ under the License.
               <configuration>
                 <showErrors>true</showErrors>
                 <debug>false</debug>
+                <addTestClassPath>true</addTestClassPath>
                 <projectsDirectory>src/it</projectsDirectory>
                 <cloneProjectsTo>${project.build.directory}/it</cloneProjectsTo>
                 <pomIncludes>
diff --git a/src/it/reproducible/src/main/resources/executable.txt b/src/it/reproducible/src/main/resources/executable.txt
new file mode 100755
index 0000000..00ae6c0
--- /dev/null
+++ b/src/it/reproducible/src/main/resources/executable.txt
@@ -0,0 +1,17 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+# 
+#   http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
diff --git a/src/it/reproducible/verify.groovy b/src/it/reproducible/verify.groovy
index ef17f2c..5bb9113 100644
--- a/src/it/reproducible/verify.groovy
+++ b/src/it/reproducible/verify.groovy
@@ -18,7 +18,8 @@
  * under the License.
  */
 
-import java.util.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' )
 
@@ -33,22 +34,19 @@ String sha1 = sha1File.text
 StringBuffer r = new StringBuffer()
 r.append( "reproducible-1.0-sources.jar sha1 = $sha1\n\n" )
 
-File zipFile = new File( deployDir, 'reproducible-1.0-sources.jar' )
+File jarFile = new File( deployDir, 'reproducible-1.0-sources.jar' )
 
-r.append( 'M size (cmp) crc        time          name -comment\n' )
+r.append( 'M size (cmp) crc      time          mode   name -comment\n' )
 
-ZipInputStream zis = new ZipInputStream( new FileInputStream( zipFile ) );
-ZipEntry ze = zis.getNextEntry();
-while ( ze != null )
+ZipFile zipFile = new ZipFile( jarFile );
+for ( ZipArchiveEntry zae : zipFile.getEntries() )
 {
-    r.append( sprintf( "%d %4d (%3d) %10d %d %s %s\n", ze.getMethod(), ze.getSize(), ze.getCompressedSize(),
ze.getCrc(), ze.getTime(), ze.getName(), ( ze.getComment() == null ) ? '-' : ze.getComment()
) )
-    ze = zis.getNextEntry();
+    r.append( sprintf( "%d %4d (%3d) %8x %d %6o %s %s\n", zae.getMethod(), zae.getSize(),
zae.getCompressedSize(), zae.getCrc(), zae.getTime(), zae.getUnixMode(), zae.getName(), (
zae.getComment() == null ) ? '-' : zae.getComment() ) )
 }
-zis.closeEntry();
-zis.close();
+zipFile.close();
 
 String buf = r.toString()
 
-String expectedSha1 = System.properties['os.name'].toLowerCase().contains( 'windows' ) ?
'89faedfacb5a645bf956465887744e5f8a3e59a3' : '146d60be5a3e153bbb8c451eb775c989e61c3fe5'
+String expectedSha1 = System.properties['os.name'].toLowerCase().contains( 'windows' ) ?
'89faedfacb5a645bf956465887744e5f8a3e59a3' : 'dab908e6751bac99f5578fcd5cdff5c31032279d'
 
 assert buf.startsWith( "reproducible-1.0-sources.jar sha1 = $expectedSha1" )


Mime
View raw message