~barry/ubuntu/lucid/update-manager/fix-511628

« back to all changes in this revision

Viewing changes to DistUpgrade/DistUpgradeQuirks.py

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt, Michael Vogt, Brian Murray
  • Date: 2009-09-15 10:50:24 UTC
  • Revision ID: james.westby@ubuntu.com-20090915105024-y2j8245rjztxfi9v
Tags: 1:0.125.2
[ Michael Vogt ]
* DistUpgrade/DistUpgradeCache.py:
  - add check for 5Mb safety buffer in /tmp, this ensures that
    dkms can run and ensure we do not run when /tmp is mounted
    in overflow mode (LP: #427035)
* data/glade/UpdateManager.ui:
  - remove dialog title for the battery warning and fix button
    order (thanks to Matthew Paul Thomas)
* data/glade/UpdateManager.ui:
  - fix duplicated accelerator keys (LP: #425817)
* UpdateManager/UpdateManager.py:
  - close app when ESC is pressed in the battery warning
* UpdateManager/UpdateManager.py:
  - ensure that the changelog always matches the currently selected
    pkg by fixing race during download (LP: #424918) 
* UpdateManager/backend/InstallBackendAptdaemon.py:
  - do not hang when cancel is clicked (LP: #426718)
* add sed patch facility and patch the gnome debconf frontend 
  before the upgrade starts so that it can not crash when 
  perl moves from 5.8.0 to 5.10.0 (LP: #387112)
* data/glade/UpdateManager.ui:
  - use bigger default width (LP: #418201)

[ Brian Murray ]
* typo fixes (thanks to Brian Murray, LP: #423409)

Show diffs side-by-side

added added

removed removed

Lines of Context:
728
728
            return
729
729
        if not ("PATH" in os.environ and
730
730
                [p for p in os.environ["PATH"].split(":")
731
 
                 if os.path.exists(os.path.join(p,"patch"))]):
732
 
            logging.debug("no binary 'patch' found in PATH")
 
731
                 if os.path.exists(os.path.join(p,"sed"))]):
 
732
            logging.debug("no binary 'sed' found in PATH")
733
733
            return
734
734
        for f in os.listdir(patchdir):
735
735
            # skip, not a patch file, they all end with .$md5sum
736
736
            if not "." in f:
 
737
                logging.debug("skipping '%s' (no '.')" % f)
737
738
                continue
738
739
            logging.debug("check if patch '%s' needs to be applied" % f)
739
 
            (encoded_path, md5sum) = string.split(f, ".", 1)
 
740
            (encoded_path, md5sum) = string.rsplit(f, ".", 1)
740
741
            # FIXME: this is not clever and needs quoting support for
741
742
            #        filenames with "_" in the name
742
743
            path = encoded_path.replace("_","/")
 
744
            #logging.debug("target for '%s' is '%s' -> '%s'" % (
 
745
            #        f, encoded_path, path))
743
746
            if (os.path.exists(path) and
744
747
                md5(open(path).read()).hexdigest() == md5sum):
745
748
                logging.info("applying '%s'" % f)
746
749
                # dry-run first, then patch if ok
747
 
                res = call(["patch","--dry-run","-s","-p0","-i",
748
 
                            patchdir+"/"+f])
 
750
                cmd = ["sed","-n", "-f", patchdir+"/"+f, path]
 
751
                logging.debug("runing '%s'" % cmd)
 
752
                res = call(cmd)
749
753
                if res == 0:
750
 
                    res = call(["patch","-p0","-s","-i",patchdir+"/"+f])
 
754
                    res = call(["sed","-i","-f", patchdir+"/"+f, path])
751
755
                    logging.info("applied '%s' with %i status" % (f,res))
752
756
                else:
753
757
                    logging.warning("dry run failed, ignoring patch '%s'" % f)