Merge lp:~mvo/software-center/lp970627 into lp:software-center/5.2

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3044
Proposed branch: lp:~mvo/software-center/lp970627
Merge into: lp:software-center/5.2
Diff against target: 36 lines (+14/-11)
1 file modified
softwarecenter/expunge.py (+14/-11)
To merge this branch: bzr merge lp:~mvo/software-center/lp970627
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+108688@code.launchpad.net

This proposal supersedes a proposal from 2012-06-05.

Description of the change

Trivial branch that just catches any IOError in _cleanup_dir(). This shows up on errors.ubuntu.com in the software-center sub page as top 4 (top 3 actually as #2,#3 look like dupes).

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Hi Michael, this looks fine. I'll merge to 5.2 now. Many thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/expunge.py'
--- softwarecenter/expunge.py 2012-03-27 08:57:34 +0000
+++ softwarecenter/expunge.py 2012-06-05 07:24:20 +0000
@@ -55,18 +55,21 @@
55 for root, dirs, files in os.walk(path):55 for root, dirs, files in os.walk(path):
56 for f in files:56 for f in files:
57 fullpath = os.path.join(root, f)57 fullpath = os.path.join(root, f)
58 header = open(fullpath).readline().strip()58 try:
59 if not header.startswith("status:"):59 header = open(fullpath).readline().strip()
60 logging.debug(60 if not header.startswith("status:"):
61 "Skipping files with unknown header: '%s'" % f)61 logging.debug(
62 continue62 "Skipping files with unknown header: '%s'" % f)
63 if self.keep_only_http200 and header != "status: 200":63 continue
64 self._rm(fullpath)64 if self.keep_only_http200 and header != "status: 200":
65 if self.keep_time:
66 mtime = os.path.getmtime(fullpath)
67 logging.debug("mtime of '%s': '%s" % (f, mtime))
68 if (mtime + self.keep_time) < now:
69 self._rm(fullpath)65 self._rm(fullpath)
66 if self.keep_time:
67 mtime = os.path.getmtime(fullpath)
68 logging.debug("mtime of '%s': '%s" % (f, mtime))
69 if (mtime + self.keep_time) < now:
70 self._rm(fullpath)
71 except IOError as e:
72 logging.debug("ioerror in cleandir: %s" % e)
7073
71 def clean(self):74 def clean(self):
72 # go over the directories75 # go over the directories

Subscribers

People subscribed via source and target branches