7 Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
10 Taejun Ha <taejun.ha@samsung.com>
11 Jiil Hyoun <jiil.hyoun@samsung.com>
12 Donghyuk Yang <donghyuk.yang@samsung.com>
13 DongHee Yang <donghee.yang@samsung.com>
15 Licensed under the Apache License, Version 2.0 (the "License");
16 you may not use this file except in compliance with the License.
17 You may obtain a copy of the License at
19 http://www.apache.org/licenses/LICENSE-2.0
21 Unless required by applicable law or agreed to in writing, software
22 distributed under the License is distributed on an "AS IS" BASIS,
23 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
24 See the License for the specific language governing permissions and
25 limitations under the License.
32 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/common"
33 $LOAD_PATH.unshift File.dirname(__FILE__)+"/src/pkg_server"
35 require "packageServer"
36 require "serverOptParser"
42 puts "\n=============== Error occured =============================="
44 puts e.backtrace.inspect
45 puts "=============================================================\n"
50 if option[:cmd].eql? "list" then
51 if option[:id].empty? then
54 PackageServer.list_dist option[:id]
59 server = PackageServer.new( option[:id] )
62 raise RuntimeError, "server class creation fail"
67 server.create( option[:id], option[:dist], option[:url], option[:loc] )
69 server.register( option[:spkgs], option[:bpkgs], option[:dist], option[:gensnap], option[:test] )
71 server.generate_snapshot( option[:snap], option[:dist], option[:bsnap], option[:bpkgs] )
73 server.sync( option[:dist], option[:force] )
75 server.add_distribution( option[:dist], option[:url], option[:clone] )
77 server.find_source_package_path( option[:dist], option[:spkgs] )
79 if not option[:force] then
80 puts "Do you want to really? then input \"YES\""
81 input = $stdin.gets.strip
82 if input.eql? "YES" then
85 puts "Remove is canceled by user input"
90 server.remove_server( option[:id] )
92 server.remove_pkg( option[:id], option[:dist], option[:bpkgs], option[:os] )
94 raise RuntimeError, "input option incorrect : #{option[:cmd]}"
97 puts "\n=============== Error occured =============================="
99 puts e.backtrace.inspect
100 puts "=============================================================\n"