From fc0f227c93c1590ed33dfe505dbb95a7706bdc50 Mon Sep 17 00:00:00 2001 From: Jon Bernard Date: Sun, 10 Feb 2013 09:27:01 -0500 Subject: Prevent externals from showing up in packages The load routine was made recursive to support packages, so externals should only be added during the first pass and not within package directories. External processing should probably be done before recursion begins to avoid this check on every call. --- dotfiles/core.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dotfiles/core.py b/dotfiles/core.py index 831ebf6..1341fab 100644 --- a/dotfiles/core.py +++ b/dotfiles/core.py @@ -155,10 +155,12 @@ class Dotfiles(object): os.path.join(src_dir, dotfile), dst_dir, add_dot=not bool(sub_dir), dry_run=self.dry_run)) - for dotfile in self.externals.keys(): - self.dotfiles.append(Dotfile(dotfile, - os.path.expanduser(self.externals[dotfile]), - dst_dir, add_dot=not bool(sub_dir), dry_run=self.dry_run)) + # Externals are top-level only + if not sub_dir: + for dotfile in self.externals.keys(): + self.dotfiles.append(Dotfile(dotfile, + os.path.expanduser(self.externals[dotfile]), + dst_dir, add_dot=not bool(sub_dir), dry_run=self.dry_run)) def _fqpn(self, dotfile, pkg_name=None): """Return the fully qualified path to a dotfile.""" -- cgit v1.2.3