diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-21T15·08+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-04-21T15·08+0000 |
commit | fe2d869e04372de69719c3989a75247ff44b8fd4 (patch) | |
tree | ce7df351314663d45adaa6a3b7ba4c64f179c63a /src/nix-env/profiles.cc | |
parent | f3b8833a48472c3545ea8673d687ea9cadcedd61 (diff) |
* Store user environment manifests as a Nix expression in
$out/manifest.nix rather than as an ATerm. (Hm, I thought I committed this two days ago...)
Diffstat (limited to 'src/nix-env/profiles.cc')
-rw-r--r-- | src/nix-env/profiles.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/nix-env/profiles.cc b/src/nix-env/profiles.cc index 75585b1b2907..60576f1ae74b 100644 --- a/src/nix-env/profiles.cc +++ b/src/nix-env/profiles.cc @@ -130,6 +130,20 @@ void switchLink(Path link, Path target) throw SysError(format("renaming `%1%' to `%2%'") % tmp % link); } - + +void lockProfile(PathLocks & lock, const Path & profile) +{ + lock.lockPaths(singleton<PathSet>(profile), + (format("waiting for lock on profile `%1%'") % profile).str()); + lock.setDeletion(true); +} + + +string optimisticLockProfile(const Path & profile) +{ + return pathExists(profile) ? readLink(profile) : ""; +} + + } |