Revert "[INST] Modified code for solving problem when merged sources." 55/19755/1
authorYongsung Kim <yongsung1.kim@samsung.com>
Thu, 17 Apr 2014 08:52:21 +0000 (01:52 -0700)
committerYongsung Kim <yongsung1.kim@samsung.com>
Thu, 17 Apr 2014 08:52:21 +0000 (01:52 -0700)
This reverts commit 53b14af5233cffc96db0e705b77370c35d52df9c.

Change-Id: I6e811fd02a73330ac260db33a74a001905333b88

13 files changed:
InstallManager_java/src/org/tizen/installmanager/core/InstallManager.java
InstallManager_java/src/org/tizen/installmanager/core/Installer.java
InstallManager_java/src/org/tizen/installmanager/core/Options.java
InstallManager_java/src/org/tizen/installmanager/core/Performance.java
InstallManager_java/src/org/tizen/installmanager/lib/Downloader.java
InstallManager_java/src/org/tizen/installmanager/lib/ErrorController.java
InstallManager_java/src/org/tizen/installmanager/lib/IIMProgressMonitor.java
InstallManager_java/src/org/tizen/installmanager/pkg/lib/PackageManager.java
InstallManager_java/src/org/tizen/installmanager/pkg/model/Package.java
InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java
InstallManager_java/src/org/tizen/installmanager/ui/page/ViewController.java
InstallManager_java/src/res/new_images/btn_welcome_page_update_hover.png [deleted file]
InstallManager_java/src/res/new_images/btn_welcome_page_update_normal.png [deleted file]

index 05c6774..5b0030f 100644 (file)
@@ -110,6 +110,7 @@ public class InstallManager {
         */
        public void initConfig() {
                if (mConfig != null) {
+                       Registry.saveRepoInfo(mConfig.getConfigFile().getRepository());
                        if (Config.isSupportMultiSDK()) {
                                if (!Registry.getInstalledPath().isEmpty()) {
                                        mConfig.setTargetDir(Registry.getInstalledPath());
@@ -119,7 +120,7 @@ public class InstallManager {
                        }
                } else {
                        mConfig = Config.getInstance();
-
+                       Registry.saveRepoInfo(mConfig.getConfigFile().getRepository());
                        if (Options.doReplaceRepository) {
                                Log.log("Replace repository => " + Options.repository);
                                mConfig.getConfigFile().setRepository(Options.repository);
@@ -154,7 +155,7 @@ public class InstallManager {
 
        private void initPackageManager(Collection<String> repositoryURLs) {
                File installedPackageListFile = null;
-               if (Registry.targetPath != "") {
+               if (!Registry.targetPath.equalsIgnoreCase("")) {
                        installedPackageListFile = new File(PathUtil.get(
                                        PathUtil.get(Registry.targetPath, Config.INFO_DIRECTORY),
                                        Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
@@ -442,10 +443,8 @@ public class InstallManager {
        private void checkOldSDK() {
                Log.log("Check old SDK.");
                if (Registry.getOldInstalledPath() != "") { // Old SDK is installed.
-                       if (Registry.getInstalledPath() != null
-                                       && !Registry.getInstalledPath().isEmpty()) {
-                               // Old SDK is installed but new SDK is also installed, so
-                               // environment does not need to
+                       if (Registry.getInstalledPath() != null && !Registry.getInstalledPath().isEmpty()) {
+                               // Old SDK is installed but new SDK is also installed, so environment does not need to
                                // set new SDK environment.
                                Log.log("Old SDK is installed but new SDK is also installed. => "
                                                + Registry.getInstalledPath());
@@ -549,12 +548,15 @@ public class InstallManager {
        public boolean install(PackageSet installablePackages,
                        final String targetDir, InstallProgressMonitor monitor)
                        throws IMExitException, IMNetworkException {
-               Log.log("InstallManager.install() installable packages : " + installablePackages);
+               Log.log("InstallManager.install() installable packages : "
+                               + installablePackages);
 
                // performance measurement
-               Performance.sdkPackageSize = packageManager.getTotalSizeOfInstallablePackages(installablePackages, true);
+               Performance.sdkPackageSize = packageManager
+                               .getTotalSizeOfInstallablePackages(installablePackages, true);
 
-               if (installablePackages == null || targetDir == null || targetDir.isEmpty()) {
+               if (installablePackages == null || targetDir == null
+                               || targetDir.isEmpty()) {
                        Log.err("packaegs => " + installablePackages + ", targetDir => "
                                        + targetDir);
                        return false;
@@ -573,35 +575,39 @@ public class InstallManager {
                initializeTargetDir(targetDir);
                makeShortcutMenu();
 
-               // make start menu
-               // if you cannot get installmanager from repository, install from local.
-               if (!packageManager
-                               .existsPackage(InstallManagerConstants.INSTALLMANAGER_PACKAGE_NAME)) {
-                       Log.log("Cannot find install-manager from repository.");
-
-                       if (!installInstallManagerFromLocal(targetDir)) {
-                               Log.err("Cannot install install-manager from local directory.");
-                       }
+               // TODO : refactoring.
+               long size = 0;
+               if (Options.onlyDownload) {
+                       System.out.print("Downloading package => " + packageToDownload  + " .......");
                }
-
-               // wait if cancel confirm dialog is showing. wait until user press
-               // button(cancel or not).
-               // TODO :
+               Log.log("start download package: " + packageToDownload);
+               URL packageUrl = packageToDownload.getURL();
+               
                if (monitor != null) {
-                       while (monitor.checkCancelAndDisableCancelButton() == false) {
-                               if (monitor.isCanceled()) {
-                                       throw new IMInstallCancelException();
-                               }
-                       }
+                       monitor.workedDownload(packageToDownload.getPackageName());
                }
-
-               // remove missing packages in repository.
-               removeMissingPackages(monitor);
-
-               for (Package pkg : installablePackages) {
-                       if (!install(pkg, targetDir, monitor)) {
-                               return false;
+               size = mDownloader.download(packageUrl, fileDownloadTargetPath,
+                               monitor);
+               
+               if (size >= 0) {
+                       if (Options.onlyDownload) {
+                               System.out.println(" done.");
                        }
+                       Log.log("finish download");
+               } else {                        
+                       Log.err("download failed => " + packageToDownload.getURL());
+                       
+                       PathUtil.remove(fileDownloadTargetPath);
+                       
+                       String errMsg = "";
+                       if (monitor.isCanceled()) {
+                               errMsg = ErrorController.getErrorMessage();
+                       } else {
+                               errMsg = "Fail to get '" + 
+                                               packageToDownload.getPackageName() + "'."  +
+                                               "\n(" + ErrorController.getErrorMessage() + ")";
+                       }
+                       throw new IMFatalException(errMsg);
                }
 
                // download complete.
@@ -687,7 +693,7 @@ public class InstallManager {
                }
 
                // download package from repository.
-               result = downloadPackage(pkg, null, monitor);
+               result = downloadPackage(pkg, monitor);
 
                if (Options.doTest) {
                        Performance.setDownloadEndTime();
@@ -738,27 +744,43 @@ public class InstallManager {
                return result;
        }
 
-       public boolean downloadPackages(PackageSet packageSet,
-                       InstallProgressMonitor monitor) throws IMNetworkException {
-               if (packageSet == null) {
+       /**
+        * Packages Installation management. 
+        * Download and install packages.
+        * 
+        * @param packagesToInstall
+        * @param targetDir
+        * @param monitor
+        * @return
+        * @throws IMExitException
+        */
+       public boolean install(PackageSet installablePackages, final String targetDir,
+                       InstallProgressMonitor monitor) throws IMExitException, IMNetworkException{
+               Log.log("InstallManager.install() installable packages : " + installablePackages);
+               
+               //performance measurement
+               Performance.sdkPackageSize = packageManager.getTotalSizeOfInstallablePackages(installablePackages, true);
+               
+               if (installablePackages == null || targetDir == null || targetDir.isEmpty()) {
+                       Log.err("packaegs => " + installablePackages + ", targetDir => "
+                                       + targetDir);
                        return false;
                }
-
-               for (Package pkg : packageSet) {
-                       if (!downloadPackage(pkg, null, monitor)) {
-                               return false;
+               
+               mConfig.setTargetDir(targetDir);
+               mConfig.setSdkDatatDir(Registry.sdkDataPath);
+               
+               Performance.setDownloadStartTime();
+               
+               // download packages from repository
+               if (downloadPackages(installablePackages, monitor)) {
+                       Log.log("Success to download packages from repository.");
+               } else {
+                       Log.err("Fail to download packages from repository.");
+                       if (!Options.doResumeDownloading) {
+                               removePackagesDir();
                        }
-               }
-               return true;
-       }
-
-       public boolean downloadPackage(Package pkg, String fileDownloadTargetPath, InstallProgressMonitor monitor)
-                       throws IMNetworkException {
-               Log.log("Download package => " + pkg);
-
-               // check the parameter
-               if (pkg == null) {
-                       Log.err("Cannot find package.");
+                       
                        return false;
                }
 
@@ -771,43 +793,39 @@ public class InstallManager {
                                monitor.workedDownloadProgress(pkg.getPackageName(), 1);
                        }
                }
-               
-               URL downloadFileURL = pkg.getURL();
 
-               if (fileDownloadTargetPath == null) {
-                       fileDownloadTargetPath = getDownloadTargetPath(pkg);
-               }
+               URL downloadFileURL = pkg.getURL();
+               String downloadTargetPath = getDownloadTargetPath(pkg);
 
-               // check the package in cache folder
-               if (existInCacheFolder(pkg, fileDownloadTargetPath, monitor)) {
-                       Log.log("Found the package in cache");
-                       
-                       if (monitor != null) {
-                               monitor.workedDownloadSize(pkg.getPackageSize());
-                       }
-                       
-                       return true;
-               }
+               Performance.setInstallationStartTime();
+               // save target directory
+               initializeTargetDir(targetDir);
                
-               // check the option.
-               if (Options.doInstallNoUI) {
-                       System.out.println(pkg.getPackageName() + " is downloading...");
-               } else if (Options.onlyDownload || Options.downloadPackage) {
-                       System.out.print("Downloading package => " + pkg  + " .......");
-               }
+               //if distribution is changed, remove all packages and install.
+               if (packageManager.isReInstallable()) {
+                       removeAllPackages(monitor);
+               } else {
+                       // remove missing packages
+                       if (!packageManager.isRepoPackagesEmpty()) {
+                               // Remove missing packages only network installation.
+                               if (Config.fromWhere == Config.ConfDialog.SNAPSHOT) {
+                                       removeMissingPackages(monitor);                                 
+                               }
+                       }
 
                // download package from repository
-               long size = mDownloader.download(downloadFileURL, fileDownloadTargetPath, monitor);
+               long size = mDownloader.download(downloadFileURL, downloadTargetPath,
+                               monitor);
 
                if (size >= 0) {
-                       if (Options.onlyDownload || Options.downloadPackage) {
-                               System.out.println(" done.");
+                       if (Options.onlyDownload) {
+                               System.out.println("Download success. => " + pkg);
                        }
                        Log.log("finish download => " + pkg);
                } else { // fail
                        Log.err("download failed => " + downloadFileURL);
 
-                       PathUtil.remove(fileDownloadTargetPath);
+                       PathUtil.remove(downloadTargetPath);
 
                        String errMsg = "";
                        if (monitor.isCanceled()) {
@@ -827,7 +845,7 @@ public class InstallManager {
                                                + pkg.getPackageSize());
                                Log.err("Package size error. downloaded size => " + size);
 
-                               PathUtil.remove(fileDownloadTargetPath);
+                               PathUtil.remove(downloadTargetPath);
 
                                throw new IMFatalException(ErrorCode.PACKAGE_WRONG_SIZE);
                        }
@@ -839,14 +857,18 @@ public class InstallManager {
                                Log.err("Package checksum error downloaded checksum => "
                                                + mDownloader.getFileChecksum());
 
-                               PathUtil.remove(fileDownloadTargetPath);
+                               PathUtil.remove(downloadTargetPath);
 
                                throw new IMFatalException(ErrorCode.PACKAGE_WRONG_CHECKSUM);
                        }
                }
 
-               return true;
-       }
+               int i = 0;
+               for (Package pkg : installablePackages) {
+                       if (monitor != null) {
+                               monitor.workedProcess(pkg.getPackageName());
+                               monitor.worked(++i);
+                       }
 
        private boolean installPackage(Package pkg, String targetDir,
                        InstallProgressMonitor monitor) {
@@ -854,7 +876,7 @@ public class InstallManager {
                initializeTargetDir(targetDir);
 
                // remove packages to update.
-               if (packageManager.isInstalledPackage(pkg) && (packageManager.isReInstallable() || packageManager.isUpdatable(pkg))) {
+               if (packageManager.isInstalledPackage(pkg) && (packageManager.isReInstall() || packageManager.isUpdatable(pkg))) {
                        if (monitor != null) {
                                monitor.workedInstallProgress("Remove the previous version",  0);
                        }
@@ -880,9 +902,7 @@ public class InstallManager {
 
                if (bResult) {// save installed package list
                        packageManager.addPackageToInstalledPackages(pkg);
-                       packageManager.saveInstalledList(PathUtil.get(
-                                       PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                                       Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
+                       packageManager.saveInstalledList();
                } else {
                        Log.log("Installation failed => " + pkg);
 
@@ -1283,15 +1303,18 @@ public class InstallManager {
                }
 
                boolean bResult = false;
-               Installer installer = new Installer();
-               bResult = installer.uninstall(pkg, monitor);
+               if (packageManager.isInstalledPackage(pkg)) {
+                       Installer installer = new Installer();
+
+                       bResult = installer.uninstall(pkg, monitor);
+               } else {
+                       bResult = true;
+               }
                
                // Remove packages in installed package list without result.
                // We don't know that failed packages are working well.
                packageManager.exceptPackageFromInstalledPackages(pkg);
-               packageManager.saveInstalledList(PathUtil.get(
-                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
-                               Config.INSTALLED_PACKAGE_LIST_FILE_NAME));
+               packageManager.saveInstalledList();
 
                Log.log(pkg + " remove end => " + bResult);
                return bResult;
index 829ab24..8917315 100644 (file)
@@ -302,8 +302,8 @@ public class Installer {
 
        private long unZipPackage(Package pkg, String tempDir,
                        IIMProgressMonitor monitor) {
-               String filePath = PathUtil.get(Config.getInstance().getDownloadPkgPath(), pkg.getFileName());
-
+               String filePath = InstallManager.getInstance().getDownloadTargetPath(pkg);
+               
                File pkgFile = new File(filePath);
                if (!pkgFile.exists()) {
                        Log.err(filePath + " doesn't exist");
index 949d08d..249591b 100644 (file)
@@ -377,6 +377,15 @@ public class Options {
                                doRemoveOldSDK = true;
                        } else if (arg.equals("-property")) {
                                propertyLogging = true;
+                       } else if (arg.equals("-skip")) {
+                               if (iter.hasNext()) {
+                                       String skipPackageName = iter.next(); 
+                                       skipPackages.add(skipPackageName);
+                                       Log.log("Skip package => " + skipPackageName);
+                               } else {
+                                       Log.err("-skip requires package name");
+                                       throw new IMFatalException("-skip requires package name");
+                               }
                        } else {
                                Log.err("InstallManager do not support '" + arg + "' option");
                                throw new IMFatalException(ErrorCode.WRONG_OPTION);
index e595d40..acdee33 100644 (file)
@@ -60,13 +60,6 @@ public class Performance {
                downloadStartTime = new Date();
        }
        
-       public static boolean existDownloadStartTime() {
-               if (downloadStartTime != null) {
-                       return true;
-               } else {
-                       return false;
-               }
-       }
        public static void setDownloadEndTime() {
                downloadEndTime = new Date();
        }
@@ -75,6 +68,10 @@ public class Performance {
                installationStartTime = new Date();
        }
        
+       public static Date getInstallationStartTime() {
+               return installationStartTime;
+       }
+       
        public static void setInstallationEndTime() {
                installationEndTime = new Date();
        }
@@ -125,16 +122,16 @@ public class Performance {
                        out.write("Sdk package size\t: " + sdkPackageSize);
                        out.newLine();
                        out.write("The initialization time\t: " + getInitializeTime() + "sec");
-                       out.write("(" + getBitPerSecond(sdkPackageSize / 8, getInitializeTime())+ "byte/sec)");
+                       out.write("(" + getBitPerSecond(sdkPackageSize, getInitializeTime())+ "b/s)");
                        out.newLine();
                        out.write("The download time\t: " + getDownloadTime() + "sec");
-                       out.write("(" + getBitPerSecond(sdkPackageSize / 8, getDownloadTime())+ "byte/sec)");
+                       out.write("(" + getBitPerSecond(sdkPackageSize, getDownloadTime())+ "b/s)");
                        out.newLine();
                        out.write("The installation time\t: " + getInstallationTime() + "sec");
-                       out.write("(" + getBitPerSecond(sdkPackageSize / 8, getInstallationTime())+ "byte/sec)");
+                       out.write("(" + getBitPerSecond(sdkPackageSize, getInstallationTime())+ "b/s)");
                        out.newLine();
                        out.write("The removal time\t: " + getRemovalTime() + "sec");
-                       out.write("(" + getBitPerSecond(sdkPackageSize / 8, getRemovalTime())+ "byte/sec)");
+                       out.write("(" + getBitPerSecond(sdkPackageSize, getRemovalTime())+ "b/s)");
                        out.newLine();
                        out.write("The install-manager start time\t: " + imStartTime);
                        out.newLine();
@@ -166,20 +163,12 @@ public class Performance {
                }
        }
        
-       public static void printTestResultXmlFormat(boolean isForAutomation) {
+       public static void printTestResultXmlFormat() {
                //get file name of test result
                SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMddHHmmss");
                String testFileName = formatter.format(imStartTime) + ".xml";
                
-               String testResultFilePath = "";
-               
-               if (isForAutomation) {
-                       testResultFilePath = PathUtil.get(InstallManagerConstants.getInstallManagerTestResultPath()
-                                       , "result", testFileName);
-               } else {
-                       testResultFilePath = PathUtil.get(InstallManagerConstants.getInstallManagerTestResultPath(), testFileName);
-               }
-               
+               String testResultFilePath = PathUtil.get(InstallManagerConstants.getInstallManagerTestResultPath(), testFileName);
                File testResultFile = new File(testResultFilePath);
                
                if (!testResultFile.getParentFile().exists()) {
@@ -213,7 +202,7 @@ public class Performance {
                }
        }
        
-       public static void printTestResultXmlFormat2(boolean isForAutomation) {
+       public static void printTestResultXmlFormat2() {
                if (installationStartTime != null) {
                        printInstallTestResultXmlFormat(isForAutomation);
                } else {
@@ -253,6 +242,7 @@ public class Performance {
                        out.newLine();
                        out.write(getTestCaseXml("InstallTest", "The installation time", getInstallationTime()));
                        out.newLine();
+                       out.write(getTestCaseXml("TotalInstallationTest", "Total installation time", getTotalInstallationTime()));
                        out.write("</testsuite>");
                } catch (IOException e) {
                        Log.ExceptionLog(e);
@@ -324,14 +314,6 @@ public class Performance {
                return interval;
        }
        
-       public static Date getDownloadStartTime() {
-               return downloadStartTime;
-       }
-       
-       public static Date getInstallationStartTime() {
-               return installationStartTime;
-       }
-       
        private static long getDownloadTime() {
                if (downloadStartTime == null || downloadEndTime == null) {
                        return 0;
@@ -359,6 +341,15 @@ public class Performance {
                return interval;
        }
        
+       private static long getTotalInstallationTime() {
+               if (downloadStartTime == null || installationEndTime == null) {
+                       return 0;
+               }
+               
+               long interval = (installationEndTime.getTime() - downloadStartTime.getTime())/1000;
+               return interval;
+       }
+       
        private static long getRemovalTime() {
                if (removalStartTime == null || removalEndTime == null) {
                        return 0;
@@ -368,11 +359,11 @@ public class Performance {
                return interval;
        }
        
-       private static long getBitPerSecond(long size, long seconds) {
+       private static long getKBPerSecond(long size, long seconds) {
                if (seconds == 0) {
                        return 0;
                } else {
-                       return size/seconds;
+                       return (size/1024/seconds);
                }
        }
 }
index 8280dd0..7e3b758 100644 (file)
@@ -258,6 +258,10 @@ public class Downloader {
                                        // normal operation. to do nothing.
                                }
                        }
+                       
+                       if (writeSizePerSecond > 0 && monitor != null) {
+                               monitor.workedDownloadSize(writeSizePerSecond);
+                       }
                } catch (SocketTimeoutException e) {
                        Log.ExceptionLog(e);
                        ErrorController.setError(ErrorCode.SERVER_CONNECTION_TIME_OUT);
@@ -668,6 +672,10 @@ public class Downloader {
                        List<Proxy> proxyList = NetworkProxy.getSystemProxyList(url);
 
                        for (Proxy proxy : proxyList) {
+                               if (proxy == Proxy.NO_PROXY) {
+                                       proxy = NetworkProxy.getHttpDirectProxy(url);
+                               }
+                               
                                if (bRet = connectToURL(url, proxy)) {
                                        break;
                                }
index f839d53..75d2b30 100644 (file)
@@ -228,6 +228,7 @@ public class ErrorController {
         * @param errorCode
         */
        static public void setError(ErrorCode errorCode) {
+               mInstallationStatus = false;
                mErrorCode = errorCode;
        }
 
@@ -244,6 +245,7 @@ public class ErrorController {
        }
        
        static public void setErrorMessage(String msg) {
+               mInstallationStatus = false;
                mErrorCode = null; 
                errorMsg = msg;
        }
index 8d233ff..aaba8e0 100644 (file)
@@ -68,4 +68,4 @@ public interface IIMProgressMonitor extends IProgressMonitor{
         */\r
        public void workedRefresh();\r
     public void setError(int errorCode);\r
- }\r
+}\r
index 62f6704..f0c2023 100644 (file)
@@ -448,7 +448,6 @@ public abstract class PackageManager {
                                        }
                        }
                }
-               
                return true;
        }
        
@@ -932,7 +931,7 @@ public abstract class PackageManager {
         */
        public PackageSet getInstallablePackages(PackageSet selectedMetas) {
                PackageSet installablePackages = null;
-               if (isReInstallable()) {
+               if (isReInstall()) {
                        installablePackages = dep(selectedMetas, State.INSTALL);
                } else if (Config.isSupportMultiSDK()) {
                        if (Config.status == Config.Status.INSTALL) {
@@ -1749,10 +1748,11 @@ public abstract class PackageManager {
         * save packages to installedpackage.list
         * @param filePath
         */
-       public void saveInstalledList(String filePath) {
-       if (filePath == null) {
-               return;
-       }
+       public void saveInstalledList() {
+               String filePath = PathUtil.get(
+                               PathUtil.getFromInstalledPath(Config.INFO_DIRECTORY),
+                               Config.INSTALLED_PACKAGE_LIST_FILE_NAME);
+               
         PropertyParser parser = new PropertyParser();
         List<PropertySection> pSections = saveProperySectionsFromPackages(installedPackages);
         parser.writeToFile(pSections, filePath);
@@ -1806,7 +1806,7 @@ public abstract class PackageManager {
         * If there has been a change distribution or repository or SDK image, force to re-install.
         * @return If it needs to re-install, return true. otherwise return false.
         */
-       public boolean isReInstallable() {
+       public boolean isReInstall() {
                if (isInstallInstallManager) {
                        return  false;
                } else if (Config.fromWhere == Config.ConfDialog.LOCAL_IMAGE) {
@@ -1822,6 +1822,10 @@ public abstract class PackageManager {
                }
        }
        
+       public boolean isConflict(PackageSet pkgsToInstall, Package pkg) {
+               return false;
+       }
+       
        /**
         * Prints dependency graph of packages in dot format to stdout.
         * @throws IMExitException 
index 108712a..e33853b 100644 (file)
@@ -34,12 +34,12 @@ import java.util.Collection;
 import java.util.HashSet;
 import java.util.List;
 
-import org.tizen.installmanager.core.Config;
 import org.tizen.installmanager.core.IMFatalException;
 import org.tizen.installmanager.core.Options;
 import org.tizen.installmanager.lib.ErrorController.ErrorCode;
 import org.tizen.installmanager.lib.Log;
 import org.tizen.installmanager.lib.Platform;
+import org.tizen.installmanager.util.PathUtil;
 
 /**
  * This class describes a package.
@@ -101,7 +101,7 @@ public class Package {
        private static final String START_OF_OS_DEPENDENCY = "[";
        
        private List<Property> mProperties;
-       private URL baseURL = null;
+       private URL baseURL = null; 
        private URL url; // url to the package zip file
        
        private static final int LOWEST_ORDER = 100;
@@ -117,14 +117,13 @@ public class Package {
         */
        public Package(Properties properties, String repoBaseUrl) {
                this(properties);
+               
                try {
-                       this.baseURL = new URL(repoBaseUrl);
-                       this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));
-//                     if (Config.fromWhere == Config.ConfDialog.LOCAL_IMAGE) { // data from file dialog for local installing
-//                             this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));
-//                     } else { // data from snapshot and normal 'next' case
-//                             this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));                             
-//                     }
+                       if (Config.fromWhere == Config.ConfDialog.LOCAL_IMAGE) { // data from file dialog for local installing
+                               this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));
+                       } else { // data from snapshot and normal 'next' case
+                               this.url = new URL(repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));                             
+                       }
                } catch (MalformedURLException e) {
                        Log.err("Invalid package url: "+repoBaseUrl + "/" +  getValue(FIELD_FILE_PATH));
                        throw new IMFatalException(ErrorCode.WRONG_PACKAGE_URL);
index e1fa0d8..c6c7fa8 100644 (file)
@@ -719,7 +719,8 @@ public class InstallManagerWindow extends ApplicationWindow {
                // Download all meta packages. 
                boolean filteredPackages = false;
                try {
-                       filteredPackages = installManager.downloadPackages(downloadablePkgs, null);
+                       filteredPackages = installManager.downloadPackages(
+                               downloadablePkgs, null);
                } catch (IMNetworkException e) {
                        Log.ExceptionLog(e);
                        return;
@@ -844,7 +845,13 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        Log.log("Fail to command line install.");
                                        System.out.println("Fail to console install.");
                                }
-                               Performance.printToLogFile();
+                               
+                               Performance.setIMEndTime();
+                               if (Options.doTest) {
+                                       Performance.printTestResultXmlFormat();
+                                       Performance.printTestResultXmlFormat2();
+                               }
+                               
                                System.exit(0);
                        } else if (Options.doRemoveNoUI) {
                                if (InstallManagerNoUI.cliUninstall(Options.packages)) {
@@ -862,7 +869,13 @@ public class InstallManagerWindow extends ApplicationWindow {
                                        Log.log("Fail to command line remove.");
                                        System.out.println("Fail to remove.");
                                }
-                               Performance.printToLogFile();
+                               
+                               Performance.setIMEndTime();
+                               if (Options.doTest) {
+                                       Performance.printTestResultXmlFormat();
+                                       Performance.printTestResultXmlFormat2();
+                               }
+                               
                                System.exit(0);
                        } else if (Options.showVersion) {
                                showInstallManagerVersion();
@@ -958,10 +971,8 @@ public class InstallManagerWindow extends ApplicationWindow {
                        Performance.printToLogFile();
                        
                        if (Options.doTest) {
-                               Performance.printTestResultXmlFormat(true);
-                               Performance.printTestResultXmlFormat2(true);
-                               Performance.printTestResultXmlFormat(false);
-                               Performance.printTestResultXmlFormat2(false);
+                               Performance.printTestResultXmlFormat();
+                               Performance.printTestResultXmlFormat2();
                        }
                        
                        Log.LogTitle("Installmanager finish");
index 814fc34..e3b586c 100644 (file)
@@ -258,7 +258,7 @@ public class ViewController {
 //                     return false;
 //             }
                
-               if (packageManager.isReInstallable()) {
+               if (packageManager.isReInstall()) {
                        return true;
                } else {
                        return !packageManager.existInstalledPackages();
@@ -516,7 +516,7 @@ public class ViewController {
        }
        
        private InstallState getState(Package pkg) {
-               if (PackageManager.getInstance().isReInstallable()) {
+               if (PackageManager.getInstance().isReInstall()) {
                        return InstallState.INSTALL;
                } else if (Config.isSupportMultiSDK()) {
                        if (Config.status == Config.Status.INSTALL) {
diff --git a/InstallManager_java/src/res/new_images/btn_welcome_page_update_hover.png b/InstallManager_java/src/res/new_images/btn_welcome_page_update_hover.png
deleted file mode 100644 (file)
index 37c0bb8..0000000
Binary files a/InstallManager_java/src/res/new_images/btn_welcome_page_update_hover.png and /dev/null differ
diff --git a/InstallManager_java/src/res/new_images/btn_welcome_page_update_normal.png b/InstallManager_java/src/res/new_images/btn_welcome_page_update_normal.png
deleted file mode 100644 (file)
index 06cdf89..0000000
Binary files a/InstallManager_java/src/res/new_images/btn_welcome_page_update_normal.png and /dev/null differ