|
63 | 63 | (:method ((source git-at-commit-source)) |
64 | 64 | (format nil "~A" (commit source)))) |
65 | 65 |
|
| 66 | +(defun submodule-git-archive-command (prefix directory) |
| 67 | + (flet ((concat (&rest strings) |
| 68 | + (apply #'concatenate 'string strings))) |
| 69 | + (let* ((tardir (concat (native-directory-string directory) "$path/")) |
| 70 | + (tarfile (concat tardir "$name.tar"))) |
| 71 | + (format nil |
| 72 | + "mkdir -p ~S ~ |
| 73 | + && git archive HEAD --format=tar --prefix=~S > ~S" |
| 74 | + tardir (concat prefix "$path/") tarfile)))) |
| 75 | + |
66 | 76 | (defmethod make-release-tarball ((source git-source) output-file) |
67 | 77 | (let ((prefix (release-tarball-prefix source)) |
68 | 78 | (checkout (ensure-source-cache source))) |
69 | 79 | (in-temporary-directory prefix |
70 | 80 | (let ((temptar (merge-pathnames "package.tar")) |
71 | | - (tempgz (merge-pathnames "package.tar.gz"))) |
| 81 | + (tempgz (merge-pathnames "package.tar.gz")) |
| 82 | + (tempsub (merge-pathnames "submodules/"))) |
| 83 | + (ensure-directories-exist tempsub) |
72 | 84 | (with-posix-cwd checkout |
73 | 85 | (with-binary-run-output temptar |
74 | 86 | (run "git" "archive" :format "tar" :prefix prefix |
75 | 87 | (target-ref source))) |
| 88 | + (run "git" "submodule" "foreach" :recursive :quiet |
| 89 | + (submodule-git-archive-command prefix tempsub)) |
| 90 | + (dolist (archive (directory (merge-pathnames "**/*.tar" tempsub))) |
| 91 | + (run "tar" "Af" temptar archive)) |
76 | 92 | (run "gzip" "-vn9" temptar) |
77 | 93 | (copy tempgz output-file)))))) |
78 | 94 |
|
0 commit comments