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
af94a70b
Commit
af94a70b
authored
11 years ago
by
Eelco Dolstra
Browse files
Options
Downloads
Patches
Plain Diff
Drop support for user environment manifests in ATerm format
parent
245e2640
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/user-env.cc
+1
-112
1 addition, 112 deletions
src/nix-env/user-env.cc
with
1 addition
and
112 deletions
src/nix-env/user-env.cc
+
1
−
112
View file @
af94a70b
...
@@ -11,24 +11,16 @@
...
@@ -11,24 +11,16 @@
namespace
nix
{
namespace
nix
{
static
void
readLegacyManifest
(
const
Path
&
path
,
DrvInfos
&
elems
);
DrvInfos
queryInstalled
(
EvalState
&
state
,
const
Path
&
userEnv
)
DrvInfos
queryInstalled
(
EvalState
&
state
,
const
Path
&
userEnv
)
{
{
DrvInfos
elems
;
DrvInfos
elems
;
Path
manifestFile
=
userEnv
+
"/manifest.nix"
;
Path
manifestFile
=
userEnv
+
"/manifest.nix"
;
Path
oldManifestFile
=
userEnv
+
"/manifest"
;
if
(
pathExists
(
manifestFile
))
{
if
(
pathExists
(
manifestFile
))
{
Value
v
;
Value
v
;
state
.
evalFile
(
manifestFile
,
v
);
state
.
evalFile
(
manifestFile
,
v
);
Bindings
bindings
;
Bindings
bindings
;
getDerivations
(
state
,
v
,
""
,
bindings
,
elems
,
false
);
getDerivations
(
state
,
v
,
""
,
bindings
,
elems
,
false
);
}
else
if
(
pathExists
(
oldManifestFile
))
}
readLegacyManifest
(
oldManifestFile
,
elems
);
return
elems
;
return
elems
;
}
}
...
@@ -167,107 +159,4 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
...
@@ -167,107 +159,4 @@ bool createUserEnv(EvalState & state, DrvInfos & elems,
}
}
/* Code for parsing manifests in the old textual ATerm format. */
static
string
parseStr
(
std
::
istream
&
str
)
{
expect
(
str
,
"Str("
);
string
s
=
parseString
(
str
);
expect
(
str
,
",[])"
);
return
s
;
}
static
string
parseWord
(
std
::
istream
&
str
)
{
string
res
;
while
(
isalpha
(
str
.
peek
()))
res
+=
str
.
get
();
return
res
;
}
static
MetaInfo
parseMeta
(
std
::
istream
&
str
)
{
MetaInfo
meta
;
expect
(
str
,
"Attrs(["
);
while
(
!
endOfList
(
str
))
{
expect
(
str
,
"Bind("
);
MetaValue
value
;
string
name
=
parseString
(
str
);
expect
(
str
,
","
);
string
type
=
parseWord
(
str
);
if
(
type
==
"Str"
)
{
expect
(
str
,
"("
);
value
.
type
=
MetaValue
::
tpString
;
value
.
stringValue
=
parseString
(
str
);
expect
(
str
,
",[])"
);
}
else
if
(
type
==
"List"
)
{
expect
(
str
,
"(["
);
value
.
type
=
MetaValue
::
tpStrings
;
while
(
!
endOfList
(
str
))
value
.
stringValues
.
push_back
(
parseStr
(
str
));
expect
(
str
,
")"
);
}
else
throw
Error
(
format
(
"unexpected token `%1%'"
)
%
type
);
expect
(
str
,
",NoPos)"
);
meta
[
name
]
=
value
;
}
expect
(
str
,
")"
);
return
meta
;
}
static
void
readLegacyManifest
(
const
Path
&
path
,
DrvInfos
&
elems
)
{
string
manifest
=
readFile
(
path
);
std
::
istringstream
str
(
manifest
);
expect
(
str
,
"List(["
);
unsigned
int
n
=
0
;
while
(
!
endOfList
(
str
))
{
DrvInfo
elem
;
expect
(
str
,
"Attrs(["
);
while
(
!
endOfList
(
str
))
{
expect
(
str
,
"Bind("
);
string
name
=
parseString
(
str
);
expect
(
str
,
","
);
if
(
name
==
"meta"
)
elem
.
setMetaInfo
(
parseMeta
(
str
));
else
{
string
value
=
parseStr
(
str
);
if
(
name
==
"name"
)
elem
.
name
=
value
;
else
if
(
name
==
"outPath"
)
elem
.
setOutPath
(
value
);
else
if
(
name
==
"drvPath"
)
elem
.
setDrvPath
(
value
);
else
if
(
name
==
"system"
)
elem
.
system
=
value
;
}
expect
(
str
,
",NoPos)"
);
}
expect
(
str
,
")"
);
if
(
elem
.
name
!=
""
)
{
elem
.
attrPath
=
int2String
(
n
++
);
elems
.
push_back
(
elem
);
}
}
expect
(
str
,
")"
);
}
}
}
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