about summary refs log tree commit diff
path: root/pkgs/development/python-modules/poezio/make_default_config_writable.patch
blob: 03d732e256c400dd60bfeb54c7ce2b57457e87fd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
diff -ruN a/src/config.py b/src/config.py
--- a/src/config.py	2015-07-31 19:35:37.000000000 +0000
+++ b/src/config.py	2015-08-03 09:23:34.322098081 +0000
@@ -14,6 +14,7 @@
 
 import logging.config
 import os
+import stat
 import sys
 import pkg_resources
 
@@ -563,6 +564,13 @@
             copy2(default, options.filename)
         elif path.isfile(other):
             copy2(other, options.filename)
+
+        # Inside the nixstore, the reference file is readonly, so is the copy.
+        # Make it writable by the user who just created it.
+        if os.path.exists(options.filename):
+            os.chmod(options.filename,
+                     os.stat(options.filename).st_mode | stat.S_IWUSR)
+
         global firstrun
         firstrun = True