Kaydet (Commit) 84e0627c authored tarafından Stephan Bergmann's avatar Stephan Bergmann

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/48898Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 53e414df
......@@ -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")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment