[Title] Add '-accept_license' option.
authoryongsung1.kim <yongsung1.kim@samsung.com>
Thu, 5 Sep 2013 05:42:06 +0000 (14:42 +0900)
committeryongsung1.kim <yongsung1.kim@samsung.com>
Thu, 5 Sep 2013 05:42:06 +0000 (14:42 +0900)
[Issue] redmine #10400

Change-Id: I812bbc6f3cdbeb9cde683131b5124ee3173f5e62

InstallManager_java/src/org/tizen/installmanager/cli/InstallManagerNoUI.java
InstallManager_java/src/org/tizen/installmanager/core/Options.java
InstallManager_java/src/org/tizen/installmanager/ui/InstallManagerWindow.java

index 3c43aea..bec35c7 100644 (file)
@@ -51,6 +51,13 @@ public class InstallManagerNoUI {
        private static final String SDK_IMAGE_ZIP_EXTENSION = ".zip";
 
        public static boolean cliInstall(List<String> packageNames) throws IMExitException {
+               if (!Options.isAgreeLicense) {
+                       System.out.println("You must agree the licenses of Tizen SDK components before installing SDK.");
+                       System.out.println("If you agree them, use '-accept_license' option.");
+                       Log.err("Cannot find '-accept_license' option.");
+                       return false;
+               }
+               
                if (Options.isNetwork) {
                        return cliNetworkInstall(packageNames);
                } else {
index 355e86e..aec428e 100644 (file)
@@ -50,17 +50,6 @@ public class Options {
        public static boolean doPackageValidation = true;
        
        /**
-     * Do auto install without GUI
-     */
-       public static boolean doInstallNoUI = false;
-       public static boolean doRemoveNoUI = false;
-       public static boolean doUpdateNoUI = false;
-       public static boolean doShowDistListNoUI = false;
-       public static boolean doShowPackageListNoUI = false;
-       public static boolean doShowSDKInstallStatus = false;
-       public static boolean doShowHelp = false;
-       
-       /**
         * Do download package file.
         */
        public static boolean onlyDownload = false;
@@ -127,8 +116,16 @@ public class Options {
        public static boolean snapshot = false;
        
        /**
-        * Use cli mode
-        */
+     * Do auto install or uninstall without GUI
+     */
+       public static boolean doInstallNoUI = false;
+       public static boolean doRemoveNoUI = false;
+       public static boolean doUpdateNoUI = false;
+       public static boolean doShowDistListNoUI = false;
+       public static boolean doShowPackageListNoUI = false;
+       public static boolean doShowSDKInstallStatus = false;
+       public static boolean doShowHelp = false;
+       
        public static String repository = null;
        public static String imageFilePath = null;
        public static String snapshotPath = null;
@@ -142,6 +139,8 @@ public class Options {
        public static List<String> packages = new ArrayList<String>();
        public static List<String> skipPackages = new ArrayList<String>();
        
+       public static boolean isAgreeLicense = false;
+       
        /**
         * Use only download for making SDK image.
         */
@@ -442,6 +441,18 @@ public class Options {
                        }
                }
                
+               // set license agreement
+               if (doInstallNoUI) {
+                       argIter = argArray.iterator();
+                       while (argIter.hasNext()) {
+                               if (argIter.next().equalsIgnoreCase("-accept_license")) {
+                                       argIter.remove();
+                                       isAgreeLicense = true;
+                               }
+                       }                       
+               }
+               
+               // set sdk data directory
                argIter = argArray.iterator();
                while (argIter.hasNext()) {
                        if (argIter.next().equalsIgnoreCase("-w")) {
index 640223f..04a64f6 100644 (file)
@@ -75,7 +75,6 @@ import org.tizen.installmanager.lib.exception.IMNetworkException;
 import org.tizen.installmanager.pkg.lib.PackageManager;
 import org.tizen.installmanager.pkg.model.ConfigFile;
 import org.tizen.installmanager.pkg.model.PackageSet;
-import org.tizen.installmanager.pkg.model.Property;
 import org.tizen.installmanager.ui.dialog.AddExtraRepositoryDialog;
 import org.tizen.installmanager.ui.dialog.IndeterminateProgressDialog;
 import org.tizen.installmanager.ui.dialog.MessageBoxDlg;