              (requires (package-desc-reqs pkg-desc)))
         (when requires
           (mapc (lambda (req)
-                  (unless (equal 'emacs (car req))
+                  (unless (or (equal 'emacs (car req))
+                              (package-installed-p (car req) (cadr req)))
                     (quelpa-package-install (car req))))
                 requires))
         (quelpa-package-install-file file)))))

         new-stamp-info
         new-content-hash
         (time-stamp
          (replace-regexp-in-string "\\.0" "." (format-time-string "%Y%m%d.%H%M%S")))
         (stamp-file (concat (expand-file-name (symbol-name name) dir) ".stamp"))
         (old-stamp-info (package-build--read-from-file stamp-file))
         (old-content-hash (cdr old-stamp-info))

  "The melpa git repository url."
  :group 'quelpa
  :type 'string)

(defcustom quelpa-self-upgrade-p t
  "If non-nil upgrade quelpa itself when doing a
  `quelpa-upgrade', otherwise only upgrade the packages in the
  quelpa cache."
  :group 'quelpa
  :type 'boolean)

(defvar quelpa-initialized-p nil
  "Non-nil when quelpa has been initialized.")
