[Git][java-team/plexus-archiver][master] 3 commits: Work around maven-resources-plugin bug and remove the test symlinks
Markus Koschany (@apo)
gitlab at salsa.debian.org
Wed Jun 29 18:51:54 BST 2022
Markus Koschany pushed to branch master at Debian Java Maintainers / plexus-archiver
Commits:
69fe9bd2 by Markus Koschany at 2022-06-29T19:35:34+02:00
Work around maven-resources-plugin bug and remove the test symlinks
- - - - -
15435bd7 by Markus Koschany at 2022-06-29T19:49:00+02:00
Add ignore-symlink-tests.patch
- - - - -
3173a3ed by Markus Koschany at 2022-06-29T19:50:10+02:00
Update changelog
- - - - -
4 changed files:
- debian/changelog
- + debian/patches/ignore-symlink-tests.patch
- debian/patches/series
- debian/rules
Changes:
=====================================
debian/changelog
=====================================
@@ -1,3 +1,12 @@
+plexus-archiver (4.2.7-3) unstable; urgency=medium
+
+ * Team upload.
+ * Work around maven-resources-plugin bug
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1013586
+ and remove the test symlinks. (Closes: #1013586)
+
+ -- Markus Koschany <apo at debian.org> Wed, 29 Jun 2022 19:49:10 +0200
+
plexus-archiver (4.2.7-2) unstable; urgency=medium
* Team upload.
=====================================
debian/patches/ignore-symlink-tests.patch
=====================================
@@ -0,0 +1,270 @@
+From: Markus Koschany <apo at debian.org>
+Date: Wed, 29 Jun 2022 19:37:10 +0200
+Subject: ignore symlink tests
+
+Work around a bug in maven-resources-plugin. https://issues.apache.org/jira/browse/MRESOURCES-237
+
+Bug-Debian: https://bugs.debian.org/1013586
+Forwarded: not-needed
+---
+ .../org/codehaus/plexus/archiver/SymlinkTest.java | 100 ---------------------
+ .../zip/PlexusIoZipFileResourceCollectionTest.java | 34 -------
+ .../plexus/archiver/zip/ZipArchiverTest.java | 85 ------------------
+ 3 files changed, 219 deletions(-)
+
+diff --git a/src/test/java/org/codehaus/plexus/archiver/SymlinkTest.java b/src/test/java/org/codehaus/plexus/archiver/SymlinkTest.java
+index 0afb78a..248fb49 100644
+--- a/src/test/java/org/codehaus/plexus/archiver/SymlinkTest.java
++++ b/src/test/java/org/codehaus/plexus/archiver/SymlinkTest.java
+@@ -15,103 +15,3 @@
+ /**
+ * @author Kristian Rosenvold
+ */
+-public class SymlinkTest
+- extends PlexusTestCase
+-{
+-
+- public void testSymlinkDir()
+- throws IOException
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- File dummyContent = getTestFile( "src/test/resources/symlinks/src/symDir" );
+- assertTrue( dummyContent.isDirectory() );
+- assertTrue( Files.isSymbolicLink( dummyContent.toPath() ) );
+- }
+- }
+-
+- public void testSymlinkDirWithSlash()
+- throws IOException
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- File dummyContent = getTestFile( "src/test/resources/symlinks/src/symDir/" );
+- assertTrue( dummyContent.isDirectory() );
+- assertTrue( Files.isSymbolicLink( dummyContent.toPath() ) );
+- }
+- }
+-
+- public void testSymlinkFile()
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- File dummyContent = getTestFile( "src/test/resources/symlinks/src/symR" );
+- assertFalse( dummyContent.isDirectory() );
+- assertTrue( Files.isSymbolicLink( dummyContent.toPath() ) );
+- }
+- }
+-
+- public void testSymlinkTar()
+- throws Exception
+- {
+- TarArchiver archiver = (TarArchiver) lookup( Archiver.ROLE, "tar" );
+- archiver.setLongfile( TarLongFileMode.posix );
+-
+- File dummyContent = getTestFile( "src/test/resources/symlinks/src" );
+- archiver.addDirectory( dummyContent );
+- final File archiveFile = new File( "target/output/symlinks.tar" );
+- archiver.setDestFile( archiveFile );
+- archiver.createArchive();
+- File output = getTestFile( "target/output/untaredSymlinks" );
+- output.mkdirs();
+- TarUnArchiver unarchiver = (TarUnArchiver) lookup( UnArchiver.ROLE, "tar" );
+- unarchiver.setSourceFile( archiveFile );
+- unarchiver.setDestFile( output );
+- unarchiver.extract();
+- }
+-
+- public void testSymlinkZip()
+- throws Exception
+- {
+- ZipArchiver archiver = (ZipArchiver) lookup( Archiver.ROLE, "zip" );
+-
+- File dummyContent = getTestFile( "src/test/resources/symlinks/src" );
+- archiver.addDirectory( dummyContent );
+- final File archiveFile = new File( "target/output/symlinks.zip" );
+- archiveFile.delete();
+- archiver.setDestFile( archiveFile );
+- archiver.createArchive();
+-
+- File output = getTestFile( "target/output/unzippedSymlinks" );
+- output.mkdirs();
+- ZipUnArchiver unarchiver = (ZipUnArchiver) lookup( UnArchiver.ROLE, "zip" );
+- unarchiver.setSourceFile( archiveFile );
+- unarchiver.setDestFile( output );
+- unarchiver.extract();
+- }
+-
+- public void testSymlinkDirArchiver()
+- throws Exception
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- DirectoryArchiver archiver = (DirectoryArchiver) lookup( Archiver.ROLE, "dir" );
+-
+- File dummyContent = getTestFile( "src/test/resources/symlinks/src" );
+- archiver.addDirectory( dummyContent );
+- final File archiveFile = new File( "target/output/dirarchiver-symlink" );
+- archiveFile.mkdirs();
+- archiver.setDestFile( archiveFile );
+- archiver.addSymlink( "target/output/dirarchiver-symlink/aNewDir/symlink", "." );
+-
+- archiver.createArchive();
+-
+- File symbolicLink = new File( "target/output/dirarchiver-symlink/symR" );
+- assertTrue( Files.isSymbolicLink( symbolicLink.toPath() ) );
+-
+- symbolicLink = new File( "target/output/dirarchiver-symlink/aDirWithALink/backOutsideToFileX" );
+- assertTrue( Files.isSymbolicLink( symbolicLink.toPath() ) );
+- }
+- }
+-
+-}
+diff --git a/src/test/java/org/codehaus/plexus/archiver/zip/PlexusIoZipFileResourceCollectionTest.java b/src/test/java/org/codehaus/plexus/archiver/zip/PlexusIoZipFileResourceCollectionTest.java
+index 62227e7..cee999e 100644
+--- a/src/test/java/org/codehaus/plexus/archiver/zip/PlexusIoZipFileResourceCollectionTest.java
++++ b/src/test/java/org/codehaus/plexus/archiver/zip/PlexusIoZipFileResourceCollectionTest.java
+@@ -89,40 +89,6 @@ public void testFilesThatAreNotThere()
+ }
+ }
+
+- public void testSymlinkEntries()
+- throws Exception
+- {
+- File testZip = new File( getBasedir(), "src/test/resources/symlinks/symlinks.zip" );
+- Map<String, String> symLinks = new HashMap<String, String>();
+- symLinks.put( "symDir", "targetDir/" );
+- symLinks.put( "symLinkToDirOnTheOutside", "../dirOnTheOutside/" );
+- symLinks.put( "symLinkToTheOutside", "../onTheOutside.txt" );
+- symLinks.put( "symR", "fileR.txt" );
+- symLinks.put( "symW", "fileW.txt" );
+- symLinks.put( "symX", "fileX.txt" );
+- PlexusIoZipFileResourceCollection prc = new PlexusIoZipFileResourceCollection();
+- prc.setFile( testZip );
+- final Iterator<PlexusIoResource> entries = prc.getEntries();
+- while ( entries.hasNext() )
+- {
+- final PlexusIoResource next = entries.next();
+- String symLinkTarget = symLinks.remove( next.getName() );
+- if ( symLinkTarget != null )
+- {
+- assertTrue( next.getName() + " must be symlink", next.isSymbolicLink() );
+- assertTrue( next instanceof SymlinkDestinationSupplier );
+- assertEquals( symLinkTarget,
+- ( (SymlinkDestinationSupplier) next ).getSymlinkDestination() );
+- }
+- else
+- {
+- assertFalse( next.getName() + " must not be symlink", next.isSymbolicLink() );
+- }
+- }
+-
+- assertTrue( symLinks.isEmpty() );
+- }
+-
+ public void testUnarchiveUnicodePathExtra()
+ throws Exception
+ {
+diff --git a/src/test/java/org/codehaus/plexus/archiver/zip/ZipArchiverTest.java b/src/test/java/org/codehaus/plexus/archiver/zip/ZipArchiverTest.java
+index cca135c..5afc280 100644
+--- a/src/test/java/org/codehaus/plexus/archiver/zip/ZipArchiverTest.java
++++ b/src/test/java/org/codehaus/plexus/archiver/zip/ZipArchiverTest.java
+@@ -117,29 +117,6 @@ public void testImplicitPermissions()
+ assertEquals( 0100111, pam.getUnixMode() );
+ }
+
+- public void testOveriddenPermissions()
+- throws IOException
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- File zipFile = getTestFile( "target/output/zip-with-overriden-modes.zip" );
+-
+- ZipArchiver archiver = getZipArchiver( zipFile );
+- archiver.setDefaultDirectoryMode( 0777 );
+- archiver.setDirectoryMode( 0641 );
+- archiver.setFileMode( 0777 );
+- archiver.addDirectory( new File( "src/test/resources/symlinks/src" ) );
+- archiver.createArchive();
+-
+- assertTrue( zipFile.exists() );
+- ZipFile zf = new ZipFile( zipFile );
+- ZipArchiveEntry fizz = zf.getEntry( "symDir" );
+- assertTrue( fizz.isUnixSymlink() );
+- ZipArchiveEntry symR = zf.getEntry( "symR" );
+- assertTrue( symR.isUnixSymlink() );
+- }
+- }
+-
+ public void testCreateArchiveWithDetectedModes()
+ throws Exception
+ {
+@@ -567,68 +544,6 @@ else if ( ze.isUnixSymlink() )
+ }
+ }
+
+- public void testSymlinkZip()
+- throws Exception
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- final File zipFile = getTestFile( "target/output/pasymlinks.zip" );
+- final ZipArchiver zipArchiver = getZipArchiver( zipFile );
+- PlexusIoFileResourceCollection files = new PlexusIoFileResourceCollection();
+- files.setFollowingSymLinks( false );
+- files.setBaseDir( new File( "src/test/resources/symlinks" ) );
+- files.setPrefix( "plexus/" );
+- zipArchiver.addResources( files );
+- zipArchiver.createArchive();
+- final File output = getTestFile( "target/output/unzipped" );
+- output.mkdirs();
+- final ZipUnArchiver zipUnArchiver = getZipUnArchiver( zipFile );
+- zipUnArchiver.setDestFile( output );
+- zipUnArchiver.extract();
+- File symDir = new File( "target/output/unzipped/plexus/src/symDir" );
+- PlexusIoResourceAttributes fa = FileAttributes.uncached( symDir );
+- assertTrue( fa.isSymbolicLink() );
+- }
+- }
+-
+- @SuppressWarnings( "ResultOfMethodCallIgnored" )
+- public void testSymlinkFileSet()
+- throws Exception
+- {
+- if ( !Os.isFamily( Os.FAMILY_WINDOWS ) )
+- {
+- final File zipFile = getTestFile( "target/output/pasymlinks-fileset.zip" );
+- final ZipArchiver zipArchiver = getZipArchiver( zipFile );
+- final DefaultFileSet fs = new DefaultFileSet();
+- fs.setPrefix( "bzz/" );
+- fs.setDirectory( new File( "src/test/resources/symlinks/src" ) );
+- zipArchiver.addFileSet( fs );
+- zipArchiver.createArchive();
+- final File output = getTestFile( "target/output/unzipped/symlFs" );
+- output.mkdirs();
+- final ZipUnArchiver zipUnArchiver = getZipUnArchiver( zipFile );
+- zipUnArchiver.setDestFile( output );
+- zipUnArchiver.extract();
+- File symDir = new File( output, "bzz/symDir" );
+- PlexusIoResourceAttributes fa = FileAttributes.uncached( symDir );
+- assertTrue( fa.isSymbolicLink() );
+- }
+- }
+-
+- public void testSymlinkArchivedFileSet()
+- throws Exception
+- {
+- final File zipFile = getTestFile( "src/test/resources/symlinks/symlinks.zip" );
+- final File zipFile2 = getTestFile( "target/output/pasymlinks-archivedFileset.zip" );
+- final ZipArchiver zipArchiver = getZipArchiver( zipFile2 );
+- zipArchiver.addArchivedFileSet( zipFile );
+- zipArchiver.createArchive();
+-
+- final ZipFile cmp1 = new ZipFile( zipFile );
+- final ZipFile cmp2 = new ZipFile( zipFile2 );
+- ArchiveFileComparator.assertEquals( cmp1, cmp2, "" );
+- }
+-
+ /*
+ * Zip archives store file modification times with a granularity of two seconds.
+ * Verify that ZipArchiver rounds up the last modified time.
=====================================
debian/patches/series
=====================================
@@ -3,3 +3,4 @@
04-ignore-utf8-unzip-test.patch
05-plexus-containers-compatibility.patch
06-plexus-archiver-3.6.0.patch
+ignore-symlink-tests.patch
=====================================
debian/rules
=====================================
@@ -2,3 +2,9 @@
%:
dh $@
+
+override_dh_auto_build:
+ # Workaround for maven-resources-plugin bug https://issues.apache.org/jira/browse/MRESOURCES-237
+ $(RM) src/test/resources/symlinks/src/sym*
+ $(RM) src/test/resources/symlinks/src/aDirWithALink/backOutsideToFileX
+ dh_auto_build
View it on GitLab: https://salsa.debian.org/java-team/plexus-archiver/-/compare/3673d3d746e29c5d5bf863ca89979efc1d712d3d...3173a3eda7752ec1c34cc5624a0b89313696302a
--
View it on GitLab: https://salsa.debian.org/java-team/plexus-archiver/-/compare/3673d3d746e29c5d5bf863ca89979efc1d712d3d...3173a3eda7752ec1c34cc5624a0b89313696302a
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-java-commits/attachments/20220629/19d437e5/attachment.htm>
More information about the pkg-java-commits
mailing list