Commit graph

121 commits

Author SHA1 Message Date
Eelco Dolstra 24737f279e * Backwards compatibility with old user environment manifests. 2006-10-17 14:01:45 +00:00
Eelco Dolstra 822dba2210 * Maintain the references for the user environment properly. 2006-10-17 12:15:15 +00:00
Eelco Dolstra 46b631b6c4 * Don't generate an empty drvPath attribute in the manifest. 2006-10-17 10:15:42 +00:00
Eelco Dolstra d7efd76394 * Big cleanup of the semantics of paths, strings, contexts, string
concatenation and string coercion.  This was a big mess (see
  e.g. NIX-67).  Contexts are now folded into strings, so that they
  don't cause evaluation errors when they're not expected.  The
  semantics of paths has been clarified (see nixexpr-ast.def).
  toString() and coerceToString() have been merged.

  Semantic change: paths are now copied to the store when they're in a
  concatenation (and in most other situations - that's the
  formalisation of the meaning of a path).  So

    "foo " + ./bla

  evaluates to "foo /nix/store/hash...-bla", not "foo
  /path/to/current-dir/bla".  This prevents accidental impurities, and
  is more consistent with the treatment of derivation outputs, e.g.,
  `"foo " + bla' where `bla' is a derivation.  (Here `bla' would be
  replaced by the output path of `bla'.)
2006-10-16 15:55:34 +00:00
Eelco Dolstra 3632019b73 * Quick hack to let nix-install-package set the package name properly
(e.g., "java-front-0.9pre15899" instead of "java-front";
  particularly important when doing upgrades later on).
2006-09-25 14:00:59 +00:00
Eelco Dolstra e0afaf1857 * Wow, that bug has been there since r764. 2006-09-14 22:48:59 +00:00
Eelco Dolstra 86cbd93ec1 * nix-env --switch-generation / --list-generations /
--delete-generations: lock the profile to prevent (extremely
  unlikely) race conditions.
2006-09-14 22:33:53 +00:00
Eelco Dolstra 5c38c863bd * Fix a huge gaping hole in nix-env w.r.t. the garbage collector.
Nix-env failed to call addPermRoot(), which is necessary to safely
  add a new root.  So if nix-env started after and finished before the
  garbage collector, the user environment (plus all other new stuff)
  it built might be garbage collected, leading to a dangling symlink
  chain in ~/.nix-profile...

* Be more explicit if we block on the GC lock ("waiting for the big
  garbage collector lock...").

* Don't loop trying to create a new generation.  It's not necessary
  anymore since profiles are locked nowadays.
2006-09-14 22:30:33 +00:00
Eelco Dolstra a89a201598 * Missing #include. 2006-09-05 10:32:47 +00:00
Eelco Dolstra 75068e7d75 * Use a proper namespace.
* Optimise header file usage a bit.
* Compile the parser as C++.
2006-09-04 21:06:23 +00:00
Eelco Dolstra 4b66cebe7b * Remove those storePath attribute sets, we don't need 'em. 2006-08-25 17:09:55 +00:00
Eelco Dolstra f41297fdce * Allow --arg in nix-env as well, example:
$ nix-env -qa --system-filter \* --arg system '"powerpc-darwin"'

  to override the system from the default value (__currentSystem in
  all-packages.nix).
2006-08-23 16:33:21 +00:00
Eelco Dolstra 18e4ac0fc6 * `nix-instantiate --{eval|parse}-only --xml': print an XML
representation instead of an ATerm.
* Indent XML output.
2006-08-16 10:32:30 +00:00
Eelco Dolstra f1aa71a92f * Fix the help message wrt --attr. 2006-08-09 15:12:34 +00:00
Eelco Dolstra a0607be7f4 * Workaround for a bug (?) in GCC 2.95. 2006-08-07 19:48:38 +00:00
Eelco Dolstra 339e6f0e1d * `nix-env -q --xml': show query result in XML format for easier
automated processing.
2006-08-03 15:52:09 +00:00
Eelco Dolstra 4661282fde * `nix-instantiate ... --arg NAME VALUE': allow arguments to be passed
to functions from the command line.
* nix-build: started removing backticks.
2006-07-28 16:03:28 +00:00
Eelco Dolstra ca2238cf81 * Refactoring: get the selection path stuff out of getDerivations()
and put it into a separate function findAlongAttrPath().
2006-07-26 15:05:15 +00:00
Eelco Dolstra 0e6dc72a7a * Applied rbroek's patch from the branch at
https://svn.cs.uu.nl:12443/repos/trace/buildfarm-control/trunk/ext/nix/,
  with some modifications.  This allows `nix-env -qa' to show the
  attribute path that can be used to unambiguously install a package
  using `nix-env -i -A'.  Example:

    $ nix-env -f top-level/all-packages.nix -qaA subversion xorg-server
    subversionWithJava  subversion-1.2.3
    subversion          subversion-1.3.2
    subversion14        subversion-1.4.0pre-rc1
    xorg.xorgserver     xorg-server-1.1.0
2006-07-25 16:40:38 +00:00
Eelco Dolstra 5744dd5480 * Support the --attr / -A flag in nix-env as well. So now we can do,
e.g.,

  $ nix-env -i -A subversion xorg.xorgserver

  The main advantage over using symbolic names is that using attribute
  names is unambiguous and much, much faster.
2006-07-25 11:53:22 +00:00
Eelco Dolstra a945fb7905 * `nix-env --upgrade --eq': only upgrade if the old version is equal
to the new version.  This is actually useful.
2006-06-27 12:17:25 +00:00
Eelco Dolstra 588cb0eade * In `nix-env -i|-u|-e', lock the profile to prevent races between
concurrent nix-env operations on the same profile.  Fixes NIX-7.
2006-06-15 11:56:49 +00:00
Eelco Dolstra b5988004d6 * Support for srcdir != builddir (NIX-41). 2006-05-12 11:47:45 +00:00
Eelco Dolstra 9d72bf8835 * 64-bit compatibility fixes (for problems revealed by building on an Athlon
64 running 64-bit SUSE).  A patched ATerm library is required to run Nix
  succesfully.
2006-05-11 02:19:43 +00:00
Eelco Dolstra 0832956089 * Use the new ATermMap. 2006-05-04 12:21:08 +00:00
Eelco Dolstra b52e711910 * Huge reduction in memory use (2/3 or so on large nix-env -qas
operations): share ATermMaps between DrvInfos.
2006-05-02 17:12:03 +00:00
Eelco Dolstra 37d1b1cafd * `nix-env -qa --description' shows human-readable descriptions of
packages (provided that they have a `meta.description' attribute).
  E.g.,

  $ ./src/nix-env/nix-env -qa --description gcc
  gcc-4.0.2   GNU Compiler Collection, 4.0.x (cross-compiler for sparc-linux)
  gcc-4.0.2   GNU Compiler Collection, 4.0.x (cross-compiler for mips-linux)
  gcc-4.0.2   GNU Compiler Collection, 4.0.x (cross-compiler for arm-linux)
  gcc-4.0.2   GNU Compiler Collection, 4.0.x
2006-03-10 16:20:42 +00:00
Eelco Dolstra 4ada6db1fc * `nix-env -q' now accepts arguments that allow specific derivations
to be queried, e.g., `nix-env -qa firefox'.  This does require the
  argument '*' to be passed if one wants information about all
  derivations, so the old `nix-env -qa' now is `nix-env -qa "*"'.
2006-03-10 10:24:46 +00:00
Eelco Dolstra 6dca5c9099 * When obtaining derivations from Nix expressions, ignore all
expressions that cause an assertion failure (like `assert system ==
  "i686-linux"').  This allows all-packages.nix in Nixpkgs to be used
  on all platforms, even if some Nix expressions don't work on all
  platforms.

  Not sure if this is a good idea; it's a bit hacky.  In particular,
  due to laziness some derivations might appear in `nix-env -qa' but
  disappear in `nix-env -qas' or `nix-env -i'.

  Commit 5000!
2006-03-08 16:03:58 +00:00
Eelco Dolstra c8bfb11b34 * `nix-env (-i|-u) --dry-run' now shows exactly which missing paths
will be built or substituted.
2006-03-06 11:21:15 +00:00
Eelco Dolstra 7ba1fd2029 * Regularise help text a bit. 2006-03-06 11:04:39 +00:00
Eelco Dolstra 74166f2f44 * db.hh shouldn't depend on the Berkeley DB headers. 2006-03-01 17:44:28 +00:00
Eelco Dolstra 46f0cb0869 * In "nix-env -i", print a warning if there are multiple derivations
with the same name *and* version number, and pick the first one
  (this means that the order in which channels appear in
  ~/.nix-channels matters).  E.g.:

    $ nix-env ii aterm
    warning: there are multiple derivations named `aterm-2.4.2'; using the first one
    installing `aterm-2.4.2'
2006-02-17 18:11:45 +00:00
Eelco Dolstra 7a3e715980 * Fix for NIX-31: "nix-env -i foo" installing all derivations named
foo.  Now it will only install the one with the highest version
  number.
2006-02-17 17:47:54 +00:00
Eelco Dolstra 889ef564fd * Fix the infamous NIX-17: nix-env -i prints misleading messages
("installing `foo'" followed by "uninstalling `foo'").
2006-02-17 16:26:28 +00:00
Eelco Dolstra 287d0ef41c * Oops, fix breakage. 2006-02-08 14:32:33 +00:00
Eelco Dolstra 39f50db731 * Refactoring: move derivation evaluation to libexpr. 2006-02-08 13:21:16 +00:00
Eelco Dolstra 9e4ffc43a2 * The "S" bit should be based on the output path, not the derivation path. 2006-02-01 16:47:51 +00:00
Eelco Dolstra db2275cb99 * Oops, the "I" bit in "nix-env -qas" was broken. Reported by Nicolae Vintila. 2006-01-26 23:18:26 +00:00
Eelco Dolstra 1d2460ee5d * Documentation fixes. 2005-12-24 23:22:05 +00:00
Eelco Dolstra dfbf520ec2 * Swap the system and version comparion columns. 2005-10-06 15:51:59 +00:00
Eelco Dolstra cec2be64f3 * Only colorise if we are attached to a terminal. 2005-10-06 15:01:46 +00:00
Eelco Dolstra b87b9c0d1f * New query option: --compare-versions' or -c' to compare installed
versions to available versions, or vice versa.

  For example, the following compares installed versions to available
  versions:

    $ nix-env -qc
    autoconf-2.59            = 2.59
    automake-1.9.4           < 1.9.6
    f-spot-0.0.10            - ?
    firefox-1.0.4            < 1.0.7
    ...

  I.e., there are newer versions available (in the current default Nix
  expression) for Automake and Firefox, but not for Autoconf, and
  F-Spot is missing altogether.

  Conversely, the available versions can be compared to the installed
  versions:

    $ nix-env -qac
    autoconf-2.59                  = 2.59
    automake-1.9.6                 > 1.9.4
    bash-3.0                       - ?
    firefox-1.0.7                  > 1.0.4
    ...

  Note that bash is available but no version of it is installed.

  If multiple versions are available for comparison, then the highest
  is used.  E.g., if Subversion 1.2.0 is installed, and Subversion
  1.1.4 and 1.2.3 are available, then `nix-env -qc' will print `<
  1.2.3', not `> 1.1.4'.

  If higher versions are available, the version column is printed in
  red (using ANSI escape codes).
2005-10-06 14:44:54 +00:00
Eelco Dolstra 2bcd65ecf6 * `nix-env -e' corrupts memory due to incorrect use of iterators.
Reported by Rob Vermaas.
2005-09-01 18:14:04 +00:00
Eelco Dolstra 4c20a08293 * Build dynamic libraries. 2005-07-22 14:52:45 +00:00
Eelco Dolstra 9ec7e58aa4 * Handle store path arguments in `nix-env -i' correctly again. 2005-05-09 17:55:35 +00:00
Eelco Dolstra edd145d2fb * Lazily compute the derivation and output paths of derivations. This
makes most query and installation operations much faster (e.g.,
  `nix-env -qa' on the current Nixpkgs is about 10 times faster).
2005-05-08 10:32:09 +00:00
Eelco Dolstra 52a2f41320 * Include some required header files. 2005-05-04 16:33:20 +00:00
Eelco Dolstra 74ab0695b5 * Compatibility hack with older user environments. 2005-02-17 15:48:50 +00:00
Eelco Dolstra 202d5bbda5 * Compatibility with older GCCs. 2005-02-15 12:05:47 +00:00