From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Willemse Newsgroups: gmane.emacs.bugs Subject: bug#15108: [Patch] Updated package dependencies Date: Wed, 11 Dec 2013 21:29:58 +0100 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1386793874 10565 80.91.229.3 (11 Dec 2013 20:31:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2013 20:31:14 +0000 (UTC) To: 15108@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Dec 11 21:31:19 2013 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1VqqRD-0005fy-H3 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 21:31:19 +0100 Original-Received: from localhost ([::1]:60113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqqRD-0003NG-0s for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 15:31:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36748) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqqR3-0003M5-Aj for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 15:31:15 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqqQx-0006el-5R for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 15:31:09 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58495) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqqQw-0006eh-LJ for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 15:31:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VqqQw-0001Ma-5m for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 15:31:02 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: Resent-From: Tom Willemse Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2013 20:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15108 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15108-submit@debbugs.gnu.org id=B15108.13867938105170 (code B ref 15108); Wed, 11 Dec 2013 20:31:02 +0000 Original-Received: (at 15108) by debbugs.gnu.org; 11 Dec 2013 20:30:10 +0000 Original-Received: from localhost ([127.0.0.1]:44281 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VqqQ5-0001LJ-5I for submit@debbugs.gnu.org; Wed, 11 Dec 2013 15:30:09 -0500 Original-Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:46551) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VqqQ0-0001KL-JB for 15108@debbugs.gnu.org; Wed, 11 Dec 2013 15:30:06 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=alwaysdata.net; s=ryuslash; h=Content-Type:MIME-Version:Message-ID:Date:Subject:To:From; bh=tzeZDf1tuA8UEkxcykCtsl6ChjU49Z2V+EL5346xolo=; b=ek+GKVEs38tlfO/Q4Z0HYyGIdP9yJvr8Z503gADDq5JPLuwS5rbSd3+VZqAq9H1pFIK89TIWLLIOKdeBS67gRkDFIkNLj+HISv2R0HDpQ7JxYkdi4UBo+cVHH/3cKGxM0ISD9J6fNOVwmxp3GTgf7PMZhrDCQpuidVkf8puV1BA=; Original-Received: from 78-21-108-183.access.telenet.be ([78.21.108.183] helo=localhost) by smtpout1.alwaysdata.com with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.77) (envelope-from ) id 1VqqPv-0000jL-4g for 15108@debbugs.gnu.org; Wed, 11 Dec 2013 21:29:59 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-alwaysdata-ID: 96229801 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:81783 Archived-At: --=-=-= Content-Type: text/plain Hey, I've been meaning to send this for a couple of weeks, but I was unable to. I apologize. A while ago the patch I sent last time broke, I fixed it and now here I'm sending it again, hoping there is still some interest in this or need for it. I've removed the changes to the ChangeLog (or at least, I'm not sending them again), since I've lost confidence in it being my place to do so. I've tested it most recently bzr trunk revision 115470. All the ways to specify dependencies work as described before: ;; Package-Requires: foo ;; Package-Requires: (foo bar) ;; Package-Requires: (foo (baz "1.1.0") bar) ;; Package-Requires: (baz "1.1.0") These would all be valid after this patch. As before, any comments, criticisms and considerations would be greatly appreciated. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=pkgdep.patch Content-Description: Package dependency patch === modified file 'lisp/emacs-lisp/package.el' --- lisp/emacs-lisp/package.el 2013-08-03 02:34:22 +0000 +++ lisp/emacs-lisp/package.el 2013-08-16 20:40:09 +0000 @@ -973,6 +973,17 @@ str) (error nil)))) +(defun package--prepare-dependencies (deps) + "Turn DEPS into an acceptable list of dependencies. + +Any parts missing a version string get a default version string +of \"0\" (meaning any version) and an appropriate level of lists +is wrapped around any parts requiring it." + (cond + ((symbolp deps) `((,deps "0"))) + ((stringp (cadr deps)) `(,deps)) + (t (mapcar (lambda (dep) (if (symbolp dep) `(,dep "0") dep)) deps)))) + (defun package-buffer-info () "Return a `package-desc' describing the package in the current buffer. @@ -1003,7 +1014,9 @@ "Package lacks a \"Version\" or \"Package-Version\" header")) (package-desc-from-define file-name pkg-version desc - (if requires-str (package-read-from-string requires-str)) + (if requires-str + (package--prepare-dependencies + (package-read-from-string requires-str))) :kind 'single :url homepage)))) --=-=-=--