|
Lines 934-940
Link Here
|
| 934 |
|
934 |
|
| 935 |
if (BuildDirector.p2Gathering) { |
935 |
if (BuildDirector.p2Gathering) { |
| 936 |
//TODO permissions |
936 |
//TODO permissions |
| 937 |
fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), false, null, "**/**", null, null, null, productFile != null ? Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) : null, null, null)); //$NON-NLS-1$ |
937 |
FileSet[] permissions = generatePermissions(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), true); |
|
|
938 |
String toExcludeFromArchive = Utils.getStringFromCollection(this.addedByPermissions, ","); //$NON-NLS-1$ |
| 939 |
fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), false, null, "**/**", null, toExcludeFromArchive, null, productFile != null ? Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) : null, null, null)); //$NON-NLS-1$ |
| 940 |
fileSets.addAll(Arrays.asList(permissions)); |
| 938 |
} else { |
941 |
} else { |
| 939 |
for (int i = 0; i < plugins.length; i++) { |
942 |
for (int i = 0; i < plugins.length; i++) { |
| 940 |
Object[] shape = shapeAdvisor.getFinalShape(plugins[i]); |
943 |
Object[] shape = shapeAdvisor.getFinalShape(plugins[i]); |
|
Lines 954-960
Link Here
|
| 954 |
fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + elt.toStringReplacingAny(".", ANY_STRING), false, null, "**/**", null, null, null, elt.toStringReplacingAny(".", ANY_STRING), null, null)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
957 |
fileSets.add(new ZipFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE) + '/' + elt.toStringReplacingAny(".", ANY_STRING), false, null, "**/**", null, null, null, elt.toStringReplacingAny(".", ANY_STRING), null, null)); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
| 955 |
} |
958 |
} |
| 956 |
} else { |
959 |
} else { |
| 957 |
FileSet[] permissions = generatePermissions(true); |
960 |
FileSet[] permissions = generatePermissions(rootFolder, true); |
| 958 |
String toExcludeFromArchive = Utils.getStringFromCollection(this.addedByPermissions, ","); //$NON-NLS-1$ |
961 |
String toExcludeFromArchive = Utils.getStringFromCollection(this.addedByPermissions, ","); //$NON-NLS-1$ |
| 959 |
fileSets.add(new ZipFileSet(rootFolder, false, null, "**/**", null, toExcludeFromArchive, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null)); //$NON-NLS-1$ |
962 |
fileSets.add(new ZipFileSet(rootFolder, false, null, "**/**", null, toExcludeFromArchive, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null)); //$NON-NLS-1$ |
| 960 |
fileSets.addAll(Arrays.asList(permissions)); |
963 |
fileSets.addAll(Arrays.asList(permissions)); |
|
Lines 967-979
Link Here
|
| 967 |
} |
970 |
} |
| 968 |
} |
971 |
} |
| 969 |
|
972 |
|
| 970 |
protected FileSet[] generatePermissions(boolean zip) { |
973 |
protected Collection getArchiveRootFileProviders() { |
|
|
974 |
return rootFileProviders != null ? rootFileProviders : Collections.EMPTY_LIST; |
| 975 |
} |
| 976 |
|
| 977 |
protected FileSet[] generatePermissions(String root, boolean zip) { |
| 971 |
String configInfix = configInfo.toString("."); //$NON-NLS-1$ |
978 |
String configInfix = configInfo.toString("."); //$NON-NLS-1$ |
| 972 |
String prefixPermissions = ROOT_PREFIX + configInfix + '.' + PERMISSIONS + '.'; |
979 |
String prefixPermissions = ROOT_PREFIX + configInfix + '.' + PERMISSIONS + '.'; |
| 973 |
String commonPermissions = ROOT_PREFIX + PERMISSIONS + '.'; |
980 |
String commonPermissions = ROOT_PREFIX + PERMISSIONS + '.'; |
| 974 |
ArrayList fileSets = new ArrayList(); |
981 |
ArrayList fileSets = new ArrayList(); |
| 975 |
|
982 |
|
| 976 |
for (Iterator iter = rootFileProviders.iterator(); iter.hasNext();) { |
983 |
for (Iterator iter = getArchiveRootFileProviders().iterator(); iter.hasNext();) { |
| 977 |
Properties featureProperties = getFeatureBuildProperties((BuildTimeFeature) iter.next()); |
984 |
Properties featureProperties = getFeatureBuildProperties((BuildTimeFeature) iter.next()); |
| 978 |
for (Iterator iter2 = featureProperties.entrySet().iterator(); iter2.hasNext();) { |
985 |
for (Iterator iter2 = featureProperties.entrySet().iterator(); iter2.hasNext();) { |
| 979 |
Map.Entry permission = (Map.Entry) iter2.next(); |
986 |
Map.Entry permission = (Map.Entry) iter2.next(); |
|
Lines 985-1001
Link Here
|
| 985 |
if (instruction.startsWith(prefixPermissions)) { |
992 |
if (instruction.startsWith(prefixPermissions)) { |
| 986 |
addedByPermissions.add(values[i]); |
993 |
addedByPermissions.add(values[i]); |
| 987 |
if (zip) |
994 |
if (zip) |
| 988 |
fileSets.add(new ZipFileSet(rootFolder + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(prefixPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
995 |
fileSets.add(new ZipFileSet(root + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(prefixPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
| 989 |
else |
996 |
else |
| 990 |
fileSets.add(new TarFileSet(rootFolder + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(prefixPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
997 |
fileSets.add(new TarFileSet(root + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(prefixPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
| 991 |
continue; |
998 |
continue; |
| 992 |
} |
999 |
} |
| 993 |
if (instruction.startsWith(commonPermissions)) { |
1000 |
if (instruction.startsWith(commonPermissions)) { |
| 994 |
addedByPermissions.add(values[i]); |
1001 |
addedByPermissions.add(values[i]); |
| 995 |
if (zip) |
1002 |
if (zip) |
| 996 |
fileSets.add(new ZipFileSet(rootFolder + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(commonPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
1003 |
fileSets.add(new ZipFileSet(root + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(commonPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
| 997 |
else |
1004 |
else |
| 998 |
fileSets.add(new TarFileSet(rootFolder + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(commonPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
1005 |
fileSets.add(new TarFileSet(root + (isFile ? '/' + values[i] : ""), isFile, null, isFile ? null : values[i] + "/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) + (isFile ? '/' + values[i] : ""), null, instruction.substring(commonPermissions.length()))); //$NON-NLS-1$//$NON-NLS-2$ //$NON-NLS-3$ |
| 999 |
continue; |
1006 |
continue; |
| 1000 |
} |
1007 |
} |
| 1001 |
} |
1008 |
} |
|
Lines 1009-1015
Link Here
|
| 1009 |
List fileSets = new ArrayList(); |
1016 |
List fileSets = new ArrayList(); |
| 1010 |
|
1017 |
|
| 1011 |
if (BuildDirector.p2Gathering) { |
1018 |
if (BuildDirector.p2Gathering) { |
| 1012 |
fileSets.add(new TarFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), false, null, "**/**", null, null, null, productFile != null ? Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) : null, null, null)); //$NON-NLS-1$ |
1019 |
FileSet[] permissions = generatePermissions(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), false); |
|
|
1020 |
String toExcludeFromArchive = Utils.getStringFromCollection(this.addedByPermissions, ","); //$NON-NLS-1$ |
| 1021 |
fileSets.add(new TarFileSet(Utils.getPropertyFormat(PROPERTY_ECLIPSE_BASE), false, null, "**/**", null, toExcludeFromArchive, null, productFile != null ? Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX) : null, null, null)); //$NON-NLS-1$ |
| 1022 |
fileSets.addAll(Arrays.asList(permissions)); |
| 1013 |
} else { |
1023 |
} else { |
| 1014 |
//FileSet[] filesPlugins = new FileSet[plugins.length]; |
1024 |
//FileSet[] filesPlugins = new FileSet[plugins.length]; |
| 1015 |
for (int i = 0; i < plugins.length; i++) { |
1025 |
for (int i = 0; i < plugins.length; i++) { |
|
Lines 1023-1029
Link Here
|
| 1023 |
} |
1033 |
} |
| 1024 |
|
1034 |
|
| 1025 |
if (rootFileProviders.size() > 0) { |
1035 |
if (rootFileProviders.size() > 0) { |
| 1026 |
FileSet[] permissionSets = generatePermissions(false); |
1036 |
FileSet[] permissionSets = generatePermissions(rootFolder, false); |
| 1027 |
fileSets.add(new TarFileSet(rootFolder, false, null, "**/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null)); //$NON-NLS-1$ |
1037 |
fileSets.add(new TarFileSet(rootFolder, false, null, "**/**", null, null, null, Utils.getPropertyFormat(PROPERTY_ARCHIVE_PREFIX), null, null)); //$NON-NLS-1$ |
| 1028 |
fileSets.add(Arrays.asList(permissionSets)); |
1038 |
fileSets.add(Arrays.asList(permissionSets)); |
| 1029 |
} |
1039 |
} |