Commit graph

67 commits

Author SHA1 Message Date
Eelco Dolstra
55e11bc0d3 * In nix-env --query --status', determine the I' bit by looking at
the output path of a derivation, not the path of its store
  expression.  This ensures that changes that affect the path of the
  store expression but not the output path, do not affect the
  `installed' state of a derivation.
2004-01-15 14:43:00 +00:00
Eelco Dolstra
4a373a3e9a * Implemented Eelco V.'s `nix-env -I' command to specify the default
path of the Nix expression to be used with the import, upgrade, and
  query commands.  For instance,

  $ nix-env -I ~/nixpkgs/pkgs/system/i686-linux.nix

  $ nix-env --query --available   [aka -qa]
  sylpheed-0.9.7
  bison-1.875
  pango-1.2.5
  subversion-0.35.1
  ...

  $ nix-env -i sylpheed

  $ nix-env -u subversion

  There can be only one default at a time.

* If the path to a Nix expression is a symlink, follow the symlink
  prior to resolving relative path references in the expression.
2004-01-05 16:26:43 +00:00
Eelco Dolstra
f83c5e3e5f * Implemented Eelco V.'s `-p' command to switch profiles. It switches
the symlink ~/.nix-userenv to the given argument (which defaults to
  .../links/current).  /etc/profile.d/nix-profile creates this symlink
  if it doesn't exist yet.  Example use:

  $ nix-env -l my_profile -i foo.nix subversion quake
  $ nix-env -p my_profile

  I don't like the term "profile".  Let's deprecate it :-)
2004-01-05 11:18:59 +00:00
Eelco Dolstra
392b7e0f8e * Fixed a bug in the upgrade operation. 2003-12-23 22:13:36 +00:00
Eelco Dolstra
833f2fc92d * GCC 2.95 compatibility. 2003-12-22 16:40:46 +00:00
Eelco Dolstra
cf0287c09e * Upgrade operation in `nix-env'. For instance, you can say
nix-env -u foo.nix strategoxt

  to replace the installed `strategoxt' derivation with the one from `foo.nix', if 
  the latter has a higher version number.  This is a no-op if `strategoxt' is not 
  installed.  Wildcards are also accepted, so

    nix-env -u foo.nix '*'

  will replace any installed derivation with newer versions from `foo.nix', if 
  available.

  The notion of "version number" is somewhat ad hoc, but should be useful in most 
  cases, as evidenced by the following unit tests for the version comparator:

    TEST("1.0", "2.3", -1);
    TEST("2.1", "2.3", -1);
    TEST("2.3", "2.3", 0);
    TEST("2.5", "2.3", 1);
    TEST("3.1", "2.3", 1);
    TEST("2.3.1", "2.3", 1);
    TEST("2.3.1", "2.3a", 1);
    TEST("2.3pre1", "2.3", -1);
    TEST("2.3pre3", "2.3pre12", -1);
    TEST("2.3a", "2.3c", -1);
    TEST("2.3pre1", "2.3c", -1);
    TEST("2.3pre1", "2.3q", -1);

  (-1 = less, 0 = equal, 1 = greater)

* A new verbosity level `lvlInfo', between `lvlError' and `lvlTalkative'.  This is 
  the default for `nix-env', so without any `-v' flags users should get useful 
  output, e.g.,

$ nix-env -u foo.nix strategoxt
upgrading `strategoxt-0.9.2' to `strategoxt-0.9.3'
2003-12-22 16:04:00 +00:00
Eelco Dolstra
f3c9783846 * Version numbers can be omitted in install/uninstall. E.g.,
nix-env -i foo.nix subversion

  The version number part of a derivation name is defined as everything following the 
  first dash not followed by a letter.
2003-12-21 23:58:56 +00:00
Eelco Dolstra
a81b621202 * -u' -> -e'.
* `--link' / `-l' flag to specify the switch symlink to use (by default, 
  /nix/var/nix/links/current).
2003-12-21 22:34:41 +00:00
Eelco Dolstra
0c804c6775 * Regression fix: query flags (e.g., "-qsf") were broken. 2003-12-02 10:21:40 +00:00
Eelco Dolstra
078e20885e * Help text for all (non-script) programs, so no more:
$ nix-instantiate --help
error: unknown flag `--help`
Try `nix-instantiate --help' for more information.

:-)
2003-12-01 15:55:05 +00:00
Eelco Dolstra
b857267893 * Allow the top-level expression to be a derivation.
* Hack: `nix-env -i *' installs all available derivations.
2003-11-24 11:01:19 +00:00
Eelco Dolstra
af7e6fe22e * Don't use a hard-coded path. 2003-11-22 21:12:36 +00:00
Eelco Dolstra
40d9eb14df * Fix the garbage collector. 2003-11-22 15:58:34 +00:00
Eelco Dolstra
06208d1d86 * Uninstallation. 2003-11-21 14:23:18 +00:00
Eelco Dolstra
2e9042bd1e * Uninstall command (doesn't work yet). 2003-11-20 13:48:48 +00:00
Eelco Dolstra
e0b5a492f5 * Installation: add the previously installed packages. Switch to the new
configuration.
* Status queries.
2003-11-19 21:32:03 +00:00
Eelco Dolstra
9898746ef3 * nix-env: a tool to manage user environments.
* Replace all directory reading code by a generic readDirectory()
  function.
2003-11-19 17:27:16 +00:00