[Nix-dev] package-darcs package-svn package-v.v.v ?
Eelco Dolstra
eelco at cs.uu.nl
Wed Aug 15 14:15:00 CEST 2007
Hi,
Marc Weber wrote:
> Should
> package-darcs behave the way
> package-1.0 behaves?
> if there is no alternative?
>
> I would say nix-env -i package should be able to install package-darcs if
> there is none with given version availible. What do you think?
>
> Or would you prefer a different way marking a repository version ?
Nix-env considers the version number everything starting at the first digit
following a dash. So in "quake3-icculus-1.33pre526" the package name is
"quake3-icculus" and the version is "1.33pre526". So "package-darcs" and
"package-1.0" would be considered different versions.
What I usually do is give it a name like "foo-1.1-pre-r1234" (for a Subversion
revision) or "foo-1.1-pre20070815" (for CVS / darcs / whatever). The "pre"
string is treated specially when comparing versions, so that "1.0" <
"1.1pre-r1234" < "1.1".
The precise rules for the partial ordering of versions can be found here:
http://nix.cs.uu.nl/dist/nix/nix-0.10.1/manual/#sec-nix-env (under "Versions").
A nice feature would be the ability to define your own ordering. This would
allow packages to be renamed. For instance, yesterday I found out that the
"docbook5-xsl" package should really be named "docbook-xsl-ns". So you could
like to have a rule like "docbook5-xsl" < "docbook-xsl-ns" so that nix-env will
upgrade the former to the latter.
--
Eelco Dolstra | http://www.cs.uu.nl/~eelco
More information about the nix-dev
mailing list