            "--> performing backup of package to update...\n" t)
           (redisplay)
           (dolist (pkg update-packages)
-            (let* ((pkg-desc (cadr (assq pkg package-alist)))
-                   (src-dir (package-desc-dir pkg-desc))
+            (let* ((src-dir (configuration-layer//get-package-directory pkg))
                    (dest-dir (expand-file-name
                               (concat rollback-dir
                                       (file-name-as-directory

         (update-packages-alist))
    (if (> upgrade-count 0)
        (progn
        ;; (let (toto)
          ;; (message "package to update: %s" update-packages)
          (spacemacs/append-to-buffer
           (format "Found %s package(s) to update...\n" upgrade-count))

                  :initial-value t))
      (not (ht-contains? configuration-layer-all-packages pkg)))))

(defun configuration-layer//get-package-directory (pkg)
  "Return the directory path for PKG."
  (let ((pkg-desc (assq pkg package-alist)))
    (cond
     ((version< emacs-version "24.3.50")
      (let* ((version (aref (cdr pkg-desc) 0))
             (elpa-dir (concat user-emacs-directory "elpa/"))
             (pkg-dir-name (format "%s-%s.%s"
                                   (symbol-name pkg)
                                   (car version)
                                   (cadr version))))
        (expand-file-name (concat elpa-dir pkg-dir-name))))
     (t (package-desc-dir (cadr pkg-desc))))))

(defun configuration-layer//get-package-dependencies (pkg)
  "Return the dependencies alist for PKG."
  (let ((pkg-desc (assq pkg package-alist)))
    (cond
     ((version< emacs-version "24.3.50") (aref (cdr pkg-desc) 1))
     (t (package-desc-reqs (cadr pkg-desc))))))

(defun configuration-layer//get-package-dependencies-from-archive (pkg)
  "Return the dependencies alist for a PKG from the archive data."
  (let* ((pkg-arch (assq pkg package-archive-contents))
         (reqs (when pkg-arch (if (version< emacs-version "24.3.50")
                              (aref (cdr pkg-arch) 1)
                            (package-desc-reqs (cadr pkg-arch))))))
    ;; recursively get the requirements of reqs
    (dolist (req reqs)
      (let* ((pkg2 (car req))
