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: More flexible package dependency specification Date: Fri, 16 Aug 2013 22:58:18 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1376686794 18430 80.91.229.3 (16 Aug 2013 20:59:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Aug 2013 20:59:54 +0000 (UTC) To: 15108@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Aug 16 22:59:56 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 1VAR7i-0006hw-V2 for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 22:59:55 +0200 Original-Received: from localhost ([::1]:33121 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAR7i-00036E-MH for geb-bug-gnu-emacs@m.gmane.org; Fri, 16 Aug 2013 16:59:54 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51619) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAR6z-0002KR-JC for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 16:59:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VAR6u-0007yi-8d for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 16:59:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40984) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VAR6t-0007yX-Cz for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 16:59:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VAR6s-000643-Oq for bug-gnu-emacs@gnu.org; Fri, 16 Aug 2013 16:59:03 -0400 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: Fri, 16 Aug 2013 20:59: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.137668671723262 (code B ref 15108); Fri, 16 Aug 2013 20:59:02 +0000 Original-Received: (at 15108) by debbugs.gnu.org; 16 Aug 2013 20:58:37 +0000 Original-Received: from localhost ([127.0.0.1]:35299 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAR6S-000637-8E for submit@debbugs.gnu.org; Fri, 16 Aug 2013 16:58:36 -0400 Original-Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:40552) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VAR6L-00062o-K3 for 15108@debbugs.gnu.org; Fri, 16 Aug 2013 16:58:33 -0400 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=ifGyfjm3gBA92OjmZFhU/fVzVI6dmfOPSDqab1+iqXw=; b=nKLpFYg9t81E7PxKmgY9XugCKEG1Epm5BuXJgNONqRMqxIZaRWpYQwlAweuOi3q8gmMLNGnJVa3EpPWq8nK95xDClsHjtEX014XEqgjr2d6hjUzUljPrzeOezovuRSpmvEojLx4/+u2T9zUKXczLkAJo+3txoAWMlYZr/VYkuO0=; 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 1VAR6B-0002R2-Jb for 15108@debbugs.gnu.org; Fri, 16 Aug 2013 22:58:19 +0200 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-alwaysdata-ID: 73537615 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:77450 Archived-At: --=-=-= Content-Type: text/plain What would you think of the attached patch? It works for all the examples I sent earlier. Any comments, criticisms and considerations would be greatly appreciated. --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=changelog.diff Content-Description: ChangeLog diff *** lisp/ChangeLog 2013-08-16 22:53:18.590328000 +0200 --- lisp/ChangeLog.new 2013-08-16 22:45:04.548991805 +0200 *************** *** 1,3 **** --- 1,11 ---- + 2013-08-16 Tom Willemse + + * emacs-lisp/package.el (package--prepare-dependencies): New + function. + (package-buffer-info): Call `package--prepare-dependencies' on the + list contained in the package-requires header to make dependency + specification a little more flexible. + 2013-08-16 Lars Magne Ingebrigtsen * net/shr.el (shr-rescale-image): Use ImageMagick even for GIFs --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=package.diff Content-Description: package.el diff *** lisp/emacs-lisp/package.el 2013-08-16 22:53:18.590328000 +0200 --- lisp/emacs-lisp/package.el.new 2013-08-16 22:52:51.479137603 +0200 *************** *** 973,978 **** --- 973,989 ---- 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,1009 **** "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)) :kind 'single)))) (declare-function tar-get-file-descriptor "tar-mode" (file)) --- 1014,1022 ---- "Package lacks a \"Version\" or \"Package-Version\" header")) (package-desc-from-define file-name pkg-version desc ! (if requires-str ! (package--prepare-dependencies ! (package-read-from-string requires-str))) :kind 'single)))) (declare-function tar-get-file-descriptor "tar-mode" (file)) --=-=-=--