unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Daniel Hackney <dan@haxney.org>
To: Emacs development discussions <emacs-devel@gnu.org>
Subject: cl-defstruct-based package.el, now with ert tests!
Date: Mon, 11 Mar 2013 21:03:25 -0400	[thread overview]
Message-ID: <CAMqXDZt9nCZy4szdmrJSfTbNY_-8j84=sFKOHDZc6T_wg=uRPA@mail.gmail.com> (raw)

I've mentioned this project on the list before, and I want to update
everyone now that I have more thorough testing.

My aim has been to clean up package.el, primarily by using
`cl-defstruct' to create a `package-desc' structure which is used
throughout the library. This replaces the current situation, in which
package information floats through the library in several different
forms. Sometimes a package is represented as a `cons' of the package
name and a vector of information, sometimes (as in "foo-pkg.el" files),
it is represented more like a list, and sometimes as a name and version
as separate arguments. Moving to a single, uniform representation
simplifies extensibility.

The changes touch most of the code, but the overall structure of the
code has not changed significantly. Some parts of the code which were
questionable in the first place (such as using `tar-mode' to extract tar
archives) have been replaced with simpler alternatives. In the case of
tar, the file is simply downloaded to a temporary directory and
extracted using "tar xaf foo-1.2.3.tar".

This reorganization will make it easier to add features, most notably
the use of compressed archives and signatures, since the code is better
organized and easier to modify.

An important part of the work is that it is fully compatible with the
externally-facing "API" of the current package.el. It produces and
consumes exactly the same "archive-contents" and "*-pkg.el" files as the
current package.el, so none of the existing infrastructure needs to
change.

Finally, I have written a set of tests using ERT to ensure correct
behavior. The file is in "test/automated" and tests:

- single- and multi-file package installation
- installing packages with dependencies
- refreshing archive contents
- displaying the "*Packages*" buffer
- Upgrading packages using `package-menu-mark-upgrades'

All of the tests pass for me.

It is rebased off of the current trunk. My rewrite is here:

https://github.com/haxney/emacs/tree/package-rewrite

Hope you enjoy!

--
Daniel Hackney



             reply	other threads:[~2013-03-12  1:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-12  1:03 Daniel Hackney [this message]
2013-03-12  2:01 ` cl-defstruct-based package.el, now with ert tests! Tom Tromey
2013-03-12 12:03   ` Dmitry Gutov
2013-03-12 18:13     ` Ted Zlatanov
2013-03-14  4:36       ` Daniel Hackney
2013-03-14 10:53         ` Stephen J. Turnbull
2013-03-14 12:11         ` Ted Zlatanov
2013-03-14 13:49         ` Stefan Monnier
2013-03-14 17:53           ` chad
2013-03-15  4:00           ` Daniel Hackney
2013-03-15 12:56             ` Stefan Monnier
2013-03-15 13:46               ` Eli Zaretskii
2013-03-20 18:01             ` Ted Zlatanov
2013-03-12 16:25   ` Daniel Hackney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMqXDZt9nCZy4szdmrJSfTbNY_-8j84=sFKOHDZc6T_wg=uRPA@mail.gmail.com' \
    --to=dan@haxney.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).