summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2011-08-05 21:50:52 -0400
committerAnthony G. Basile <blueness@gentoo.org>2011-08-05 21:50:52 -0400
commit6f368b35014b67c23d0eea35ed6791718f950af3 (patch)
treeb329315d79138d00c7f9fb2df4a31320e75684f0
parentMoved ebuild/eclass to overlay branch (diff)
downloadwebapp-config-6f368b35014b67c23d0eea35ed6791718f950af3.tar.gz
webapp-config-6f368b35014b67c23d0eea35ed6791718f950af3.tar.bz2
webapp-config-6f368b35014b67c23d0eea35ed6791718f950af3.zip
Fix overwrite of existing config_protected files
webapp-config records the md5sum of previously modified config file and any subsequent update removes that file since md5sum of file in database (.webapp-app-version) is the same as on the disc. Reported-By: Philippe Chaintreuil Signed-off-by: Anthony G. Basile <blueness@gentoo.org> X-Gentoo-Bug: 243260 X-Gentoo-Bug-URL: http://bugs.gentoo.org/show_bug.cgi?id=243260
-rw-r--r--WebappConfig/content.py7
-rw-r--r--WebappConfig/worker.py2
2 files changed, 7 insertions, 2 deletions
diff --git a/WebappConfig/content.py b/WebappConfig/content.py
index 0549622..a469921 100644
--- a/WebappConfig/content.py
+++ b/WebappConfig/content.py
@@ -321,6 +321,7 @@ class Contents:
ctype,
destination,
path,
+ real_path,
relative = True):
'''
Add an entry to the contents file.
@@ -376,7 +377,9 @@ class Contents:
ctype - internal webapp-config type
- (server-owned | config-owned | virtual)
destination - install dir (normally $G_INSTALLDIR)
- entry - filename inside 'destination'
+ path - filename inside 'destination'
+ real_path - for config-protected files realpath =! path
+ (and this is important for md5)
relative - 1 for storing a relative filename, 0 otherwise
>>> OUT.color_off()
@@ -509,7 +512,7 @@ class Contents:
ctype,
'"' + path + '"',
self.file_time(entry),
- a[1](entry),
+ a[1](real_path),
a[2](entry)]
if self.__v:
diff --git a/WebappConfig/worker.py b/WebappConfig/worker.py
index e73bce3..a5ee172 100644
--- a/WebappConfig/worker.py
+++ b/WebappConfig/worker.py
@@ -386,6 +386,7 @@ class WebappAdd:
dirtype,
self.__destd,
directory,
+ directory,
self.__relative)
def mkfile(self, filename):
@@ -555,6 +556,7 @@ class WebappAdd:
file_type,
self.__destd,
filename,
+ dst_name,
self.__relative)