                    (straight--process-dependencies
                     (read (current-buffer))))
                (error nil)))))
-    (puthash package (cons (car (gethash package straight--build-cache))
-                           dependencies)
-             straight--build-cache)))
+    (straight--insert 1 package dependencies straight--build-cache)))
 
 (defun straight--get-dependencies (package)
-  (cdr (gethash package straight--build-cache)))
+  (nth 1 (gethash package straight--build-cache)))
 
 (defun straight--generate-package-autoloads (recipe)
   (straight--with-plist recipe

  `(progn
     (setq ,plist (copy-sequence ,plist))
     (setq ,plist (plist-put ,plist ,prop ,val))))

(defun straight--dir (&rest segments)
  (expand-file-name

  (straight--with-plist recipe
      (package local-repo)
    (or (not (file-exists-p (straight--file "build" package)))
        (let ((mtime (nth 0 (gethash package straight--build-cache))))
          (or (not mtime)
              (with-temp-buffer
                (let ((default-directory (straight--dir "repos" local-repo)))
                  (call-process
                   "find" nil '(t t) nil
                   "." "-name" ".git" "-prune" "-o" "-newermt" mtime "-print")
                  (> (buffer-size) 0))))))))

(defun straight--packages-might-be-modified-p ()
  (let ((repos nil)
        (args nil))
    (maphash
     (lambda (package build-info)
       (cl-destructuring-bind (mtime dependencies local-repo) build-info
         (unless (member local-repo repos)
           (push local-repo repos)
           (setq args (append (list "-o"
                                    "-path"
                                    (format "./%s/*" local-repo)
                                    "-newermt"
                                    mtime
                                    "-print")
                              args)))))
     straight--build-cache)
    (setq args (append (list "." "-depth" "2" "-name" ".git" "-prune")
                       args))
    (with-temp-buffer
      (let ((default-directory (straight--dir "repos")))
        (apply 'call-process "find" nil '(t t) nil args)
        (> (buffer-size) 0)))))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Building packages
