[gnome-ostree] jsondb: Ensure snapshot files are world-readable



commit 217502814a8c80010f7ea561808f00369ddc1909
Author: Colin Walters <walters verbum org>
Date:   Sat Oct 20 20:27:52 2012 -0400

    jsondb: Ensure snapshot files are world-readable
    
    So they can be served via httpd.

 src/ostbuild/pyostbuild/jsondb.py |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/ostbuild/pyostbuild/jsondb.py b/src/ostbuild/pyostbuild/jsondb.py
index 35103b4..5a1500d 100644
--- a/src/ostbuild/pyostbuild/jsondb.py
+++ b/src/ostbuild/pyostbuild/jsondb.py
@@ -70,6 +70,11 @@ class JsonDB(object):
             return None
         return os.path.join(self._dirpath, files[0][3])
 
+    def parse_version(self, name):
+        match = self._version_csum_re.search(name)
+        assert match is not None
+        return '%s.%s' % (match.group(1), match.group(2))
+
     def store(self, obj):
         files = self._get_all()
         if len(files) == 0:
@@ -85,6 +90,7 @@ class JsonDB(object):
         f = open(tmppath, 'w')
         json.dump(obj, f, indent=4, sort_keys=True)
         f.close()
+        os.chmod(tmppath, 0644)
 
         csum = hashlib.sha256()
         f = open(tmppath)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]