1 |
commit: ff4cdefb600c0ceb834019bbcd0e1147ea744d6b |
2 |
Author: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Jan 24 21:38:02 2014 +0000 |
4 |
Commit: Devan Franchini <twitch153 <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Jan 24 21:38:02 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/webapp-config.git;a=commit;h=ff4cdefb |
7 |
|
8 |
WebappConfig/db.py: Properly closes install file after writing. |
9 |
|
10 |
When webapp-config cleans out a webapp installation it needs to |
11 |
remove the database entry of the file from it's designated installs |
12 |
file. If more than one database entry is in the installs file it |
13 |
should still list the database entry for the webapp that isn't being |
14 |
removed. The logic is all there in db.py but after the file has |
15 |
rewritten the entries it doesn't close the file properly and causes |
16 |
a failure in the check right after the write(), which then unlinks |
17 |
the installs file and removes the entries from webapp-config's |
18 |
database. |
19 |
|
20 |
X-Gentoo-Bug:494520 |
21 |
X-Gentoo-Bug-URL: https://bugs.gentoo.org/494520 |
22 |
|
23 |
--- |
24 |
WebappConfig/db.py | 1 + |
25 |
1 file changed, 1 insertion(+) |
26 |
|
27 |
diff --git a/WebappConfig/db.py b/WebappConfig/db.py |
28 |
index 228b2c8..2d70cb9 100644 |
29 |
--- a/WebappConfig/db.py |
30 |
+++ b/WebappConfig/db.py |
31 |
@@ -340,6 +340,7 @@ class WebappDB(AppHierarchy): |
32 |
if not self.__p: |
33 |
installs = open(dbpath, 'w') |
34 |
installs.write('\n'.join(newentries) + '\n') |
35 |
+ installs.close() |
36 |
if not self.has_installs(): |
37 |
os.unlink(dbpath) |
38 |
else: |