From mboxrd@z Thu Jan 1 00:00:00 1970 From: taylanbayirli@gmail.com (Taylan Ulrich =?utf-8?Q?Bay=C4=B1rl=C4=B1?= =?utf-8?Q?=2FKammer?=) Subject: Re: [PATCH] scripts: package: Add --install-from-file option. Date: Wed, 19 Aug 2015 15:54:23 +0200 Message-ID: <8737zfl6y8.fsf@T420.taylan> References: <8737zs78rs.fsf@izanagi.i-did-not-set--mail-host-address--so-tickle-me> <57add006a9e098fd69e269f1082262c7@hypermove.net> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:36226) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZS3p2-0000Dd-Bw for guix-devel@gnu.org; Wed, 19 Aug 2015 09:54:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZS3oy-0002vQ-9J for guix-devel@gnu.org; Wed, 19 Aug 2015 09:54:32 -0400 In-Reply-To: (David Thompson's message of "Wed, 19 Aug 2015 09:04:15 -0400") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: "Thompson, David" Cc: guix-devel , guix-devel-bounces+amirouche=hypermove.net@gnu.org "Thompson, David" writes: > On Wed, Aug 19, 2015 at 4:27 AM, Amirouche Boubekki > wrote: > >> What about dispatch `guix package -i` depending on the argument. In >> principle there will be no "*.scm$" packages so the above could be >> >> guix package -i package.scm >> >> The idea behind that is to keep the number of command to minimum. In this >> case, IMO, it makes sens to merge both logic inside the same UI. > > That won't work because it creates ambiguities in the package spec > syntax. How can one tell if a package spec or a file name was passed > with 100% accuracy? You can't, and we'd have to use a heuristic that > would surely fail in some awful way for someone. It's best for this > to be a separate argument. > > - Dave Sometimes a 99.9% solution is acceptable IMO. Packages named "foo.scm" should be exceedingly rare in first place, and then if you also have a file of that name in the current directory... Another option might be to expect a slash in the string, i.e. forcing "./" if the file's in the current directory: guix package -i ./package.scm Happening to have a package with a slash in its name, ending in .scm, and coinciding with the relative or absolute path of a file existing on your filesystem, ought to be implausible. Just my two cents from glancing over the discussion though. No strong opinions. Additional flag is fine too by me. Taylan