 (defvar configuration-layer-paths (make-hash-table :size 256)
   "Hash table of layers locations. The key is a layer symbol and the value is
 the path for this layer.")
-
-(defvar configuration-layer-all-packages-sorted '()
-  "Sorted list of all package symbols.")
 
 (defvar configuration-layer-categories '()
   "List of strings corresponding to category names. A category is a

          (oref pkg :post-layers))))

(defun configuration-layer/update-packages (&optional always-update)
  "Upgrade elpa packages.  If called with a prefix argument ALWAYS-UPDATE, assume yes to update."
  (interactive "P")
  (spacemacs-buffer/insert-page-break)
  (spacemacs-buffer/append

   "--> fetching new package repository indexes...\n")
  (spacemacs//redisplay)
  (package-refresh-contents)
  (let* ((candidates (configuration-layer/filter-packages
                      configuration-layer-packages
                      (lambda (x) (and (not (null (oref x :owner)))
                                       (not (eq 'local (oref x :location)))
                                       (not (oref x :excluded))))))
         (update-packages (configuration-layer//get-packages-to-update
                           (mapcar 'car (object-assoc-list :name candidates))))
         (date (format-time-string "%y-%m-%d_%H.%M.%S"))
         (rollback-dir (expand-file-name
                        (concat configuration-layer-rollback-directory
