2 # -*- coding: utf-8 -*-
4 # This file is part of Karesansui.
6 # Copyright (C) 2009-2010 HDE, Inc.
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License
10 # as published by the Free Software Foundation; either version 2
11 # of the License, or (at your option) any later version.
17 @file: update_software.py
18 @author: Kei Funagayama <kei@karesansui-project.info>
22 Karesansuiパッケージをアップデートする。
24 使用方法: update_software.py [オプション]
27 --version プログラムのバージョンを表示
37 from optparse import OptionParser
39 from ksscommand import KssCommand, KssCommandException
45 from karesansui import __version__
46 from karesansui.lib.virt.virt import KaresansuiVirtConnection
47 from karesansui.lib.utils import load_locale
49 print >>sys.stderr, "[Error] karesansui package was not found."
54 usage = '%prog [options]'
57 optp = OptionParser(usage=usage, version=__version__)
58 return optp.parse_args()
63 class UpdateSoftware(KssCommand):
66 (opts, args) = getopts()
70 import karesansui.plus.updater
71 yu = karesansui.plus.updater.YumUpdater(karesansui.config)
79 raise KssCommandException('failed to update software.')
82 self.logger.info('Has been updated.')
83 print >>sys.stderr, 'Has been updated.'
85 self.logger.info('Which did not have to be updated..')
86 print >>sys.stderr, 'Which did not have to be updated.'
92 if __name__ == "__main__":
93 target = UpdateSoftware()
94 sys.exit(target.run())