diff options
| author | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-02 10:07:30 +0200 |
|---|---|---|
| committer | Michael Vogt <michael.vogt@ubuntu.com> | 2006-08-02 10:07:30 +0200 |
| commit | 19639e82319463cfb5c311155d63e06dd8ad5bde (patch) | |
| tree | 9f91c83245bc506fff0eede68f6e8921cacbb3dc /UpdateManager | |
| parent | cc6eb736ca4613d70c3f7ff30317af340ca70bb7 (diff) | |
| download | python-apt-19639e82319463cfb5c311155d63e06dd8ad5bde.tar.gz | |
* data/update-manager.schemas.in:
- set check_dist_upgrades to True again
* UpdateManager/DistUpgradeFetcher.py, UpdateManager/MetaRelease.py:
- handle the situation when run as non-root
* UpdateManager/UpdateManager.py:
- cleanup (removed dead code)
Diffstat (limited to 'UpdateManager')
| -rw-r--r-- | UpdateManager/DistUpgradeFetcher.py | 5 | ||||
| -rw-r--r-- | UpdateManager/MetaRelease.py | 10 | ||||
| -rw-r--r-- | UpdateManager/UpdateManager.py | 17 |
3 files changed, 11 insertions, 21 deletions
diff --git a/UpdateManager/DistUpgradeFetcher.py b/UpdateManager/DistUpgradeFetcher.py index aa51066a..4aacdae4 100644 --- a/UpdateManager/DistUpgradeFetcher.py +++ b/UpdateManager/DistUpgradeFetcher.py @@ -190,7 +190,10 @@ class DistUpgradeFetcher(object): def runDistUpgrader(self): #print "runing: %s" % script - os.execv(self.script,[]) + if os.getuid() != 0: + os.execv("/usr/bin/gksu",["gksu",self.script]) + else: + os.execv(self.script,[self.script]) def cleanup(self): # cleanup diff --git a/UpdateManager/MetaRelease.py b/UpdateManager/MetaRelease.py index 57a808ee..70993eaf 100644 --- a/UpdateManager/MetaRelease.py +++ b/UpdateManager/MetaRelease.py @@ -60,8 +60,15 @@ class MetaRelease(gobject.GObject): def __init__(self, useDevelopmentRelase=False): gobject.GObject.__init__(self) + # check what uri to use if useDevelopmentRelase: self.METARELEASE_URI = self.METARELEASE_URI_UNSTABLE + # check if we can access the METARELEASE_FILE + if not os.access(self.METARELEASE_FILE, os.F_OK|os.W_OK|os.R_OK): + path = os.path.expanduser("~/.update-manager/") + if not os.path.exists(path): + os.mkdir(path) + self.METARELEASE_FILE = os.path.join(path,"meta-release") self.metarelease_information = None self.downloading = True # we start the download thread here and we have a timeout @@ -168,6 +175,3 @@ class MetaRelease(gobject.GObject): if os.path.exists(self.METARELEASE_FILE): f=open(self.METARELEASE_FILE,"r") -# register in the gobject system, needed for older versions of pygtk, -# never ones do this automatically -gobject.type_register(MetaRelease) diff --git a/UpdateManager/UpdateManager.py b/UpdateManager/UpdateManager.py index 109e4d0c..d1a680fb 100644 --- a/UpdateManager/UpdateManager.py +++ b/UpdateManager/UpdateManager.py @@ -695,23 +695,6 @@ class UpdateManager(SimpleGladeApp): fetcher.run() def new_dist_available(self, meta_release, upgradable_to): - #print "new_dist_available: %s" % upgradable_to.name - # check if the user already knowns about this dist - #seen = self.gconfclient.get_string("/apps/update-manager/seen_dist") - #if name == seen: - # return - - #msg = "<big><b>%s</b></big>\n\n%s" % (_("There is a new release of Ubuntu available!"), _("A new release with the codename '%s' is available. Please see http://www.ubuntulinux.org/ for upgrade instructions.") % name) - #dialog = gtk.MessageDialog(self.window_main, 0, gtk.MESSAGE_INFO, - # gtk.BUTTONS_CLOSE, "") - #dialog.set_markup(msg) - #check = gtk.CheckButton(_("Never show this message again")) - #check.show() - #dialog.vbox.pack_start(check) - #dialog.run() - #if check.get_active(): - # self.gconfclient.set_string("/apps/update-manager/seen_dist",name) - #dialog.destroy() self.frame_new_release.show() self.label_new_release.set_markup(_("<b>New distribution release '%s' is available</b>") % upgradable_to.version) self.new_dist = upgradable_to |
