Fixed some problems with updated epkgs repository.

Now uses both the .config and master files.
This commit is contained in:
Donald Ephraim Curtis 2011-12-03 00:40:52 -06:00
parent 0f8bbb6ce8
commit c2cde4998b
2 changed files with 28 additions and 27 deletions

2
epkgs

@ -1 +1 @@
Subproject commit ad3160bc041ce0a977b0bd0bd72179bff30760c9 Subproject commit 6f590af6c53cebeb563ce7d40afd4ba9f24e04a7

View file

@ -154,13 +154,12 @@
"build the pkg file" "build the pkg file"
(let ((print-level nil) (let ((print-level nil)
(print-length nil) (print-length nil)
(pkglst (or (package-read-from-file pkg-file) (pkglst
(or (package-read-from-file pkg-file)
(list 'define-package (list 'define-package
file-name file-name
version version
homepage homepage
;; (list 'quote
;; ;; Turn version lists into string form.
(list 'quote (mapcar (list 'quote (mapcar
(lambda (elt) (lambda (elt)
(list (car elt) (list (car elt)
@ -193,6 +192,10 @@
(buffer-substring-no-properties (point-min) (point-max)))))))) (buffer-substring-no-properties (point-min) (point-max))))))))
(defun package-build-get-config (file-name) (defun package-build-get-config (file-name)
"get the configuration information for the given file-name"
(package-read-from-file (format "epkgs/%s/.config" file-name)))
(defun package-build-get-master (file-name)
"get the configuration information for the given file-name" "get the configuration information for the given file-name"
(package-read-from-file (format "epkgs/%s/master" file-name))) (package-read-from-file (format "epkgs/%s/master" file-name)))
@ -227,13 +230,13 @@
(defun package-build-archive (file-name) (defun package-build-archive (file-name)
"build a git package archive" "build a git package archive"
(interactive) (interactive)
(let* ((desc (package-build-get-config file-name)) (let* ((desc (package-build-get-master file-name))
(cfg (package-build-get-config file-name))
(name (intern file-name)) (name (intern file-name))
(local-dir (file-name-as-directory (expand-file-name file-name package-build-working-dir)))) (local-dir (file-name-as-directory (expand-file-name file-name package-build-working-dir))))
(when desc (when desc
(let* ((repo (plist-get desc :repository)) (let* ((repo-type (plist-get cfg :fetcher))
(repo-type (car repo)) (repo-url (plist-get cfg :url))
(repo-url (cdr repo))
(summary (plist-get desc :summary))) (summary (plist-get desc :summary)))
(package-build-read-archive-contents) (package-build-read-archive-contents)
@ -256,14 +259,14 @@
(concat (file-name-as-directory package-build-working-dir) (concat (file-name-as-directory package-build-working-dir)
(file-name-as-directory pkg-base-dir)))) (file-name-as-directory pkg-base-dir))))
(default-directory package-build-working-dir)) (default-directory package-build-working-dir))
(when (file-exists-p local-dir) (when (and (file-exists-p local-dir) version)
(copy-directory file-name pkg-base-dir) (copy-directory file-name pkg-base-dir)
(setq pkglst (package-build-pkg-file pkg-file file-name version summary)) (setq pkglst (package-build-pkg-file pkg-file file-name version summary))
(setq pkgdeps (mapcar (setq pkgdeps (mapcar
(lambda (elt) (lambda (elt)
(list (car elt) (version-to-list (cadr elt)))) (list (car elt) (version-to-list (cadr elt))))
(eval (nth 4 pkglst)))) (eval (nth 4 pkglst))))
(message (prin1-to-string pkgdeps)) (message "deps: %s"(prin1-to-string pkgdeps))
(package-build-create-tar (package-build-create-tar
pkg-base-dir pkg-base-dir
(expand-file-name (expand-file-name
@ -271,9 +274,7 @@
(delete-directory pkg-base-dir t nil) (delete-directory pkg-base-dir t nil)
(package-build-add-to-archive-contents name version pkgdeps summary 'tar) (package-build-add-to-archive-contents name version pkgdeps summary 'tar)
(package-build-dump-archive-contents) (package-build-dump-archive-contents)
) (message "Success!")))))))
)
))))
(defun package-build-dump-archive-contents () (defun package-build-dump-archive-contents ()
"dump the archive contents back to the file" "dump the archive contents back to the file"