summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-01-30 11:23:43 +0100
committerStephan Bergmann <sbergman@redhat.com>2018-01-30 21:10:51 +0100
commit84e0627cbd4fd111f05b258942b67da9cece396c (patch)
tree18e1d200aab87b09a28bd761af5c158a1a900d82 /solenv
parent53e414df4af125ccc9b9dd96b7212f2fef7b7de2 (diff)
Don't let PythonTest_solenv_python fail due to Emacs lock files in SRCDIR
Emacs has a habit of placing lock files next to files being edited, which are actually dangling symlinks not pointing at actual files, but where the symlink content itself encodes some information about who locked the file. When such a lock file happens to be present in the source tree during `make PythonTest_solenv_python`, the latter fails because shutil.copytree by default copies files pointed at by symlinks, instead of the symlinks themselves, and causes an error if that fails. An alternative fix would be to call shutil.copytree with symlinks=true (copy symlinks, not the files pointed at) or ignore_dangling_symlinks=true (don't fail if a dangling symlink can't be copied). But for now just don't copy any of those additional files that Emacs likes to place next to edited files (and which are also all ignored in our .gitignore). Change-Id: Ib731a5395fe8d40767878c17b1fb422b914bb329 Reviewed-on: https://gerrit.libreoffice.org/48898 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv')
-rw-r--r--solenv/qa/python/gbuildtojson.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/solenv/qa/python/gbuildtojson.py b/solenv/qa/python/gbuildtojson.py
index 5166be353f9e..fda924567568 100644
--- a/solenv/qa/python/gbuildtojson.py
+++ b/solenv/qa/python/gbuildtojson.py
@@ -132,7 +132,9 @@ class CheckGbuildToJsonModules(unittest.TestCase):
os.makedirs(os.path.join(self.tempwork, 'LinkTarget', 'Executable'))
shutil.copy(self.gbuildtojson, os.path.join(self.tempwork, 'LinkTarget', 'Executable'))
if module != 'solenv':
- shutil.copytree(os.path.join(os.environ['SRCDIR'], module), os.path.join(self.tempsrc, module))
+ shutil.copytree(os.path.join(os.environ['SRCDIR'], module), os.path.join(self.tempsrc, module),
+ ignore=shutil.ignore_patterns('.#*', '#*', '*~'))
+ # ignore Emacs lock (.#*), auto-save (#*), and backup (*~) files
(bashscripthandle, bashscriptname) = tempfile.mkstemp(prefix='gbuild')
bashscript = os.fdopen(bashscripthandle, 'w', newline='\n')
bashscript.write("set -e\n")