[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] scripts: package: Add --install-from-file option.

From: Taylan Ulrich Bayırlı/Kammer
Subject: Re: [PATCH] scripts: package: Add --install-from-file option.
Date: Wed, 19 Aug 2015 15:54:23 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

"Thompson, David" <address@hidden> writes:

> On Wed, Aug 19, 2015 at 4:27 AM, Amirouche Boubekki
> <address@hidden> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]