Skip to content

dochang/elpa-clone

Repository files navigation

elpa-clone - Clone ELPA archive

Author: ZHANG Weiyi dochang@gmail.com
Version: 0.4.0
URL: https://github.com/dochang/elpa-clone

MELPA MELPA Stable CI CircleCI GitHub Say Thanks!

Mirror an ELPA archive into a directory.

Prerequisites

  • Emacs 24.4 or later
  • cl-lib
  • rsync (optional, but recommended)

Installation

elpa-clone is available on MELPA and el-get.

To install elpa-clone from git repository, clone the repo, then add the repo dir into load-path.

Usage

To clone an ELPA archive http://host/elpa into /path/to/elpa, invoke elpa-clone:

    (elpa-clone "http://host/elpa" "/path/to/elpa")

elpa-clone can also be invoked via M-x.

You can customize download interval via elpa-clone-download-interval. But note that the real interval is (max elpa-clone-download-interval 5).

Prefer rsync

Some ELPA archives can more efficiently be cloned using rsync:

    (elpa-clone "elpa.gnu.org::elpa/" "/path/to/elpa")
    (elpa-clone "rsync://melpa.org/packages/" "/path/to/elpa")
    (elpa-clone "rsync://stable.melpa.org/packages/" "/path/to/elpa")

Currently, only the following archives support rsync:

  • GNU ELPA
  • MELPA
  • MELPA Stable

By default, elpa-clone selects the appropriate sync method based on the upstream url, but you can also specify the method you want:

    (elpa-clone "foo/" "bar/" :sync-method 'rsync)
    (elpa-clone "foo::bar/" "/path/to/elpa" :sync-method 'local)
    (elpa-clone "rsync://foo/bar/" "/path/to/elpa" :sync-method 'url)

Available methods are:

  • rsync: use rsync (recommended)
  • url: use the url library
  • local: treat upstream as a local directory
  • nil: choose a method based on upstream

Note

elpa-clone will NOT overwrite existing packages but will clean outdated packages before downloading new packages. If a package file is broken, remove the file and call elpa-clone again.

License

GPLv3


Converted from elpa-clone.el by el2markdown.