2
# update-manager.in - easy updating application
4
# Copyright (c) 2004-2008 Canonical
5
# 2004-2008 Michael Vogt
8
# Author: Tollef Fog Heen <tfheen@err.no>
9
# Michiel Sikkes <michiel@eyesopened.nl>
10
# Michael Vogt <mvo@debian.org>
12
# This program is free software; you can redistribute it and/or
13
# modify it under the terms of the GNU General Public License as
14
# published by the Free Software Foundation; either version 2 of the
15
# License, or (at your option) any later version.
17
# This program is distributed in the hope that it will be useful,
18
# but WITHOUT ANY WARRANTY; without even the implied warranty of
19
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
# GNU General Public License for more details.
22
# You should have received a copy of the GNU General Public License
23
# along with this program; if not, write to the Free Software
24
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
34
from UpdateManagerHildon.UpdateManagerHildon import UpdateManagerHildon
35
from DistUpgrade.DistUpgradeVersion import VERSION
37
from gettext import gettext as _
39
from optparse import OptionParser
41
if __name__ == "__main__":
43
DIR="/usr/share/locale"
47
gettext.bindtextdomain(APP, DIR)
48
gettext.textdomain(APP)
49
gtk.glade.bindtextdomain(APP, DIR)
50
gtk.glade.textdomain(APP)
52
# Begin parsing of options
53
parser = OptionParser()
54
parser.add_option ("-V", "--version", action="store_true",
55
dest="show_version", default=False,
56
help=_("Show version and exit"))
57
parser.add_option ("-c", "--check-dist-upgrades", action="store_true",
58
dest="check_dist_upgrades", default=False,
59
help=_("Check if a new distribution release is available"))
60
parser.add_option ("-d", "--devel-release", action="store_true",
61
dest="devel_release", default=False,
62
help=_("Check if upgrading to the latest devel release "
64
parser.add_option ("-p","--proposed", action="store_true",
65
dest="use_proposed", default=False,
66
help=_("Try to run a dist-upgrade"))
67
parser.add_option ("--dist-upgrade","--dist-ugprade", action="store_true",
68
dest="dist_upgrade", default=False,
69
help=_("Try to run a dist-upgrade"))
71
(options, args) = parser.parse_args()
73
data_dir="/usr/share/update-manager/"
74
#data_dir="/tmp/xxx/share/update-manager/"
76
if options.show_version:
77
print "%s: version %s" % (os.path.basename(sys.argv[0]), VERSION)
80
if options.dist_upgrade == True:
81
from DistUpgrade.DistUpgradeViewGtk import DistUpgradeViewGtk
82
from DistUpgrade.DistUpgradeController import DistUpgradeController
83
# FIXME: Having a "partial upgrade" view here would make it possible
84
# to get rid of the ugly hideStep() stuff
85
view = DistUpgradeViewGtk(data_dir)
86
view.label_title.set_markup("<b><big>%s</big></b>" % _("Running partial upgrade"))
87
controler = DistUpgradeController(view, datadir=data_dir)
88
controler.doPartialUpgrade()
90
app = UpdateManagerHildon(data_dir)