~dpm/ubuntu/lucid/update-manager/bug-537277

« back to all changes in this revision

Viewing changes to do-release-upgrade

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Michael Vogt, Wesley Schwengle, Dustin Kirkland, Jonathan Riddell
  • Date: 2010-03-08 20:58:44 UTC
  • Revision ID: james.westby@ubuntu.com-20100308205844-y47e225am3aujmwr
Tags: 1:0.133
[ Michael Vogt ]
* UpdateManager/Core/MetaRelease.py:
  - allow upgrade from unsupported version to unsupported version
* DistUpgrade/removal_blacklist.cfg:
  - allow removal of update-manager-kde
* check-new-release-gtk:
  - fixes in the gtk release upgrade check
* DistUpgrade/xorg_fix_proprietary.py:
  - if /etc/X11/XF86Config-4 is found on upgrade, rename it to
    "XF86Config-4.obsolete"
  - write log to "/var/log/dist-upgrade/xorg_fixup.log"
* do-release-upgrade, check-new-release:
  - implemented "check-releae-upgrade" as symlink to do-release-upgrade
    and automatically run with "--check-dist-upgrade-only" when called
    as c-r-u
  - add --quiet option to do-release-upgrade
* debian/update-manager-core.links:
  - install /usr/lib/update-manager/check-new-release as symlink to
    do-release-upgrade -c

[ Wesley Schwengle ]
* Check for release upgrade is now also possible with do-release-upgrade
  command: do-release-upgrade -c. (LP: #415026)
* Added --version/-V to do-release-upgrade (similar to update-manager)

[ Dustin Kirkland ]
* debian/91-release-upgrade, debian/update-manager-core.install,
  - some users are complaining of long login times due to the release
    check requiring network connectivity; this information clearly doesn't
    change as frequently as the user logging in, so maintain a cache file
    in /var/lib, display it if it's populated, but otherwise, update it in
    the background if its either missing or the file is older than a day
    old, LP: #522452

[ Jonathan Riddell ]
* Do not allow for the removal of update-manager-kde, we do want it after all

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
warnings.filterwarnings("ignore", "apt API not stable yet", FutureWarning)
5
5
import apt
6
6
 
 
7
from DistUpgrade.DistUpgradeVersion import VERSION
 
8
 
7
9
from UpdateManager.Core.MetaRelease import MetaReleaseCore
8
10
from UpdateManager.Core.DistUpgradeFetcherCore import DistUpgradeFetcherCore
9
11
from optparse import OptionParser
10
12
from gettext import gettext as _
 
13
 
 
14
import os
 
15
import sys
11
16
import time
12
 
import sys
13
17
import urllib2
14
18
from DistUpgrade.utils import init_proxy
15
19
 
 
20
RELEASE_AVAILABLE=0
 
21
NO_RELEASE_AVAILABLE=1
 
22
 
16
23
if __name__ == "__main__":
17
24
 
18
25
  init_proxy()
19
26
 
 
27
  # when run as "check-new-release" we go into "check only" mode
 
28
  check_only = sys.argv[0].endswith("check-new-release")
 
29
 
20
30
  parser = OptionParser()
 
31
  parser.add_option ("-V", "--version", action="store_true",
 
32
                     dest="show_version", default=False,
 
33
                     help=_("Show version and exit"))
21
34
  parser.add_option ("-d", "--devel-release", action="store_true",
22
35
                     dest="devel_release", default=False,
23
36
                     help=_("Check if upgrading to the latest devel release "
37
50
                     help=_("Run the specified frontend"))
38
51
  parser.add_option ("-s","--sandbox", action="store_true", default=False,
39
52
                     help=_("Test upgrade with a sandbox aufs overlay"))
 
53
  parser.add_option ("-c", "--check-dist-upgrade-only", action="store_true",
 
54
                     default=check_only,
 
55
                     help=_("Check only if a new distribution release is "
 
56
                            "available and report the result via the "
 
57
                            "exit code"))
 
58
  parser.add_option ("-q", "--quiet", default=False, action="store_true",
 
59
                     dest="quiet")
40
60
 
41
61
  (options, args) = parser.parse_args()
42
62
 
43
 
  print _("Checking for a new ubuntu release")
 
63
 
 
64
  if options.show_version:
 
65
    print "%s: version %s" % (os.path.basename(sys.argv[0]), VERSION)
 
66
    sys.exit(0)
 
67
 
 
68
  if not options.quiet:
 
69
    print _("Checking for a new ubuntu release")
 
70
 
44
71
  m = MetaReleaseCore(useDevelopmentRelease=options.devel_release,
45
72
                      useProposed=options.proposed_release)
46
73
  # this will timeout eventually
47
74
  while m.downloading:
48
 
          time.sleep(0.5)
 
75
    time.sleep(0.5)
 
76
 
49
77
  if m.new_dist is None:
50
 
          print _("No new release found")
51
 
          sys.exit(1)
 
78
    if not options.quiet:
 
79
      print _("No new release found")
 
80
    sys.exit(NO_RELEASE_AVAILABLE)
 
81
 
52
82
  # we have a new dist
 
83
  if options.check_dist_upgrade_only:
 
84
        if not options.quiet:
 
85
            print _("New release '%s' available.") % m.new_dist.name
 
86
            print _("Run 'do-release-upgrade' to upgrade to it.")
 
87
        sys.exit(RELEASE_AVAILABLE)
 
88
 
53
89
  progress = apt.progress.TextFetchProgress()
54
90
  fetcher = DistUpgradeFetcherCore(new_dist=m.new_dist,
55
91
                                   progress=progress)