[Libreoffice-commits] core.git: solenv/qa
Stephan Bergmann
sbergman at redhat.com
Tue Jan 30 20:11:01 UTC 2018
solenv/qa/python/gbuildtojson.py | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 84e0627cbd4fd111f05b258942b67da9cece396c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Jan 30 11:23:43 2018 +0100
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 at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
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")
More information about the Libreoffice-commits
mailing list