summary refs log blame commit diff
path: root/pkgs/applications/editors/codeblocks/writable-projects.patch
blob: 3b6364a52a1c784a5d40989291d3437d74c22d5a (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

















                                                                                                     
diff --git a/src/plugins/scriptedwizard/wiz.cpp b/src/plugins/scriptedwizard/wiz.cpp
index 0eb4b27..7d469fe 100644
--- a/src/plugins/scriptedwizard/wiz.cpp
+++ b/src/plugins/scriptedwizard/wiz.cpp
@@ -785,6 +785,13 @@ void Wiz::CopyFiles(cbProject* theproject, const wxString&  prjdir, const wxStri
             }
         }
         if (do_copy) wxCopyFile(srcfile, dstfile, true);
+        // Noticed! Files in Nix Store are readonly, so make the copied file writable
+        if (do_copy)
+        {
+            struct stat statbuf;
+            if (!::stat(dstfile.mb_str(), &statbuf))
+                ::chmod(dstfile.mb_str(), statbuf.st_mode | 0200);
+        }
 
         // and add it to the project
         fname.MakeRelativeTo(prjdir);