Merge lp:~aaronp/software-center/usc-605048 into lp:software-center
Proposed by
Aaron Peachey
Status: | Merged |
---|---|
Merged at revision: | 1389 |
Proposed branch: | lp:~aaronp/software-center/usc-605048 |
Merge into: | lp:software-center |
Diff against target: |
107 lines (+34/-16) 2 files modified
softwarecenter/app.py (+2/-14) softwarecenter/db/update.py (+32/-2) |
To merge this branch: | bzr merge lp:~aaronp/software-center/usc-605048 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Vogt | Approve | ||
Review via email: mp+44436@code.launchpad.net |
This proposal supersedes a proposal from 2010-12-19.
Description of the change
100 papercut fixes for bug 605048 and 686994.
Alters db update behaviour to stop 'rebuilding' window appearing while xapian db is being updated on detecting an externally changed cahce.
Instead, updates a new copy of the xapian db, then once finished, renamed to be the new xapian db.
Changes made in app.py and db/update.py.
Test by running "sudo update-
To post a comment you must log in.
On Sun, Dec 19, 2010 at 06:14:13AM -0000, Aaron Peachey wrote: /bugs.launchpad .net/bugs/ 605048 /bugs.launchpad .net/bugs/ 686994 software- center"
> Aaron Peachey has proposed merging lp:~aaronp/software-center/usc-605048 into lp:software-center.
>
> Requested reviews:
> Michael Vogt (mvo)
> Related bugs:
> #605048 "Rebuilding application catalogue" uses a separate window
> https:/
> #686994 When 'Rebuilding Software Catalogue', there is no indication that anything is happening or when it will end.
> https:/
>
>
> 100 papercut fixes for bug 605048 and 686994.
> Alters db update behaviour to stop 'rebuilding' window appearing while xapian db is being updated on detecting an externally changed cahce.
> Instead, updates a new copy of the xapian db, then once finished, renamed to be the new xapian db.
> Changes made in app.py and db/update.py.
> Test by running "sudo update-
Thanks, the branch looks fine. I will merge it, but I need to ask www.canonical. com/contributor s
first that you please sign the canonical contributors agreement, the
details are here:
http://
its quick and painless.
Some small comments below:
> === modified file 'softwarecenter /app.py' app.py 2010-12-14 18:57:11 +0000 app.py 2010-12-19 06:13:57 +0000 rebuilding. show()
> --- softwarecenter/
> +++ softwarecenter/
> @@ -851,25 +852,12 @@
[..]
> - if is_rebuilding:
> - self.window_
[..]
Nice that we can get rid of this :)
> === modified file 'softwarecenter /db/update. py' db/update. py 2010-12-15 14:02:40 +0000 db/update. py 2010-12-19 06:13:57 +0000 database( pathname) : memonly= True) join(XAPIAN_ BASE_PATH, "xapian_old") join(XAPIAN_ BASE_PATH, "xapian_rb")
> --- softwarecenter/
> +++ softwarecenter/
> @@ -592,15 +594,39 @@
>
> def rebuild_
> cache = apt.Cache(
> + old_path = os.path.
> + rebuild_path = os.path.
Its probably better to build this relative to pathname, e.g. by
just adding "_old" and "_rb" to the base pathname
> + if not os.path. exists( rebuild_ path): rebuild_ path) exists( old_path) : rmtree( old_path, False, None)
> + try:
> + os.makedirs(
> + except:
> + LOG.warn("Problem creating rebuild path '%s'." % rebuild_path)
> + LOG.warn("Please check you have the relevant permissions.")
> + return False
> +
> # check permission
> if not os.access(pathname, os.W_OK):
> LOG.warn("Cannot write to '%s'." % pathname)
> LOG.warn("Please check you have the relevant permissions.")
> return False
> +
> + #check if old unrequired version of db still exists on filesystem
> + if os.path.
> + LOG.warn("Existing xapian old db was not previously cleaned: '%s'." % old_path)
> + if os.access(old_path, os.W_OK):
> + #remove old unrequired db before beginning
> + shutil.
> + else:
> + LOG.warn("Cannot write to '%s'." % old_path)
> + LOG.warn("Please check you have the relevant permissions.")
> + return False
> +
> +
Nice defensive style!
> # write it WritableDatabas e(pathname, xapian. DB_CREATE_ OR_OVERWRITE) WritableDatabas e(...
> - db = xapian.
> + db = xapian.