aboutsummaryrefslogtreecommitdiff
path: root/src/libcmd
diff options
context:
space:
mode:
authorJohn Ericson <John.Ericson@Obsidian.Systems>2022-05-12 20:10:02 +0000
committerJohn Ericson <John.Ericson@Obsidian.Systems>2022-05-12 20:10:02 +0000
commit49ad315c0357116787ef45a1249009b6bc00301f (patch)
tree30fe74db8018feab10f2cd4616c91d605bbd93a0 /src/libcmd
parentb18720ee175d6c019be964955efc1633be1c434d (diff)
Use `^` not `!` in indexed store derivations installable syntax
Match the other syntax that was recently added
Diffstat (limited to 'src/libcmd')
-rw-r--r--src/libcmd/installables.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc
index e0a95118d..575e7f696 100644
--- a/src/libcmd/installables.cc
+++ b/src/libcmd/installables.cc
@@ -799,11 +799,12 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
for (auto & s : ss) {
std::exception_ptr ex;
- if (s.rfind('!') != std::string::npos) {
+ auto found = s.rfind('^');
+ if (found != std::string::npos) {
try {
result.push_back(std::make_shared<InstallableIndexedStorePath>(
store,
- DerivedPath::Built::parse(*store, s)));
+ DerivedPath::Built::parse(*store, s.substr(0, found), s.substr(found + 1))));
settings.requireExperimentalFeature(Xp::ComputedDerivations);
continue;
} catch (BadStorePath &) {
@@ -813,7 +814,8 @@ std::vector<std::shared_ptr<Installable>> SourceExprCommand::parseInstallables(
}
}
- if (s.find('/') != std::string::npos) {
+ found = s.find('/');
+ if (found != std::string::npos) {
try {
result.push_back(std::make_shared<InstallableStorePath>(store, store->followLinksToStorePath(s)));
continue;