[Title] Removed update command of pkg-cli
authordonghyuk.yang <donghyuk.yang@samsung.com>
Wed, 13 Mar 2013 10:49:22 +0000 (19:49 +0900)
committerdonghyuk.yang <donghyuk.yang@samsung.com>
Wed, 13 Mar 2013 10:49:22 +0000 (19:49 +0900)
README
pkg-cli
src/pkg_server/client.rb
src/pkg_server/clientOptParser.rb
src/pkg_server/downloader.rb
test/pkg-cli-update.testcase [deleted file]
test/pkg-cli.testsuite

diff --git a/README b/README
index f373da2cbc1332e56f58eccfd053eceb24a19b55..9bbb9a1b9ab6151daa49a7a0769d2b6b1a8a8d64 100644 (file)
--- a/README
+++ b/README
@@ -194,21 +194,12 @@ There are more useful commands provided
 4.1 List Up Available Packages
 You can list up available packages of server.
 
-    ## pkg-cli list-rpkg [-o <os>] [-u <package server url>] 
+    ## pkg-cli list-rpkg -u <package server url> [-o <os>]
     ## -o : Target OS(ubuntu-32/ubuntu-64/windows-32/windows-64/macos-64)
     ## -u : Package server URL which contains binary and development packages.
     ##      If ommited, it will use previous server URL.
 
     1. List up packages
-        ex) 
-            
-            $ pkg-cli update -u http://172.21.17.55/dibs/unstable_release
-
-        ex) 
-            
-            $ pkg-cli list-rpkg
-
-    2. List up packages with updating
         ex) 
         
             $ pkg-cli list-rpkg -u http://172.21.17.55/dibs/unstable_release
@@ -224,41 +215,7 @@ You can list up packages of your install directory
         
             $ pkg-cli list-lpkg -l ~/tizen_sdk
 
-4.2 Update Package List
-You should have package list of server in your host before listing, installing and downloading packages. So, if you want to install the latest package, then you should update your package list before installing.
-
-    ## pkg-cli update [-u <package server url>] 
-    ## -u : Package server URL which contains binary and development packages.
-    ##      If ommited, it will use previous server URL.
-
-    1. Update package list from server
-        ex) 
-
-            $ pkg-cli update -u http://172.21.17.55/dibs/unstable_release
-
-    2. Install / download packages from server
-        ex) 
-
-            $ pkg-cli install -p nativeapp-eplugin -l ~/tizen_sdk
-
-        ex) 
-
-            $ pkg-cli install -p unittest-eplugin -l ~/tizen_sdk
-
-        ex) 
-
-            $ pkg-cli download -p base-ide-product -l ~/downloads
-
-    3. If package is updated on server and you want to use is, you should update your package list. If you do not set the server url, it will be set previous server URL.
-        ex) 
-
-            $ pkg-cli update
-
-        ex) 
-
-            $ pkg-cli install -p nativeapp-eplugin -l ~/tizen_sdk
-        
-4.3 Upgrade Packages
+4.2 Upgrade Packages
 You can upgrade your installed packages from server.
 
     ## pkg-cli upgrade -l <location> -u <package server url>
@@ -270,28 +227,22 @@ You can upgrade your installed packages from server.
     1. Check package for upgrading
         ex)
 
-            $ pkg-cli update -u http://172.21.17.55/dibs/unstable_release
-            $ pkg-cli check-upgrade -l ~/tizen_sdk
+            $ pkg-cli check-upgrade -l ~/tizen_sdk -u http://172.21.17.55/dibs/unstable_release
 
     2. Upgrade packages
-        ex)
-
-            $ pkg-cli upgrade -l ~/tizen_sdk
-
-    3. Upgrade packages with updating
         ex)
         
             $ pkg-cli upgrade -l ~/tizen_sdk -u http://172.21.17.55/dibs/unstable_release
 
-    4. If you want to upgrade specific package, you can upgrade it as installing
+    3. If you want to upgrade specific package, you can upgrade it as installing
         ex)
 
             $ pkg-cli install -p common-eplugin -l ~/tizen_sdk -u http://172.21.17.55/dibs/unstable_release
 
-4.4 Install SDK
+4.3 Install SDK
 You can also install new SDK using the network install command. Originally this command is used for installing packages by network. But you can set "TIZEN-SDK" as package name, all Tizen SDK packages will be installed.
 
-    ## pkg-cli install -p <package name> [-u <package server url>] [-l <location>] [-t] [-f]
+    ## pkg-cli install -p <package name> -u <package server url> [-l <location>] [-t] [-f]
     ## -p : Binary package name which you want to install
     ## -u : Package server URL which contains binary and development packages.
     ##      If ommited, it will use previous server URL.
@@ -304,7 +255,7 @@ You can also install new SDK using the network install command. Originally this
     1. Install "TIZEN-SDK" by network to new location("~/tizen_sdk2")
         ex) 
 
-            $ pkg-cli install -p TIZEN-SDK -l ~/tizen_sdk2 -t
+            $ pkg-cli install -p TIZEN-SDK -u http://172.21.17.55/dibs/unstable_release -l ~/tizen_sdk2 -t
 
     2. Change Tizen SDK configuration
         ex) 
diff --git a/pkg-cli b/pkg-cli
index 9917496a5ce2df4cea427fc5211509dacd35954e..9cbb4c8ac84bca6825b73663fc7578e2d6bd635e 100755 (executable)
--- a/pkg-cli
+++ b/pkg-cli
@@ -62,9 +62,6 @@ if option[:os].nil? then
 end
 
 case option[:cmd]
-when "update" then
-       client = Client.new( option[:url], nil, nil )
-       #client.update()
 when "clean" then
        client = Client.new( nil, option[:loc], nil, false )
        client.clean(option[:f])
@@ -122,7 +119,7 @@ when "list-lpkg" then
                puts "Info: There is no any package."
        end
 when "build-dep" then
-       client = Client.new( nil, nil, nil )
+       client = Client.new( option[:url], nil, nil )
        result = client.get_build_dependent_packages( option[:pkg], option[:os], true )
        if result.nil? then
                puts "Error: Failed to get remote package list. try update first."
@@ -136,7 +133,7 @@ when "build-dep" then
        ret[-3..-1] = ""
        puts ret
 when "install-dep" then
-       client = Client.new( nil, nil, nil )
+       client = Client.new( option[:url], nil, nil )
        result = client.get_install_dependent_packages( option[:pkg], option[:os], true, false )
        if result.nil? then
                puts "Error: Failed to get remote package list. try update first."
index 366b228e40e8e9236e28fcce048595aa79607ceb..447b0907866528a9a1fadc1771bdcc3b3b586ebd 100644 (file)
@@ -269,7 +269,7 @@ class Client
                        pkg_checksum = get_attr_from_pkg(p, os, "checksum")
                        pkg_size = get_attr_from_pkg(p, os, "size")
                        if pkg_path.nil? or pkg_ver.nil? then
-                               @log.error "\"#{p}\" package does not exist in package server. If it exist in package server, then try \"pkg-cli update\""
+                               @log.error "\"#{p}\" package does not exist in package server. Check if it exist in package server"
                                return nil
                        end
                        url = surl + pkg_path
@@ -827,7 +827,7 @@ class Client
                remote_pkg_hash = pkg_hash_os[os]
 
                if remote_pkg_hash.nil? then
-                       @log.error "There is no remote package list for #{os}. please pkg-cli update"
+                       @log.error "There is no remote package list for #{os}."
                        return nil
                end
 
index 4b5b8be31b7d72ded7abc6332c1f523eeae27618..dd5caa8bbc8ca22a1d0993225d1cd37b2e516eff 100644 (file)
@@ -40,27 +40,33 @@ def option_error_check( options )
 
        case options[:cmd]
 
-       when "update" then
-
        when "clean" then
 
        when "upgrade" then
+               if options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli upgrade -u <package server url> [-l <location>] [-o <os>] [--trace]"                               
+               end                             
 
        when "check-upgrade" then
-
+               if options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli check-upgrade -u <package server url> [-l <location>] [-o <os>]"                           
+               end
+               
        when "download" then
-               if options[:pkg].nil? or options[:pkg].empty? then
-                       raise ArgumentError, "Usage: pkg-cli download -P <package name> [-o <os>] [-l <location>] [-u <package server url>] [--trace]"
+               if options[:pkg].nil? or options[:pkg].empty? or
+                               options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli download -P <package name> -u <package server url> [-o <os>] [-l <location>] [--trace]"
                end
 
        when "install" then
-               if options[:pkg].nil? or options[:pkg].empty? then
-                       raise ArgumentError, "Usage: pkg-cli install -P <package name> [-o <os>] [-l <location>] [-u <package server url>] [--trace] [--force]"
+               if options[:pkg].nil? or options[:pkg].empty? or
+                               options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli install -P <package name> -u <package server url> [-o <os>] [-l <location>] [--trace] [--force]"
                end
 
        when "install-file" then
                if options[:pkg].nil? or options[:pkg].empty? then
-                       raise ArgumentError, "Usage: pkg-cli install-lpkg -P <package file> [-l <location>] [-u <package server url>] [--trace] [--force]"
+                       raise ArgumentError, "Usage: pkg-cli install-file -P <package file> [-l <location>] [-u <package server url>] [--trace] [--force]"
                end
 
        when "uninstall" then
@@ -69,11 +75,15 @@ def option_error_check( options )
                end
 
        when "show-rpkg" then
-               if options[:pkg].nil? or options[:pkg].empty? then
-                       raise ArgumentError, "Usage: pkg-cli show-rpkg -P <package name> [-o <os>] [-u <package server url>]"
+               if options[:pkg].nil? or options[:pkg].empty? or
+                               options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli show-rpkg -P <package name> -u <package server url> [-o <os>]"
                end
 
        when "list-rpkg" then
+               if options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli list-rpkg -u <package server url> [-o <os>]"                       
+               end
 
        when "show-lpkg" then
                if options[:pkg].nil? or options[:pkg].empty? then
@@ -83,13 +93,15 @@ def option_error_check( options )
        when "list-lpkg" then
 
        when "build-dep" then
-               if options[:pkg].nil? or options[:pkg].empty? then
-                       raise ArgumentError, "Usage: pkg-cli build-dep -P <package name> [-o <os>]"
+               if options[:pkg].nil? or options[:pkg].empty? or
+                               options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli build-dep -P <package name> -u <package server url> [-o <os>]"
                end
 
        when "install-dep" then
-               if options[:pkg].nil? or options[:pkg].empty? then
-                       raise ArgumentError, "Usage: pkg-cli install-dep -P <package name> [-o <os>]"
+               if options[:pkg].nil? or options[:pkg].empty? or
+                               options[:url].nil? or options[:url].empty? then
+                       raise ArgumentError, "Usage: pkg-cli install-dep -P <package name> -u <package server url> [-o <os>]"
                end
 
        when "register"
@@ -108,7 +120,6 @@ def option_parse
        banner = "Requiest service to package-server and control packages service command-line tool." + "\n" \
                + "\n" + "Usage: pkg-cli <SUBCOMMAND> [OPTS] or pkg-cli (-h|-v)" + "\n" \
                + "\n" + "Subcommands:" + "\n" \
-               + "\t" + "update        Update to the latest package in your SDK environment." + "\n" \
                + "\t" + "clean         Delete the package in your SDK environment." + "\n" \
                + "\t" + "download      Download the package in your SDK environment." + "\n" \
                + "\t" + "install       Download the package from package-server and install the package in your SDK environment." + "\n" \
@@ -123,20 +134,19 @@ def option_parse
                + "\t" + "build-dep     Show build-dependency packages" + "\n" \
                + "\t" + "install-dep   Show install-dependency packages" + "\n" \
                + "\n" + "Subcommand usage:" + "\n" \
-               + "\t" + "pkg-cli update [-u <remote server url>]" + "\n" \
                + "\t" + "pkg-cli clean [-l <location>] [--force]" + "\n" \
-               + "\t" + "pkg-cli download -P <package name> [-o <os>] [-l <location>] [-u <package server url>] [--trace]" + "\n" \
-               + "\t" + "pkg-cli install -P <package name> [-o <os>] [-l <location>] [-u <package server url>] [--trace] [--force]" + "\n" \
+               + "\t" + "pkg-cli download -P <package name> -u <package server url> [-o <os>] [-l <location>] [--trace]" + "\n" \
+               + "\t" + "pkg-cli install -P <package name> -u <package server url> [-o <os>] [-l <location>] [--trace] [--force]" + "\n" \
                + "\t" + "pkg-cli install-file -P <package file> [-l <location>] [-u <package server url>] [--trace] [--force]" + "\n" \
                + "\t" + "pkg-cli uninstall -P <package name> [-l <location>] [--trace]" + "\n" \
-               + "\t" + "pkg-cli upgrade [-l <location>] [-o <os>] [-u <package server url>] [--trace]" + "\n" \
-               + "\t" + "pkg-cli check-upgrade [-l <location>] [-o <os>] [-u <package server url>]" + "\n" \
-               + "\t" + "pkg-cli show-rpkg -P <package name> [-o <os>] [-u <package server url>]" + "\n"  \
-               + "\t" + "pkg-cli list-rpkg [-o <os>] [-u <package server url>]" + "\n" \
+               + "\t" + "pkg-cli upgrade -u <package server url> [-l <location>] [-o <os>] [--trace]" + "\n" \
+               + "\t" + "pkg-cli check-upgrade -u <package server url> [-l <location>] [-o <os>]" + "\n" \
+               + "\t" + "pkg-cli show-rpkg -P <package name> -u <package server url> [-o <os>]" + "\n"  \
+               + "\t" + "pkg-cli list-rpkg -u <package server url> [-o <os>]" + "\n" \
                + "\t" + "pkg-cli show-lpkg -P <package name> [-l <location>]" + "\n"  \
                + "\t" + "pkg-cli list-lpkg [-l <location>]" + "\n" \
-               + "\t" + "pkg-cli build-dep -P <package name> [-o <os>]" + "\n" \
-               + "\t" + "pkg-cli install-dep -P <package name> [-o <os>]" + "\n" \
+               + "\t" + "pkg-cli build-dep -P <package name> -u <package server url> [-o <os>]" + "\n" \
+               + "\t" + "pkg-cli install-dep -P <package name> -u <package server url> [-o <os>]" + "\n" \
                + "\t" + "pkg-cli register -P <package file path> -a <server address> -d <distribution name> -w <password>" + "\n" \
                + "\n" + "Options:" + "\n"
 
@@ -195,7 +205,7 @@ def option_parse
        end
 
        cmd = ARGV[0]
-       if cmd.eql? "update" or cmd.eql? "download" or
+       if  cmd.eql? "download" or
                cmd.eql? "install" or cmd.eql? "show-rpkg" or
                cmd.eql? "list-rpkg" or
                cmd.eql? "uninstall" or cmd.eql? "show-lpkg" or
index fafefc40212937b25e6248557204fd91ab766988..9d28540723cd4b4ff38f069b8287eba8cf5c95bc 100644 (file)
@@ -47,7 +47,6 @@ class FileDownLoader
                if is_remote then
                        if logger.path.nil? or logger.path.empty? then
                                ret = system "wget #{url} -O #{fullpath} -nv --tries=3"
-                               puts ret                                
                        else                            
                                pid,status = Utils.execute_shell_with_log( "wget #{url} -O #{fullpath} -nv --tries=3", logger.path )
                                if not status.nil? then
diff --git a/test/pkg-cli-update.testcase b/test/pkg-cli-update.testcase
deleted file mode 100644 (file)
index 3c6fa52..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#PRE-EXEC
-#EXEC
-../pkg-cli update -u http://172.21.111.132/testserver3/unstable
-#POST-EXEC
-#EXPECT
-Update package list from "http://172.21.111.132/testserver3/unstable".. OK
index 21c2fe0f8ef06f17d761d5501e60d0211339507b..a29c240ca8b63e677c1b9543856f34af3d310be7 100644 (file)
@@ -1,4 +1,3 @@
-pkg-cli-update.testcase
 pkg-cli-listrpkg.testcase
 pkg-cli-showrpkg.testcase
 pkg-cli-download.testcase