From ae007688d8f1f57b138dafffdfc3683aa7c7730f Mon Sep 17 00:00:00 2001 From: Richard Maw Date: Fri, 20 Jun 2014 14:37:30 +0000 Subject: Don't attempt to load symlinks as morphologies This was noticed because our definitions.git had a dangling symlink, so it failed to construct the temporary build branch. We shouldn't process symlinks as morphologies either, since either we make symlinked morphologies a first-class behaviour, and validate that the link points inside the repository, which is a lot of work for something we don't and probably won't need; or we can just assume that we deal with the morphology this is linked to correctly anyway. --- morphlib/sysbranchdir.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'morphlib/sysbranchdir.py') diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py index ee6a3cc7..b8953c2f 100644 --- a/morphlib/sysbranchdir.py +++ b/morphlib/sysbranchdir.py @@ -176,7 +176,8 @@ class SystemBranchDirectory(object): gd_name = self.get_git_directory_name(self.root_repository_url) gd = morphlib.gitdir.GitDirectory(gd_name) mf = morphlib.morphologyfinder.MorphologyFinder(gd) - for filename in mf.list_morphologies(): + for filename in (f for f in mf.list_morphologies() + if not gd.is_symlink(f)): text = mf.read_morphology(filename) m = loader.load_from_string(text, filename=filename) m.repo_url = self.root_repository_url -- cgit v1.2.1