about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2005-02-14T10·44+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2005-02-14T10·44+0000
commitb0aba6ec2ac09d5ecdf0068b91010cdee1caae9d (patch)
tree29c5c4ac63201567a06c77cbe24229d3ea41a7aa
parent32429142cd267196d68b6706b5d340d03c0a1dc2 (diff)
* Don't keep the derivation symlink when creating profile generations.
-rw-r--r--src/nix-env/profiles.cc17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/nix-env/profiles.cc b/src/nix-env/profiles.cc
index 20aaded776e6..52144eb2f69d 100644
--- a/src/nix-env/profiles.cc
+++ b/src/nix-env/profiles.cc
@@ -61,12 +61,11 @@ Generations findGenerations(Path profile, int & curGen)
 }
 
 
-static void makeNames(const Path & profile, unsigned int num,
-    Path & outLink, Path & drvLink)
+static void makeName(const Path & profile, unsigned int num,
+    Path & outLink)
 {
     Path prefix = (format("%1%-%2%") % profile % num).str();
     outLink = prefix + "-link";
-    drvLink = prefix + "-drv";
 }
 
 
@@ -79,10 +78,10 @@ Path createGeneration(Path profile, Path outPath, Path drvPath)
     unsigned int num = gens.size() > 0 ? gens.front().number : 0;
         
     /* Create the new generation. */
-    Path outLink, drvLink;
+    Path outLink;
 
     while (1) {
-        makeNames(profile, num, outLink, drvLink);
+        makeName(profile, num, outLink);
         if (symlink(outPath.c_str(), outLink.c_str()) == 0) break;
         if (errno != EEXIST)
             throw SysError(format("creating symlink `%1%'") % outLink);
@@ -90,9 +89,6 @@ Path createGeneration(Path profile, Path outPath, Path drvPath)
         num++;
     }
 
-    if (symlink(drvPath.c_str(), drvLink.c_str()) != 0)
-        throw SysError(format("creating symlink `%1%'") % drvLink);
-
     return outLink;
 }
 
@@ -106,10 +102,9 @@ static void removeFile(const Path & path)
 
 void deleteGeneration(const Path & profile, unsigned int gen)
 {
-    Path generation, gcrootDrv;
-    makeNames(profile, gen, generation, gcrootDrv);
+    Path generation;
+    makeName(profile, gen, generation);
     removeFile(generation);
-    if (pathExists(gcrootDrv)) removeFile(gcrootDrv);
 }