public static final String INSTALL_MANAGER_BINARY = "InstallManager.jar";
public static final String INSTALL_MANAGER_UPDATER_BINARY = "InstallManagerUpdater.jar";
public static final String EXECUTE_FILE_NAME_OF_INSTALL_MANAGER = getExecuteFileNameOfInstallManager();
+ public static final String EXECUTE_FILE_NAME_OF_INSTALL_MANAGER_PARTNER =
+ getExecuteFileNameOfInstallManagerPartner();
public static final String EXECUTE_FILE_PATH_OF_INSTALL_MANAGER = PathUtil
.get(INSTALL_MANAGER_DIRECTORY,
EXECUTE_FILE_NAME_OF_INSTALL_MANAGER);
}
}
+ /**
+ * @return filename of install manager executable for Partner SDK
+ */
+ private static String getExecuteFileNameOfInstallManagerPartner() {
+ if (Platform.isLinux() || Platform.isMacOS() ) {
+ return "InstallManagerP";
+ } else if ( Platform.isWindows() ) {
+ return "InstManager.exe";
+ } else {
+ throw new IMFatalException(ErrorCode.UNSUPPORTED_PLATFORM);
+ }
+ }
+
private static String getInstallManagerShortcutPath() {
if (Platform.isUbuntu()) {
return PathUtil.getFromHome(".local/share/applications/"
/**
* Use only download for making SDK image.
*/
+ public static String boundary = "public"; // all, public, partner
public static String platForm = null;
public static int platFormBit = 0;
public static boolean allSnapshots = false;
/**
+ * Support Partner SDK
+ */
+ public static boolean partnerSdk = false;
+ public static String purposeOfInstalling = "public";
+
+ /**
* Display InstallManager Version
*/
public static boolean showVersion = false;
} else if (arg.equals("-onlyDownload")) {
if(iter.hasNext()) {
onlyDownload = true;
+ boundary = iter.next();
platForm = iter.next().toLowerCase();
platFormBit = Integer.parseInt(iter.next());
+ Log.log("Only download boundary : "+ boundary);
} else {
Log.err("-onlyDownload requires packageList description");
throw new IMFatalException(ErrorCode.REPOSITORY_NOT_PROVIDED);
}
/**
+ * @return partner meta packages among all meta packages.
+ */
+ public PackageSet getPartnerMetaPackages() {
+ PackageSet allMetas = meta(recentPackages);
+
+ PackageSet partnerMeta = new PackageSet();
+ for (Package meta : allMetas) {
+ if (meta.isPartnerMeta()) {
+ partnerMeta.add(meta);
+ }
+ }
+
+ return partnerMeta;
+ }
+
+ /**
+ * @return public meta packages among all meta packages.
+ */
+ public PackageSet getPublicMetaPackages() {
+ PackageSet allMetas = meta(recentPackages);
+
+ PackageSet publicMeta = new PackageSet();
+ for (Package meta : allMetas) {
+ if (meta.isPublicMeta()) {
+ publicMeta.add(meta);
+ }
+ }
+
+ return publicMeta;
+ }
+
+ /**
* Get dependency packages of installable package.
* @param pkgs installable packages.
* @return
PackageSet metas = new PackageSet();
for(Package p : pset) {
if (!Options.doTest) {
- if(p.isRootMeta() || p.isExtraMeta()) {
+ if(p.isRootMeta() || p.isExtraMeta() || p.isPublicMeta()) {
metas.add(p);
}
} else {
- if(p.isRootMeta() || p.isExtraMeta() || p.isTestMeta()) {
+ if(p.isRootMeta() || p.isExtraMeta() || p.isPublicMeta() || p.isTestMeta()) {
metas.add(p);
}
}
// fields of ordering for UI
public static final String FIELD_ORDER = "C-Order";
+ // field of Partner SDK
+ public static final String FIELD_PARTNER = "C-Partner";
+
// fields of script
public static final String INSTALL_SCRIPT_LINUX = "install.sh";
public static final String REMOVE_SCRIPT_LINUX = "remove.sh";
private static final String ATTRIBUTE_INSTALL_META = "install";
private static final String ATTRIBUTE_TEST_META = "test";
private static final String ATTRIBUTE_MANDATORY = "mandatory";
+ private static final String ATTRIBUTE_PARTNER = "partner";
+ private static final String ATTRIBUTE_PUBLIC = "public";
//dependency information
private static final String START_OF_OS_DEPENDENCY = "[";
return url;
}
+ public String getPartner() {
+ return getValue(FIELD_PARTNER);
+ }
+
/**
* @return Extension server of this package.
*/
* @return <code>true</code> if this package is a meta package.
*/
public boolean isMeta() {
+ // onlyDownload option, in this case, do not need separate public meta package
+ // to partner meta package because installmanager should download all meta packages.
if (Options.onlyDownload) {
- if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isTestMeta()) {
+ if (isRootMeta() || isInstallMeta() || isExtraMeta() ||
+ isPublicMeta() || isPartnerMeta() || isMandatory()) {
return true;
} else {
return false;
}
if (Options.doTest) { // include test packages for SDK testing
- if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isTestMeta()) {
+ if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPublicMeta() || isTestMeta()) {
return true;
} else {
return false;
}
} else { // except test packages for normal SDK.
- if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory()) {
+ if (isRootMeta() || isInstallMeta() || isExtraMeta() || isMandatory() || isPublicMeta()) {
return true;
} else {
return false;
}
/**
+ * Check to belong to partner sdk given package
+ * @return <code>true</code> if this package is a partner package.
+ */
+ public boolean isPartnerMeta() {
+ String attributeValue = getAttribute().trim();
+
+ if (attributeValue.equalsIgnoreCase(ATTRIBUTE_PARTNER)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
+ * Check to belong to partner sdk given package
+ * @return <code>true</code> if this package is a partner package.
+ */
+ public boolean isPublicMeta() {
+ String attributeValue = getAttribute().trim();
+
+ if (attributeValue.equalsIgnoreCase(ATTRIBUTE_PUBLIC)) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ /**
* @return <code>true</code> if this meta package is a install meta package.
*/
public boolean isInstallMeta() {
boolean installable = compositeSetInstallDirectoryPage.isInstallablePath();
Config.USER_CONFIG_HOME_PATH = compositeSetInstallDirectoryPage.getSDKWorkSpacePath();
- Registry.sdkDataPath = controller.getSDKWorkSpacePath();
+ Registry.sdkWorkSpacePath = controller.getSDKWorkSpacePath();
Registry.targetPath = controller.getInstallPath();
Registry.saveSDKInfo(Registry.targetPath);
InstallManager installManager = InstallManager.getInstance();
PackageManager packageManager = installManager.getPackageManager();
- PackageSet downloadPackageList = packageManager.getLeafMetaPackages();
- PackageSet downloadablePkgs = packageManager.getDependsPackagesFromRepository(downloadPackageList);
+ // Get all meta packages list by boundary.(eg. public, partner, all....)
+ PackageSet filteredMeta = filterPackageSet();
+ PackageSet downloadablePkgs = packageManager.getDependsPackagesFromRepository(filteredMeta);
// Download all meta packages.
boolean filteredPackages = false;
}
}
+ private static PackageSet filterPackageSet() {
+ PackageManager pm = PackageManager.getInstance();
+
+ PackageSet downloadPackageList = pm.getLeafMetaPackages();
+
+ String boundary = Options.boundary;
+ if (boundary.equalsIgnoreCase("public")) {
+ PackageSet partnerMetaPackages = pm.getPartnerMetaPackages();
+
+ if (!partnerMetaPackages.isEmpty()) {
+ downloadPackageList.removeAll(partnerMetaPackages);
+ }
+ } else if (boundary.equalsIgnoreCase("partner")) {
+ PackageSet publicMetaPackages = pm.getPublicMetaPackages();
+
+ if (!publicMetaPackages.isEmpty()) {
+ downloadPackageList.removeAll(publicMetaPackages);
+ }
+ }
+
+ return downloadPackageList;
+ }
+
private static void showInstallManagerVersion() {
System.out.println("InstallManager Version : " +
Config.getInstance().getInstallManagerVersion().toString());
return packageManager.getInstallablePackages(selectedMetas);
}
+ private PackageSet getMetaPackagesByPurpose(PackageSet metaPackages) {
+ String userAttribute = Options.purposeOfInstalling;
+ for (Package pkg : metaPackages) {
+ String attribute = pkg.getAttribute();
+
+ if (!pkg.isRootMeta() && !pkg.isExtraMeta() && !pkg.isMandatory()) {
+ if (!attribute.equalsIgnoreCase(userAttribute)) {
+ metaPackages.remove(pkg);
+ }
+ }
+ }
+
+ return metaPackages;
+ }
+
/**
* Start to uninstall
* @param uninstallList