aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Jon Bernard <jbernard@tuxion.com> 2013-02-10 09:27:01 -0500
committerGravatar Jon Bernard <jbernard@tuxion.com> 2013-02-10 09:27:01 -0500
commitfc0f227c93c1590ed33dfe505dbb95a7706bdc50 (patch)
tree00c262a9ebe29db5ce8afcf954154239dec71f2e
parente0f3fbee32be2aabb853a837eb6dd137ecb454be (diff)
downloaddotfiles-fc0f227c93c1590ed33dfe505dbb95a7706bdc50.tar.gz
dotfiles-fc0f227c93c1590ed33dfe505dbb95a7706bdc50.tar.bz2
dotfiles-fc0f227c93c1590ed33dfe505dbb95a7706bdc50.zip
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.
-rw-r--r--dotfiles/core.py10
1 files 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."""