                     ;; and prints anything in a particular repository
                     ;; that has an mtime greater than the last build
                     ;; time for that repository.
-                    ;;
-                    ;; Just FYI, this find(1) command is compatible
-                    ;; with both GNU and BSD find. But not apparently
-                    ;; with busybox/find, see [1].
-                    ;;
-                    ;; [1]: https://github.com/raxod502/straight.el/issues/78
-                    (setq args (append (list "-o"
-                                             "-path"
-                                             (format "./%s/*" local-repo)
-                                             "-newermt"
-                                             mtime
-                                             "-print")
-                                       args))
+                    (let ((newer-or-newermt nil)
+                          (mtime-or-file nil))
+                      (pcase straight-find-flavor
+                        (`gnu/bsd
+                         (setq newer-or-newermt "-newermt")
+                         (setq mtime-or-file mtime))
+                        (`busybox
+                         (setq newer-or-newermt "-newer")
+                         (setq mtime-or-file (straight--make-mtime mtime)))
+                        (_ (error "Unexpected `straight-find-flavor': %S"
+                                  straight-find-flavor)))
+                      (setq args (append (list "-o"
+                                               "-path"
+                                               (format "./%s/*" local-repo)
+                                               newer-or-newermt
+                                               mtime-or-file
+                                               "-print")
+                                         args)))
                   ;; If no mtime is specified, it means the package
                   ;; definitely needs to be (re)built. Probably there
                   ;; was an error and we couldn't finish building the

  (expand-file-name
   (substring (apply 'straight--dir segments) 0 -1)))

(defun straight--autoload-file-name (package)
  "Get the bare filename of the autoload file for PACKAGE.
PACKAGE should be a string. The filename does not include the

              ;; know.
              (or (not (stringp last-mtime))
                  (with-temp-buffer
                    (let ((newer-or-newermt nil)
                          (mtime-or-file nil))
                      (pcase straight-find-flavor
                        (`gnu/bsd
                         (setq newer-or-newermt "-newermt")
                         (setq mtime-or-file last-mtime))
                        (`busybox
                         (setq newer-or-newermt "-newer")
                         (setq mtime-or-file
                               (straight--make-mtime last-mtime)))
                        (_ (error "Unexpected `straight-find-flavor': %S"
                                  straight-find-flavor)))
                      (let* ((default-directory
                               (straight--dir "repos" local-repo))
                             ;; This find(1) command ignores the .git
                             ;; directory, and prints the names of any
                             ;; files or directories with a newer
                             ;; mtime than the one specified.
                             (args `("." "-name" ".git" "-prune"
                                     "-o" ,newer-or-newermt ,mtime-or-file
                                     "-print"))
                             (return (apply #'call-process "find"
                                            nil '(t t) nil args)))
                        (unless (= 0 return)
                          (error "Command failed: find %s:\n%s"
                                 (string-join
                                  (mapcar #'shell-quote-argument args)
                                  " ")
                                 (buffer-string)))
                        ;; If anything was printed, the package has
                        ;; (maybe) been modified.
                        (> (buffer-size) 0)))))))))))

;;;; Building packages
;;;;; Files directive processing
