Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
Nix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nora Puchreiner
Nix
Commits
b0aba6ec
Commit
b0aba6ec
authored
20 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
* Don't keep the derivation symlink when creating profile generations.
parent
32429142
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/nix-env/profiles.cc
+6
-11
6 additions, 11 deletions
src/nix-env/profiles.cc
with
6 additions
and
11 deletions
src/nix-env/profiles.cc
+
6
−
11
View file @
b0aba6ec
...
@@ -61,12 +61,11 @@ Generations findGenerations(Path profile, int & curGen)
...
@@ -61,12 +61,11 @@ Generations findGenerations(Path profile, int & curGen)
}
}
static
void
makeName
s
(
const
Path
&
profile
,
unsigned
int
num
,
static
void
makeName
(
const
Path
&
profile
,
unsigned
int
num
,
Path
&
outLink
,
Path
&
drvLink
)
Path
&
outLink
)
{
{
Path
prefix
=
(
format
(
"%1%-%2%"
)
%
profile
%
num
).
str
();
Path
prefix
=
(
format
(
"%1%-%2%"
)
%
profile
%
num
).
str
();
outLink
=
prefix
+
"-link"
;
outLink
=
prefix
+
"-link"
;
drvLink
=
prefix
+
"-drv"
;
}
}
...
@@ -79,10 +78,10 @@ Path createGeneration(Path profile, Path outPath, Path drvPath)
...
@@ -79,10 +78,10 @@ Path createGeneration(Path profile, Path outPath, Path drvPath)
unsigned
int
num
=
gens
.
size
()
>
0
?
gens
.
front
().
number
:
0
;
unsigned
int
num
=
gens
.
size
()
>
0
?
gens
.
front
().
number
:
0
;
/* Create the new generation. */
/* Create the new generation. */
Path
outLink
,
drvLink
;
Path
outLink
;
while
(
1
)
{
while
(
1
)
{
makeName
s
(
profile
,
num
,
outLink
,
drvLink
);
makeName
(
profile
,
num
,
outLink
);
if
(
symlink
(
outPath
.
c_str
(),
outLink
.
c_str
())
==
0
)
break
;
if
(
symlink
(
outPath
.
c_str
(),
outLink
.
c_str
())
==
0
)
break
;
if
(
errno
!=
EEXIST
)
if
(
errno
!=
EEXIST
)
throw
SysError
(
format
(
"creating symlink `%1%'"
)
%
outLink
);
throw
SysError
(
format
(
"creating symlink `%1%'"
)
%
outLink
);
...
@@ -90,9 +89,6 @@ Path createGeneration(Path profile, Path outPath, Path drvPath)
...
@@ -90,9 +89,6 @@ Path createGeneration(Path profile, Path outPath, Path drvPath)
num
++
;
num
++
;
}
}
if
(
symlink
(
drvPath
.
c_str
(),
drvLink
.
c_str
())
!=
0
)
throw
SysError
(
format
(
"creating symlink `%1%'"
)
%
drvLink
);
return
outLink
;
return
outLink
;
}
}
...
@@ -106,10 +102,9 @@ static void removeFile(const Path & path)
...
@@ -106,10 +102,9 @@ static void removeFile(const Path & path)
void
deleteGeneration
(
const
Path
&
profile
,
unsigned
int
gen
)
void
deleteGeneration
(
const
Path
&
profile
,
unsigned
int
gen
)
{
{
Path
generation
,
gcrootDrv
;
Path
generation
;
makeName
s
(
profile
,
gen
,
generation
,
gcrootDrv
);
makeName
(
profile
,
gen
,
generation
);
removeFile
(
generation
);
removeFile
(
generation
);
if
(
pathExists
(
gcrootDrv
))
removeFile
(
gcrootDrv
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment