diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-12-20 13:43:32 +0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2004-12-20 13:43:32 +0000 |
commit | fa9259f5f519386b4f32ac9490bc73459773e589 (patch) | |
tree | c99bc5b3e04334020b8886081c6201246fab41ce /src/nix-store/main.cc | |
parent | 015beb7cd04ee75d58bf09ef89816f9301cda646 (diff) |
* Simplify the substitute mechanism:
- Drop the store expression. So now a substitute is just a
command-line invocation (a program name + arguments). If you
register a substitute you are responsible for registering the
expression that built it (if any) as a root of the garbage
collector.
- Drop the substitutes-rev DB table.
Diffstat (limited to 'src/nix-store/main.cc')
-rw-r--r-- | src/nix-store/main.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/nix-store/main.cc b/src/nix-store/main.cc index febe65e5c..1a9cbddbd 100644 --- a/src/nix-store/main.cc +++ b/src/nix-store/main.cc @@ -166,7 +166,6 @@ static void opSubstitute(Strings opFlags, Strings opArgs) Substitute sub; getline(cin, srcPath); if (cin.eof()) break; - getline(cin, sub.storeExpr); getline(cin, sub.program); string s; getline(cin, s); @@ -186,6 +185,17 @@ static void opSubstitute(Strings opFlags, Strings opArgs) } +static void opClearSubstitutes(Strings opFlags, Strings opArgs) +{ + if (!opFlags.empty()) throw UsageError("unknown flag"); + if (!opArgs.empty()) + throw UsageError("no arguments expected"); + + clearSubstitutes(); +} + + + static void opValidPath(Strings opFlags, Strings opArgs) { if (!opFlags.empty()) throw UsageError("unknown flag"); @@ -354,6 +364,8 @@ void run(Strings args) op = opSuccessor; else if (arg == "--substitute") op = opSubstitute; + else if (arg == "--clear-substitutes") + op = opClearSubstitutes; else if (arg == "--validpath") op = opValidPath; else if (arg == "--isvalid") |