From 7c3a2f3059c700c40bd1f742101c4c14a77a2df8 Mon Sep 17 00:00:00 2001 From: syl20bnr Date: Fri, 24 Oct 2014 22:44:14 -0400 Subject: [PATCH] Fix a bug where wrong dependent packages could be deleted --- core/contribsys.el | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/core/contribsys.el b/core/contribsys.el index 6d4c1bbbf..285f279b6 100644 --- a/core/contribsys.el +++ b/core/contribsys.el @@ -288,19 +288,20 @@ are not in `spacemacs-all-packages' (explicit packages)" imp-pkg dependencies '())))) (delete-dups result))) -(defun contribsys//get-orphan-packages2 (imp-pkg dependencies acc) +(defun contribsys//get-orphan-packages2 (pkg dependencies acc) "Reccursive function to get the orphans packages as well as their orphan dependencies." - (if (ht-contains? dependencies imp-pkg) - (dolist (parent (ht-get dependencies imp-pkg)) + (if (and (ht-contains? dependencies pkg) + (not (ht-contains? spacemacs-all-packages pkg))) + (dolist (parent (ht-get dependencies pkg)) (let ((orphans (contribsys//get-orphan-packages2 parent dependencies acc))) (unless (not orphans) - (add-to-list 'acc imp-pkg) + (add-to-list 'acc pkg) (if acc (setq acc (append acc orphans)) (setq acc orphans))))) - (unless (ht-contains? spacemacs-all-packages imp-pkg) - (if acc (add-to-list 'acc imp-pkg) (setq acc (list imp-pkg))))) + (unless (ht-contains? spacemacs-all-packages pkg) + (if acc (add-to-list 'acc pkg) (setq acc (list pkg))))) acc) (defun contribsys/get-package-dependencies (package)