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, again Date: Wed, 11 Dec 2013 23:52:20 +0100 Message-ID: References: <9e976905-41bb-428c-afe3-ef2cf0673aa7@default> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1386802398 10010 80.91.229.3 (11 Dec 2013 22:53:18 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 11 Dec 2013 22:53:18 +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 23:53:23 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 1Vqseg-000812-CF for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 23:53:22 +0100 Original-Received: from localhost ([::1]:60610 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vqseg-0008L0-0b for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Dec 2013 17:53:22 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqseV-0008Jx-TU for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 17:53:18 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VqseN-0005aM-8A for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 17:53:11 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VqseN-0005aD-1f for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 17:53:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VqseM-0004q8-Hn for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2013 17:53:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Tom Willemse Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Dec 2013 22:53: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: patch Original-Received: via spool by 15108-submit@debbugs.gnu.org id=B15108.138680235218558 (code B ref 15108); Wed, 11 Dec 2013 22:53:02 +0000 Original-Received: (at 15108) by debbugs.gnu.org; 11 Dec 2013 22:52:32 +0000 Original-Received: from localhost ([127.0.0.1]:44369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vqsdr-0004pF-GX for submit@debbugs.gnu.org; Wed, 11 Dec 2013 17:52:31 -0500 Original-Received: from r0.smtpout1.alwaysdata.com ([176.31.58.0]:57164) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Vqsdo-0004p6-Fn for 15108@debbugs.gnu.org; Wed, 11 Dec 2013 17:52:29 -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:In-Reply-To:Date:References:Subject:To:From; bh=JOmK+tYF7wfn5X+kKtkkDdXsdgmgqL7dsJIwBQ/KpDU=; b=mv6HRjoBaEC+hZ7MU+YT+MVQfYxjiQtBBFDLBkGjZuRZmhMBy5tdoXWJJnoSS4UQG4w/WKhqGBy3iQjh4SAUl1rfX7a5DOKq4Rmos+dSI4yv55UMDxghqcF37WCaTQ9N8XQ8PybK8Nzn42jxFOvwM1CDWmAFr6CCvEAvqH4xnvU=; 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 1Vqsdh-0004Tw-Az for 15108@debbugs.gnu.org; Wed, 11 Dec 2013 23:52:21 +0100 In-Reply-To: (Drew Adams's message of "Wed, 11 Dec 2013 13:57:06 -0800 (PST)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-alwaysdata-ID: 96246555 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:81788 Archived-At: --=-=-= Content-Type: text/plain Hey, Another update of my patch. Fixes two cases the last one missed or messed up: ;; Package-Requires: () ;; Package-Requires: ((foo)) The first is the same as not specifying any `Package-Requires' or leaving it empty. The second is the equivalent of any one of: ;; Package-Requires: foo ;; Package-Requires: (foo) ;; Package-Requires: ((foo "0")) Any other situations I might have to take into consideration? --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=pkgdep.patch Content-Description: Updated Package dependency patch === modified file 'lisp/emacs-lisp/package.el' *** lisp/emacs-lisp/package.el 2013-12-11 21:15:12 +0000 --- lisp/emacs-lisp/package.el 2013-12-11 22:29:35 +0000 *************** *** 1104,1109 **** --- 1104,1124 ---- (declare-function lm-homepage "lisp-mnt" (&optional file)) + (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 + ((null deps) nil) + ((symbolp deps) `((,deps "0"))) + ((stringp (cadr deps)) `(,deps)) + ((and (listp deps) (listp (car deps)) + (null (cdar deps))) + `((,(caar deps) "0"))) + (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. *************** *** 1135,1141 **** "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 :url homepage)))) --- 1150,1158 ---- "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 :url homepage)))) --=-=-=--