nixpkgs/pkgs/development/python-modules/poezio/make_default_config_writable.patch

26 lines
757 B
Diff
Raw Normal View History

2015-07-09 09:58:28 +01:00
diff -ruN a/src/config.py b/src/config.py
2015-08-03 10:31:21 +01:00
--- 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 @@
2015-07-09 09:58:28 +01:00
2015-08-03 10:31:21 +01:00
import logging.config
2015-07-09 09:58:28 +01:00
import os
+import stat
2015-08-03 10:31:21 +01:00
import sys
import pkg_resources
2015-07-09 09:58:28 +01:00
2015-08-03 10:31:21 +01:00
@@ -563,6 +564,13 @@
copy2(default, options.filename)
elif path.isfile(other):
copy2(other, options.filename)
2015-07-09 09:58:28 +01:00
+
2015-08-03 10:31:21 +01:00
+ # 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)
2015-07-09 09:58:28 +01:00
+
2015-08-03 10:31:21 +01:00
global firstrun
firstrun = True
2015-07-09 09:58:28 +01:00