anvil-editor: init at 0.4
[NixPkgs.git] / pkgs / applications / radio / gnuradio / modtool-newmod-permissions.3_8.patch
blobf6a6a06e89c4721019defddf456a8bc682cc9e7f
1 commit bf870157e0a9c3d19e968afb276b4e7d96b4df30
2 Author: Doron Behar <doron.behar@gmail.com>
3 Date: Thu Oct 21 13:10:42 2021 +0300
5 gr-modtool: Don't copy source permissions
7 This is needed for systems such as NixOS, where the build tree isn't
8 writable and the files copied should be.
10 Signed-off-by: Doron Behar <doron.behar@gmail.com>
12 diff --git a/gr-utils/python/modtool/core/newmod.py b/gr-utils/python/modtool/core/newmod.py
13 index 123059907..0c734e7ae 100644
14 --- a/gr-utils/python/modtool/core/newmod.py
15 +++ b/gr-utils/python/modtool/core/newmod.py
16 @@ -78,7 +78,9 @@ class ModToolNewModule(ModTool):
17 self._setup_scm(mode='new')
18 logger.info("Creating out-of-tree module in {}...".format(self.dir))
19 try:
20 - shutil.copytree(self.srcdir, self.dir)
21 + # https://stackoverflow.com/a/17022146/4935114
22 + shutil.copystat = lambda x, y: x
23 + shutil.copytree(self.srcdir, self.dir, copy_function=shutil.copyfile)
24 os.chdir(self.dir)
25 except OSError:
26 raise ModToolException('Could not create directory {}.'.format(self.dir))