 PACKAGE should be a string. The filename does not include the
 directory component."
   (format "%s-autoloads.el" package))
+
+;;;;; Filesystem operations
+
+(defun straight--directory-files (&optional directory match full sort)
+  "Like `directory-files', but with better defaults.
+DIRECTORY, MATCH, and FULL are as in `directory-files', but their
+order has been changed. Also, DIRECTORY defaults to
+`default-directory' if omitted. The meaning of the last argument
+SORT has been inverted from `directory-files'. Finally, the . and
+.. entries are never returned."
+  (delete "." (delete ".." (directory-files
+                            (or directory default-directory)
+                            full match (not sort)))))
+
+(defun straight--symlink-recursively (link-target link-name)
+  "Make a symbolic link to TARGET, named LINKNAME, recursively.
+This means that if the link target is a directory, then a
+corresponding directory is created (called LINK-NAME) and all
+descendants of LINK-TARGET are linked separately into
+LINK-NAME (except for directories, which are created directly)."
+  (make-directory (file-name-directory link-name) 'parents)
+  (if (and (file-directory-p link-target)
+           (not (file-symlink-p link-target)))
+      (progn
+        (make-directory link-name)
+        (dolist (entry (straight--directory-files link-target))
+          (straight--symlink-recursively
+           (expand-file-name entry link-target)
+           (expand-file-name entry link-name))))
+    (make-symbolic-link link-target link-name)))
 
 ;;;;; External processes
 

                   (straight--dir "build" package)))
      (cl-destructuring-bind (repo-file . build-file) spec
        (make-directory (file-name-directory build-file) 'parents)
        (make-symbolic-link repo-file build-file)))))

;;;;; Dependency management


(defun straight-recipes-emacsmirror-list ()
  "Return a list of recipes available in EmacsMirror, as a list of strings."
  (append
   (straight--directory-files "mirror")
   (straight--directory-files "attic")))

;;;;; Recipe conversion

