[eclipse-jbosstools/f19: 14/36] Rebase & augment TrueZip related patches
Gerard Ryan
galileo at fedoraproject.org
Sun Aug 18 15:22:07 UTC 2013
commit 216aa1d57bb53e91bd4d89e91b585e9a4add0711
Author: Gerard Ryan <gerard at ryan.lt>
Date: Tue Jul 23 23:20:20 2013 +0100
Rebase & augment TrueZip related patches
...bosstools-archives-core-trueziputil-4.0.0.patch | 34 ++++++++++----
...pse-jbosstools-as-archives.webtools-4.0.0.patch | 46 +++++++------------
2 files changed, 41 insertions(+), 39 deletions(-)
---
diff --git a/eclipse-jbosstools-archives-core-trueziputil-4.0.0.patch b/eclipse-jbosstools-archives-core-trueziputil-4.0.0.patch
index a57c379..57639f9 100644
--- a/eclipse-jbosstools-archives-core-trueziputil-4.0.0.patch
+++ b/eclipse-jbosstools-archives-core-trueziputil-4.0.0.patch
@@ -1,5 +1,5 @@
---- server/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java.orig 2012-12-05 17:32:47.000000000 +0000
-+++ server/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2013-01-17 22:15:32.451468634 +0000
+--- jbosstools-server/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java.orig 2013-06-03 11:14:45.000000000 +0100
++++ jbosstools-server/archives/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/util/internal/TrueZipUtil.java 2013-06-08 17:11:29.964745336 +0100
@@ -14,11 +14,10 @@
import org.eclipse.core.runtime.IPath;
@@ -16,7 +16,7 @@
/**
* Accesses raw files with the truezip filesystem
-@@ -27,17 +27,17 @@
+@@ -27,17 +26,17 @@
*/
public class TrueZipUtil {
@@ -39,7 +39,7 @@
return file.exists();
}
-@@ -46,7 +46,7 @@
+@@ -46,7 +45,7 @@
return getTimestamp( getFile(path));
}
@@ -48,7 +48,7 @@
return file.lastModified();
}
-@@ -55,28 +55,32 @@
+@@ -55,28 +54,32 @@
return copyFile(source, getFile(dest), true);
}
@@ -88,7 +88,7 @@
}
public static boolean deleteEmptyChildren(java.io.File file) {
-@@ -102,14 +106,14 @@
+@@ -102,14 +105,14 @@
public static boolean createFolder(IPath parent, String folderName) {
@@ -105,8 +105,8 @@
return b && updateParentTimestamps(parent.append(folderName));
}
public static boolean createArchive(IPath path) {
-@@ -117,8 +121,8 @@
- }
+@@ -157,8 +160,8 @@
+
public static void umount() {
try {
- de.schlichtherle.io.File.umount();
@@ -116,7 +116,7 @@
}
}
-@@ -143,9 +147,9 @@
+@@ -183,9 +186,9 @@
}
// Update only the PARENT timestamps.
@@ -128,7 +128,7 @@
boolean b = true;
while( parent != null ) {
b &= parent.setLastModified(time);
-@@ -155,21 +159,22 @@
+@@ -195,21 +198,22 @@
}
@@ -158,3 +158,17 @@
public static boolean javaIODeleteDir(java.io.File dir) {
if (dir.isDirectory()) {
+@@ -230,10 +230,10 @@
+ return dir.delete();
+ }
+
+- public static de.schlichtherle.io.File getFileInArchive(de.schlichtherle.io.File root, IPath relative) {
++ public static TFile getFileInArchive(de.schlichtherle.io.File root, IPath relative) {
+ while(relative.segmentCount() > 0 ) {
+- root = new de.schlichtherle.io.File(root,
+- relative.segment(0), ArchiveDetector.NULL);
++ root = new TFile(root,
++ relative.segment(0), TArchiveDetector.NULL);
+ relative = relative.removeFirstSegments(1);
+ }
+ return root;
diff --git a/eclipse-jbosstools-as-archives.webtools-4.0.0.patch b/eclipse-jbosstools-as-archives.webtools-4.0.0.patch
index aeb11e5..2ee030e 100644
--- a/eclipse-jbosstools-as-archives.webtools-4.0.0.patch
+++ b/eclipse-jbosstools-as-archives.webtools-4.0.0.patch
@@ -1,5 +1,5 @@
---- server/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java.orig 2012-12-05 17:32:47.000000000 +0000
-+++ server/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2013-01-18 02:00:53.510937058 +0000
+--- jbosstools-server/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java.orig 2013-06-03 11:14:45.000000000 +0100
++++ jbosstools-server/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2013-06-08 21:13:01.977200918 +0100
@@ -11,6 +11,8 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.modules;
@@ -9,7 +9,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
-@@ -48,7 +50,8 @@
+@@ -49,7 +51,8 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
@@ -19,7 +19,7 @@
public class LocalZippedPublisherUtil extends PublishUtil {
-@@ -230,7 +233,7 @@
+@@ -231,7 +234,7 @@
try {
IPath path = getOutputFilePath(combine(parent, last));
path = path.removeLastSegments(1);
@@ -28,16 +28,7 @@
IModuleResource[] resources = getResources(last, new NullProgressMonitor());
results.addAll(Arrays.asList(copy(root, resources)));
TrueZipUtil.umount();
-@@ -248,7 +251,7 @@
- FileUtil.safeDelete(path.toFile(), null);
-
- TrueZipUtil.createArchive(path);
-- de.schlichtherle.io.File root = TrueZipUtil.getFile(path, TrueZipUtil.getJarArchiveDetector());
-+ TFile root = TrueZipUtil.getFile(path, TrueZipUtil.getJarArchiveDetector());
- IModuleResource[] resources = getResources(module);
- IDeployableServerBehaviour beh = ServerConverter.getDeployableServerBehavior(server);
- IModulePathFilter filter = beh.getPathFilter(module);
-@@ -283,7 +286,7 @@
+@@ -299,7 +302,7 @@
protected IStatus[] publishChanges(IServer server, String deployRoot, IModule[] module) {
IPath path = getOutputFilePath(module);
@@ -46,7 +37,7 @@
IModuleResourceDelta[] deltas = ((Server)server).getPublishedResourceDelta(module);
IDeployableServerBehaviour beh = ServerConverter.getDeployableServerBehavior(server);
IModulePathFilter filter = beh.getPathFilter(module);
-@@ -295,7 +298,7 @@
+@@ -311,7 +314,7 @@
* @since 2.3
*/
private IStatus[] publishChanges(IServer server, IModuleResourceDelta[] deltas,
@@ -55,7 +46,7 @@
ArrayList<IStatus> results = new ArrayList<IStatus>();
if( deltas == null || deltas.length == 0 )
return new IStatus[]{};
-@@ -315,10 +318,15 @@
+@@ -331,10 +334,15 @@
results.addAll(Arrays.asList(publishChanges(server, deltas[i].getAffectedChildren(), root, filter)));
}
} else if( dKind == IModuleResourceDelta.REMOVED) {
@@ -73,7 +64,7 @@
if( !b )
results.add(generateDeleteFailedStatus(f));
hasBeenChanged = true;
-@@ -331,18 +339,23 @@
+@@ -347,7 +355,7 @@
}
@@ -82,14 +73,16 @@
ArrayList<IStatus> results = new ArrayList<IStatus>();
for( int i = 0; i < children.length; i++ ) {
if( children[i] instanceof IModuleFile ) {
- IModuleFile mf = (IModuleFile)children[i];
- java.io.File source = getFile(mf);
+@@ -356,12 +364,17 @@
+ if( source == null )
+ // Can do nothing here. The source doesn't exist.
+ continue;
- de.schlichtherle.io.File destination = getFileInArchive(root, mf.getModuleRelativePath().append(mf.getName()));
- boolean b = new de.schlichtherle.io.File(source, ArchiveDetector.NULL).archiveCopyAllTo(destination);
+ TFile destination = getFileInArchive(root, mf.getModuleRelativePath().append(mf.getName()));
+ boolean b = true;
+ try {
-+ TFile tf = new TFile(source, TArchiveDetector.NULL).cp_rp(destination);
++ TFile tf = new TFile(source, ArchiveDetector.NULL).cp_rp(destination);
+ if (!tf.exists()) { b = false; }
+ } catch (IOException e) { b = false; }
+
@@ -101,17 +94,12 @@
destination.mkdirs();
IModuleFolder mf = (IModuleFolder)children[i];
results.addAll(Arrays.asList(copy(root, mf.members())));
-@@ -362,10 +375,10 @@
+@@ -381,7 +394,7 @@
return new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID, "Copy of " + source + " to " + destination + " has failed");//$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
}
- protected de.schlichtherle.io.File getFileInArchive(de.schlichtherle.io.File root, IPath relative) {
+ protected TFile getFileInArchive(TFile root, IPath relative) {
- while(relative.segmentCount() > 0 ) {
-- root = new de.schlichtherle.io.File(root,
-- relative.segment(0), ArchiveDetector.NULL);
-+ root = new TFile(root,
-+ relative.segment(0), TArchiveDetector.NULL);
- relative = relative.removeFirstSegments(1);
- }
- return root;
+ return TrueZipUtil.getFileInArchive(root, relative);
+ }
+
More information about the scm-commits
mailing list