From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Hackney Newsgroups: gmane.emacs.devel Subject: cl-defstruct-based package.el, now with ert tests! Date: Mon, 11 Mar 2013 21:03:25 -0400 Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1363050238 24511 80.91.229.3 (12 Mar 2013 01:03:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Mar 2013 01:03:58 +0000 (UTC) To: Emacs development discussions Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Mar 12 02:04:20 2013 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UFDdY-00081j-Dp for ged-emacs-devel@m.gmane.org; Tue, 12 Mar 2013 02:04:16 +0100 Original-Received: from localhost ([::1]:49809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFDdC-0005sN-3a for ged-emacs-devel@m.gmane.org; Mon, 11 Mar 2013 21:03:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44106) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFDd8-0005sI-4c for emacs-devel@gnu.org; Mon, 11 Mar 2013 21:03:52 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UFDd6-0002Ts-LV for emacs-devel@gnu.org; Mon, 11 Mar 2013 21:03:50 -0400 Original-Received: from mail-ia0-x235.google.com ([2607:f8b0:4001:c02::235]:59690) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UFDd5-0002Tj-U2 for emacs-devel@gnu.org; Mon, 11 Mar 2013 21:03:48 -0400 Original-Received: by mail-ia0-f181.google.com with SMTP id w33so4322436iag.12 for ; Mon, 11 Mar 2013 18:03:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=haxney.org; s=google; h=x-received:mime-version:from:date:message-id:subject:to :content-type; bh=cdsBlfDlsL+mJ7P/yURBw4x50zFxbiMb70Wy1WTuC5I=; b=citLjn5KVSJDOAI/EQDsEejVDO3Rru1pypoohKF+FOD8xciPB7gf4da+JHtmeCt9Zy 1vXgvkaIENrGZ/7+4aiuQixmcMvgVV2980SKOxs76Ok4wMMUqaTXKPk8lb8R3o8P19SX kOb2BPlKyiLC7fPqxQ2lmVWtbZ95MRN/soeRw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:from:date:message-id:subject:to :content-type:x-gm-message-state; bh=cdsBlfDlsL+mJ7P/yURBw4x50zFxbiMb70Wy1WTuC5I=; b=deqoFwYey6TKYh7IphBM8dkKHJIghCqVdk66BVW6dSSYjYDWWB1iooXjsoRwqX6JBx XFDpRPn5/HNP8ZlHt7J7PRO500Lzht4ygTDQxLwU53QZ6G4oQLLFYWiIyLB/nRh2jE5G pJNpkFQpFr/S6rwWdTEkkWRSMAXCM6Jwn6AX262Iwn0LpOE6JNyL/BkaBacQzxcGkxid h1raInoud9b3PGTTx+EX5XqE+8eS8uJCIZcTgkHbrwdE5ZJjuL+e89XWRYnDKEKhE2rE 2urB0azbNbCH4OCgz9YiK/zbPgRSP5tplfiPiMjzuKd2SUACZXzEMTiAaMWz27+2K+bs 8jmw== X-Received: by 10.50.173.105 with SMTP id bj9mr9804535igc.44.1363050226463; Mon, 11 Mar 2013 18:03:46 -0700 (PDT) Original-Received: by 10.64.54.39 with HTTP; Mon, 11 Mar 2013 18:03:25 -0700 (PDT) X-Gm-Message-State: ALoCoQlY1rCmzcNk1dxQUjl5xsaFen/bFYtvkNid/atEuaSXuaej6bFla/Q1xIL3y3cTQP15aKeR X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4001:c02::235 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:157754 Archived-At: 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