From 263f4204373c462b58363af0a2d74c386a414094 Mon Sep 17 00:00:00 2001 From: Dieter Deyke Date: Mon, 7 Jul 2014 11:56:33 +0200 Subject: [PATCH 1/2] Added support for fossil SCM, added recipe for vc-fossil.el, a VC backend for the fossil sofware configuration management system --- README.md | 9 +++++---- html/index.html | 2 +- html/js/melpa.js | 2 +- html/partials/getting-started.html | 2 +- package-build.el | 27 +++++++++++++++++++++++++++ recipes/vc-fossil | 1 + scripts/bootstrap | 2 +- 7 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 recipes/vc-fossil diff --git a/README.md b/README.md index 8394019d..b4cfcd1e 100644 --- a/README.md +++ b/README.md @@ -173,7 +173,7 @@ the following form (`[...]` denotes optional or conditional values), ```lisp ( - :fetcher [git|github|bzr|hg|darcs|svn|cvs|wiki] + :fetcher [git|github|bzr|hg|darcs|fossil|svn|cvs|wiki] [:url ""] [:repo "github-user/repo-name"] [:module "cvs-module"] @@ -183,11 +183,11 @@ the following form (`[...]` denotes optional or conditional values), - `package-name` a lisp symbol that has the same name as the package being specified. -- `:fetcher` (one of `git, github, bzr, hg, darcs, svn, cvs, wiki`) +- `:fetcher` (one of `git, github, bzr, hg, darcs, fossil, svn, cvs, wiki`) specifies the type of repository that `:url` points to. Right now package-build supports [git][git], [github][github], [bazaar (bzr)][bzr], [mercurial (hg)][hg], [subversion (svn)][svn], -[cvs][cvs], [darcs][darcs], and [Emacs Wiki (wiki)][emacswiki] as +[cvs][cvs], [darcs][darcs], [fossil][fossil], and [Emacs Wiki (wiki)][emacswiki] as possible mechanisms for checking out the repository. *package-build* uses @@ -204,7 +204,7 @@ differs from the package name being built. - `:url` specifies the URL of the version control repository. *required for -the `git`, `bzr`, `hg`, `darcs`, `svn` and `cvs` fetchers.* +the `git`, `bzr`, `hg`, `darcs`, `fossil`, `svn` and `cvs` fetchers.* - `:repo` specifies the github repository and is of the form `github-user/repo-name`. *required for the `github` fetcher*. @@ -249,6 +249,7 @@ specified package requires more complex file specification. [svn]: http://subversion.apache.org/ [cvs]: http://www.nongnu.org/cvs/ [darcs]: http://darcs.net/ +[fossil]: http://www.fossil-scm.org/ [emacswiki]: http://www.emacswiki.org/ diff --git a/html/index.html b/html/index.html index 4030bed2..f0b35306 100644 --- a/html/index.html +++ b/html/index.html @@ -31,7 +31,7 @@

MELPA (Milkypostman’s Emacs Lisp Package Archive)

  • Up-to-date packages built on our servers from upstream source
  • -
  • Installable in any recent Emacs using 'package.el' - no need to install svn/cvs/hg/bzr/git/darcs etc.
  • +
  • Installable in any recent Emacs using 'package.el' - no need to install svn/cvs/hg/bzr/git/darcs/fossil etc.
  • Curated - no obsolete, renamed, forked or randomly hacked packages
  • Comprehensive - more packages than any other archive
  • Automatic updates - new commits result in new packages
  • diff --git a/html/js/melpa.js b/html/js/melpa.js index 0cf83504..006358d3 100644 --- a/html/js/melpa.js +++ b/html/js/melpa.js @@ -419,7 +419,7 @@ m("section.jumbotron", [ m("ul", [ m("li", m.trust("Up-to-date packages built on our servers from upstream source")), - m("li", m.trust("Installable in any recent Emacs using 'package.el' - no need to install svn/cvs/hg/bzr/git/darcs etc.")), + m("li", m.trust("Installable in any recent Emacs using 'package.el' - no need to install svn/cvs/hg/bzr/git/darcs/fossil etc.")), m("li", m.trust("Curated - no obsolete, renamed, forked or randomly hacked packages")), m("li", m.trust("Comprehensive - more packages than any other archive")), m("li", m.trust("Automatic updates - new commits result in new packages")), diff --git a/html/partials/getting-started.html b/html/partials/getting-started.html index ad4ed8d1..57391592 100644 --- a/html/partials/getting-started.html +++ b/html/partials/getting-started.html @@ -110,7 +110,7 @@

    https://github.com/milkypostman/melpa

    Contributions are welcome. Currently, the builder supports - packages using git, subversion, mercurial, bzr, cvs, darcs and + packages using git, subversion, mercurial, bzr, cvs, darcs, fossil and emacswiki.

    diff --git a/package-build.el b/package-build.el index e2d80271..39f06f37 100644 --- a/package-build.el +++ b/package-build.el @@ -323,6 +323,32 @@ seconds; the server cuts off after 10 requests in 20 seconds.") (pb/find-parse-time "\\([a-zA-Z]\\{3\\} [a-zA-Z]\\{3\\} \\( \\|[0-9]\\)[0-9] [0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\} [A-Za-z]\\{3\\} [0-9]\\{4\\}\\)"))))) +(defun pb/fossil-repo (dir) + "Get the current fossil repo for DIR." + (pb/run-process-match "\\(.*\\)" dir "fossil" "remote-url")) + +(defun pb/checkout-fossil (name config dir) + "Check package NAME with config CONFIG out of fossil into DIR." + (unless package-build-stable + (let ((repo (plist-get config :url))) + (with-current-buffer (get-buffer-create "*package-build-checkout*") + (cond + ((and (file-exists-p (expand-file-name ".fslckout" dir)) + (string-equal (pb/fossil-repo dir) repo)) + (pb/princ-exists dir) + (pb/run-process dir "fossil" "pull")) + (t + (when (file-exists-p dir) + (delete-directory dir t)) + (pb/princ-checkout repo dir) + (make-directory dir) + (pb/run-process dir "fossil" "clone" repo "repo.fossil") + (pb/run-process dir "fossil" "open" "repo.fossil"))) + (pb/run-process dir "fossil" "timeline" "--limit" "1" "--type" "ci" "--width" "0") + (or (pb/find-parse-time + "=== \\([0-9]\\{4\\}-[0-9]\\{2\\}-[0-9]\\{2\\} ===\n[0-9]\\{2\\}:[0-9]\\{2\\}:[0-9]\\{2\\}\\) ") + (error "No valid timestamps found!")))))) + (defun pb/svn-repo (dir) "Get the current svn repo for DIR." (pb/run-process-match "URL: \\(.*\\)" dir "svn" "info")) @@ -571,6 +597,7 @@ Optionally PRETTY-PRINT the data." "--exclude=CVS" "--exclude=.git*" "--exclude=_darcs" + "--exclude=.fslckout" "--exclude=.bzr" "--exclude=.hg" (or (mapcar (lambda (fn) (concat dir "/" fn)) files) (list dir)))) diff --git a/recipes/vc-fossil b/recipes/vc-fossil new file mode 100644 index 00000000..e3c110b2 --- /dev/null +++ b/recipes/vc-fossil @@ -0,0 +1 @@ +(vc-fossil :fetcher fossil :url "http://chiselapp.com/user/venks/repository/emacs-fossil/" :files ("vc/el/*.el" "doc/*")) diff --git a/scripts/bootstrap b/scripts/bootstrap index 2a543fa3..8a072b33 100755 --- a/scripts/bootstrap +++ b/scripts/bootstrap @@ -10,7 +10,7 @@ sudo ${SUDOENV} apt-get update sudo ${SUDOENV} apt-get -y upgrade sudo ${SUDOENV} apt-get -y \ install \ - subversion git cvs darcs curl bzr mercurial \ + subversion git cvs darcs fossil curl bzr mercurial \ emacs24 emacs24-el emacs24-common-non-dfsg \ tmux make From 0bc19798cbe9eb5f4e4c7744b3ac4e10566702c9 Mon Sep 17 00:00:00 2001 From: Dieter Deyke Date: Tue, 8 Jul 2014 11:43:06 +0200 Subject: [PATCH 2/2] 'fossil pull' only updates the repo, to update the working directory too you need 'fossil update' --- package-build.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-build.el b/package-build.el index 39f06f37..04d5945e 100644 --- a/package-build.el +++ b/package-build.el @@ -336,7 +336,7 @@ seconds; the server cuts off after 10 requests in 20 seconds.") ((and (file-exists-p (expand-file-name ".fslckout" dir)) (string-equal (pb/fossil-repo dir) repo)) (pb/princ-exists dir) - (pb/run-process dir "fossil" "pull")) + (pb/run-process dir "fossil" "update")) (t (when (file-exists-p dir) (delete-directory dir t))