List<String> installableMetaNames = getInstallableMetas(pm, packageNames);
PackageSet installableMetas = pm.getPackagesByNames(installableMetaNames);
PackageSet installablePackages = pm.getDependsPackagesFromRepository(installableMetas);
+ PackageSet skipPackages = pm.getPackagesByNames(Options.skipPackages);
+
+ if (!skipPackages.isEmpty()) {
+ Log.log("Installation skip packages : " + skipPackages);
+ installablePackages = pm.diff(installablePackages, skipPackages);
+ }
if (checkAvailableSize(installablePackages, targetDir)) {
return installPackages(installablePackages, targetDir);
controller.init();
PackageManager pm = PackageManager.getInstance();
-
+
// Uninstall whole SDK.
if (packageNames.contains("all")) {
if (controller.uninstall(pm.getInstalledMetaNames(), null)) {
} else {
return false;
}
- }
-
- // Uninstall specific installed packages.
- if (!vailidateRemovePkgs(pm, packageNames)) {
+ } else if (!vailidateRemoveMetaPkgs(pm, packageNames)) {
+ // Uninstall specific installed packages.
return false;
- }
+ }
if (controller.uninstall(packageNames, null)) {
// After uninstall packages, if installed meta package is "ESSENTIAL-COMPONENT",
* @return If Installmanager can find input package in installed package list, return true.
* otherwise, return false.
*/
- private static boolean vailidateRemovePkgs(PackageManager pm, Collection<String> pkgNames) {
+ private static boolean vailidateRemoveMetaPkgs(PackageManager pm, Collection<String> pkgNames) {
List<String> installedMetaNames = pm.getInstalledMetaNames();
for (String name : pkgNames) {
Log.log("start download package: " + packageToDownload);
URL packageUrl = packageToDownload.getURL();
+ if (monitor != null) {
+ monitor.workedDownload(packageToDownload.getPackageName());
+ }
size = mDownloader.download(packageUrl, fileDownloadTargetPath,
monitor);
int i = 0;
for (Package pkg : installablePackages) {
if (monitor != null) {
+ monitor.workedProcess(pkg.getPackageName());
monitor.worked(++i);
}
}
PackageSet pkgsToRemove = packageManager.getToRemovePackagesInRemove(metasToRemove);
+
Log.log("Remove packages: " + pkgsToRemove);
if (monitor != null) {
int i = 0;
for (Package pkg : pkgsToRemove) {
if (monitor != null) {
+ monitor.workedProcess(pkg.getPackageName());
monitor.worked(++i);
}
String command = ShellUtil.addInterpreter(scriptFile.getAbsolutePath());
- int exitCode = ShellUtil.execute(command, env, null,
+ String current = PathUtil.getCurrentDir();
+ Log.log("Current working directory. => " + current);
+ int exitCode = ShellUtil.execute(command, env, new File(current),
new LoggerShellParser());
// check exit code
public static boolean isNetwork = true;
public static List<String> packages = new ArrayList<String>();
+ public static List<String> skipPackages = new ArrayList<String>();
/**
* Use only download for making SDK image.
}
}
+ // set skip packages
+ argIter = argArray.iterator();
+ while (argIter.hasNext()) {
+ if (argIter.next().equalsIgnoreCase("-skip")) {
+ argIter.remove();
+ while (argIter.hasNext()) {
+ String pkg = argIter.next();
+ if (!pkg.startsWith("-")) {
+ skipPackages.add(pkg);
+ argIter.remove();
+ } else {
+ break;
+ }
+ }
+ }
+ }
+
// set proxy
argIter = argArray.iterator();
while (argIter.hasNext()) {
--- /dev/null
+package org.tizen.installmanager.core;
+
+import java.util.Date;
+
+import org.tizen.installmanager.lib.Log;
+
+public class Performance {
+ private static Date imStartTime = null;
+ private static Date imEndTime = null;
+ private static Date installationStartTime = null;
+ private static Date installationEndTime = null;
+
+ public static void setIMStartTime() {
+ imStartTime = new Date();
+ }
+
+ public static void setIMEndTime() {
+ imEndTime = new Date();
+ }
+
+ public static void setInstallationStartTime() {
+ installationStartTime = new Date();
+ }
+
+ public static void setInstallationEndTime() {
+ installationEndTime = new Date();
+ }
+
+ public static void printToLogFile() {
+ Log.log("The installmanager start time : " + imStartTime);
+ Log.log("The installmanager end time : " + imEndTime);
+ Log.log("The installation start time : " + installationStartTime);
+ Log.log("The installation end time : " + installationEndTime);
+
+ long progressSecond = getProgressTimeOfInstallation()/1000;
+
+ if (progressSecond >= 0) {
+ Log.log("The progress time of the installation : About " + progressSecond/60 + " minutes"
+ +"(" + progressSecond + " seconds)");
+ } else {
+ Log.log("The progress time of the installation : Installation fail");
+ }
+ }
+
+ private static long getProgressTimeOfInstallation() {
+ if (installationStartTime == null || installationEndTime == null) {
+ return -1;
+ }
+
+ long interval = installationEndTime.getTime() - installationStartTime.getTime();
+ return interval;
+ }
+}
return installedMetaNames;
}
+ public List<String> getInstalledPkgNames() {
+ ArrayList<String> installedPkgNames = new ArrayList<String>();
+
+ for (Package pkg : getInstalledPackages()) {
+ installedPkgNames.add(pkg.getPackageName());
+ }
+
+ return installedPkgNames;
+ }
+
/**
* @return meta packages among all recent packages
*/
* @param pset2
* @return new package set that represents (pset1 - pset2).
*/
- private PackageSet diff(PackageSet pset1, PackageSet pset2) {
+ public PackageSet diff(PackageSet pset1, PackageSet pset2) {
PackageSet diff = new PackageSet();
for(Package p : pset1) {
if(!pset2.contains(p)) {
import org.tizen.installmanager.core.IMFatalException;
import org.tizen.installmanager.core.InstallManager;
import org.tizen.installmanager.core.Options;
+import org.tizen.installmanager.core.Performance;
import org.tizen.installmanager.lib.ErrorController;
import org.tizen.installmanager.lib.IMError;
import org.tizen.installmanager.lib.Log;
* @param args
*/
public static void main(String args[]) {
+ Performance.setIMStartTime();
InstallManager.deleteTempFile();
Log.open();
ProgramController.createProgramController().removeSDKTempDir();
}
+ Performance.setIMEndTime();
+ Performance.printToLogFile();
+
Log.LogTitle("Installmanager finish");
Log.close();
+++ /dev/null
-/PageTemplate.java
display.syncExec(new Runnable() {
@Override
public void run() {
- statusLabel.setText("Processing : package \""
- + mProgressTitle + "\"");
installedNumberLabel.setText(work + "/" + (totalWork));
progressBar.setSelection(100 * work / (int) totalWork);
}
return;
}
- workedTitle(title);
+ workedTitle("Downloading : " + title);
}
@Override
return;
}
- String processTitle = "File checking : " + title;
- workedTitle(processTitle);
+ workedTitle("File checking : " + title);
}
/**
} else {
currentSize = dformat.format(mProgressSize) + "KB";
}
-
- statusLabel.setText("File checking : " + mProgressTitle);
+
installedNumberLabel.setText(currentSize + "/" + totalSize);
mSubTitleOfProgress.setText("");
mDownloadVelocity.setText("");
}
}
- statusLabel.setText("Downloading : " + mProgressTitle);
installedNumberLabel.setText(currentSize + "/" + totalSize);
mSubTitleOfProgress.setText("Remaining time : " + remainTimeStr);
mDownloadVelocity.setText(downloadVelocityStr);
--- /dev/null
+/*
+* InstallManager
+*
+* Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
+*
+* Contact:
+* Wooyoung Cho <wooyoung1.cho@samsung.com>
+* Shihyun Kim <shihyun.kim@samsung.com>
+* Taeyoung Son <taeyoung2.son@samsung.com>
+* Yongsung kim <yongsung1.kim@samsung.com>
+*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+* Contributors:
+* - S-Core Co., Ltd
+*
+*/
+
+package org.tizen.installmanager.ui.page;
+
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.tizen.installmanager.lib.Platform;
+import org.tizen.installmanager.ui.InstallManagerWindow;
+import org.tizen.installmanager.util.PathUtil;
+
+
+/**
+ * This class is a parent class of all composite classes.
+ */
+public class PageTemplate extends Composite {
+
+ public static final String RESOURCE_PATH = "/res/images";
+
+ private Label imgLabel;
+ private Label titleLabel;
+ private Label subtitleLabel;
+ public Composite customComposite;
+
+ /**
+ * Set basic environment of child pages.
+ * @param parent
+ * @param style
+ */
+ public PageTemplate(Composite parent, int style) {
+ super(parent, style);
+ setLayout(null);
+ setBackground(InstallManagerWindow.getBackgroundColor());
+
+ imgLabel = new Label(this, SWT.NONE);
+ imgLabel.setBounds(0, 0, 160, 398);
+ imgLabel.setBackground(InstallManagerWindow.getBackgroundColor());
+
+ titleLabel = new Label(this, SWT.NONE);
+
+ if (Platform.isUbuntu()) {
+ titleLabel.setFont((new Font(Display.getCurrent(), new FontData("Dejavu Sans", 11, SWT.BOLD))));
+ } else if (Platform.isWindows()) {
+ titleLabel.setFont((new Font(Display.getCurrent(), new FontData("Verdana", 11, SWT.BOLD))));
+ }
+
+ titleLabel.setBounds(160, 17, 468, 20);
+ titleLabel.setText("New Label");
+ titleLabel.setBackground(InstallManagerWindow.getBackgroundColor());
+
+ subtitleLabel = new Label(this, SWT.WRAP);
+ subtitleLabel.setBounds(160, 43, 451, 40);
+ subtitleLabel.setText("");
+ subtitleLabel.setBackground(InstallManagerWindow.getBackgroundColor());
+
+ customComposite = new Composite(this, SWT.NONE);
+
+ customComposite.setSize(468, 304);
+ customComposite.setLocation(160, 90);
+ customComposite.setBackground(InstallManagerWindow.getBackgroundColor());
+ }
+
+ /**
+ * Set the left image in resource.
+ * @param Image path
+ */
+ public void setLeftImageFromResource(String imgRscPath) {
+ imgLabel.setImage(PathUtil.getImageFromResource(imgRscPath));
+ }
+
+ /**
+ * Set page's title.
+ * @param Title string
+ */
+ public void setTitle(String strTitle) {
+ titleLabel.setText(strTitle);
+ }
+
+ /**
+ * Set page's sub title
+ * @param Sub title string
+ */
+ public void setSubTitle(String strSubTitle) {
+ subtitleLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK));
+ subtitleLabel.setText(strSubTitle);
+ }
+
+ public void setErrorSubTitle(String strSubTitle) {
+ subtitleLabel.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_RED));
+ subtitleLabel.setText(strSubTitle);
+ }
+
+ /**
+ * Return custom composite
+ * @return custom composite object
+ */
+ public Composite getCustomComposite() {
+ return customComposite;
+ }
+
+ public void setImageBounds(int nX, int nY, int nWidth, int nHeight) {
+ imgLabel.setBounds(nX, nY, nWidth, nHeight);
+ }
+
+ public void setTitleBounds(int nX, int nY, int nWidth, int nHeight) {
+ titleLabel.setBounds(nX, nY, nWidth, nHeight);
+ }
+
+ public void setSubTitleBounds(int nX, int nY, int nWidth, int nHeight) {
+ subtitleLabel.setBounds(nX, nY, nWidth, nHeight);
+ }
+
+ public void setSubTitleFont(FontData fontData) {
+ subtitleLabel.setFont((new Font(Display.getCurrent(), fontData)));
+ }
+
+ public void setCustomCompositeBounds(int nX, int nY, int nWidth, int nHeight) {
+ customComposite.setSize(nWidth, nHeight);
+ customComposite.setLocation(nX, nY);
+ }
+
+ public void disableSubtitleBounds() {
+ subtitleLabel.dispose();
+ }
+}
display.asyncExec(new Runnable() {
@Override
public void run() {
- statusLabel.setText("Processing : package \"" + mProgressTitle + "\"");
mSubTitleOfProgress.setText(mSubTitle);
uninstalledNumberLabel.setText(work + "/" + totalWork);
progressBar.setSelection(100 * work / totalWork);
return;
}
- String processTitle = "Processing : package \"" + mProgressTitle + "\"";
- workedTitle(processTitle);
+ workedTitle("Processing : package \"" + mProgressTitle + "\"");
}
@Override
import org.tizen.installmanager.core.InstallManager;
import org.tizen.installmanager.core.InstallManagerConstants;
import org.tizen.installmanager.core.Options;
+import org.tizen.installmanager.core.Performance;
import org.tizen.installmanager.core.SDKExtensionInfo;
import org.tizen.installmanager.core.Config.ServerType;
import org.tizen.installmanager.lib.Documents;
*/
public boolean install(Collection<String> installList, String targetPath,
InstallProgressMonitor monitor) throws IMExitException {
+ Performance.setInstallationStartTime();
+
Log.log("======== Start Installing ========");
Log.log("Selected package list => " + installList);
Log.log("target path => " + targetPath);
PathUtil.remove(Config.getInstance().getDownloadDirPath());
}
+ Performance.setInstallationEndTime();
return bResult;
}
* @see ViewController#uninstallPackages(PackageSet, IIMProgressMonitor)
*/
public boolean uninstall(List<String> uninstallList, IIMProgressMonitor monitor) {
+ Performance.setInstallationStartTime();
+
Log.log("ViewController Uninstall Start => " + uninstallList);
if (packageManager == null || uninstallList.size() == 0) {
Log.err("ViewController.uninstall() uninstalllist does not exist. => " + uninstallList);
if (Options.doRemoveOldSDK || (uninstallList.size() == 1 && uninstallList.get(0).equals(Config.SDK_NAME))) {
uninstallAll(monitor);
+ Performance.setInstallationEndTime();
return true;
} else {
PackageSet removablePackages = packageManager.getInstalledPackagesByName(uninstallList);
- return uninstallPackages(removablePackages, monitor);
+ boolean result = uninstallPackages(removablePackages, monitor);
+ Performance.setInstallationEndTime();
+ return result;
}
}
-
-Tizen SDK
-
-Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All open source software portions ("Open Source Software") are licensed under the open source licenses that accompany such Open Source Software.
-The licenses governing the Open Source Software are available at:
-https://developer.tizen.org/tizen-sdk-opensource-license
-
-Except for the Open Source Software and proprietary components contributed from companies other than Samsung, contained in Tizen SDK, all other software portions contained in Tizen SDK are governed by the terms and conditions of the Samsung Tizen SDK License Agreement, available at:
-https://developer.tizen.org/tizen-sdk-license
-
-The licenses of all proprietary components contributed from companies other than Samsung will be either displayed as part of their respective installers or accessed inside installation package archive of each component.
-
-You may access and download Tizen SDK Open Source Software at:
-https://developer.tizen.org/downloads/tizen-sdk
-
-BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE OPEN SOURCE SOFTWARE LICENSE TERMS, THE SAMSUNG TIZEN SDK LICENSE AGREEMENT AND THE LICENSES OF ALL PROPRIETARY COMPONENTS CONTRIBUTED FROM COMPANIES OTHER THAN SAMSUNG. If you do not agree with the Open Source Software license terms or the SAMSUNG TIZEN SDK LICENSE AGREEMENT or THE LICENSES OF ALL PROPRIETARY COMPONENTS CONTRIBUTED FROM COMPANIES OTHER THAN SAMSUNG, you may not download or use Tizen SDK.
\ No newline at end of file
+Tizen SDK
+
+Tizen SDK contains software portions licensed under various open source licenses as well as proprietary components. All software portions ("Software") are licensed under licenses that accompany such Software.
+
+The licenses governing the Software("Licenses") are available at: https://developer.tizen.org/tizen-sdk-software-licenses
+
+The licenses("Other Licenses") of software which are not listed at the above URL will be either displayed as part of their respective installers or accessed inside installation package archive of each component.
+
+You may access and download Tizen SDK Open Source Software at: http://developer.tizen.org/download/tizenopensdk.tar.gz
+
+BY CLICKING THE "I AGREE" BUTTON OR BY USING ANY PART OF TIZEN SDK, YOU AGREE (ON BEHALF OF YOURSELF AND/OR YOUR COMPANY) TO THE TERMS IN Licenses, AND THE TERMS IN Other Licenses. If you do not agree with the terms in Licenses or the terms in Other Licenses you may not download or use Tizen SDK.
\ No newline at end of file