 ;;
 ;;; Code:
 
+(require 'cl-lib)
 (require 'eieio)
 (require 'package)
 (require 'ht)


(defvar configuration-layer--used-distant-packages '()
  "A list of all distant packages that are effectively used.")

(defvar configuration-layer-error-count nil
  "Non nil indicates the number of errors occurred during the

         (upgrade-count (length update-packages))
         (upgraded-count 0)
         (update-packages-alist))
    (when configuration-layer--skipped-packages
      (spacemacs-buffer/append
       (format (concat "--> Warning: cannot update %s package(s), possibly due"
                       " to a temporary network problem: %s\n")
               skipped-count
               (mapconcat #'symbol-name
                          configuration-layer--skipped-packages
                          " "))))
    ;; (message "packages to udpate: %s" update-packages)
    (if (> upgrade-count 0)
        (if (and (not always-update)
                 (not (yes-or-no-p (format (concat "%s package(s) to update, "
                                                   (if (> skipped-count 0)
                                                       (format "%s package(s) skipped, "
                                                               skipped-count)
                                                     "")
                                                   "do you want to continue ? ")
                                           upgrade-count))))
            (spacemacs-buffer/append
