1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-07 09:46:02 +02:00

Added handling of executable bit from tar entry.

This commit is contained in:
Doug Schaefer 2009-04-29 19:06:55 +00:00
parent 82c18d8c1f
commit c11128ff5e

View file

@ -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);
}
}