Skip to main content
summaryrefslogtreecommitdiffstats
path: root/p2
diff options
context:
space:
mode:
authorDoug Schaefer2009-04-29 15:06:55 -0400
committerDoug Schaefer2009-04-29 15:06:55 -0400
commitc11128ff5ef3322f94c2dd9f2ef7c1b030ae9a1e (patch)
tree171acb84f07829ff0e19b928f6bc0fb7ea638162 /p2
parent82c18d8c1f99c68b9293f7f278b232cca4e1e1c7 (diff)
downloadorg.eclipse.cdt-c11128ff5ef3322f94c2dd9f2ef7c1b030ae9a1e.tar.gz
org.eclipse.cdt-c11128ff5ef3322f94c2dd9f2ef7c1b030ae9a1e.tar.xz
org.eclipse.cdt-c11128ff5ef3322f94c2dd9f2ef7c1b030ae9a1e.zip
Added handling of executable bit from tar entry.
Diffstat (limited to 'p2')
-rw-r--r--p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
index 546b3f47c5..d404469168 100644
--- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
+++ b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/internal/p2/touchpoint/natives/actions/UntarAction.java
@@ -143,8 +143,18 @@ public class UntarAction extends ProvisioningAction {
FileOutputStream outStream = new FileOutputStream(outFile);
tarIn.copyEntryContents(outStream);
outStream.close();
+
+ // Set last modified time from the tar entry
long lastModified = tarEntry.getModTime().getTime();
outFile.setLastModified(lastModified);
+
+ // Set the executable bits from the tar entry
+ // we let the umask determine the r/w
+ int mode = tarEntry.getMode();
+ boolean exec = (mode & 0x111) != 0;
+ boolean execOwner = (mode & 0x11) == 0;
+ outFile.setExecutable(exec, execOwner);
+
fileList.add(outFile);
}
}

Back to the top