forked from lix-project/lix
nix-build: Fix !<output> handling
This was broken by 22a754c091
.
https://hydra.nixos.org/eval/1573669
This commit is contained in:
parent
887030f211
commit
d37dc71e3c
|
@ -64,7 +64,7 @@ std::optional<StorePath> Store::maybeParseStorePath(std::string_view path) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Store::isStorePath(const Path & path) const
|
bool Store::isStorePath(std::string_view path) const
|
||||||
{
|
{
|
||||||
return (bool) maybeParseStorePath(path);
|
return (bool) maybeParseStorePath(path);
|
||||||
}
|
}
|
||||||
|
|
|
@ -305,7 +305,7 @@ public:
|
||||||
|
|
||||||
/* Return true if ‘path’ is a store path, i.e. a direct child of
|
/* Return true if ‘path’ is a store path, i.e. a direct child of
|
||||||
the Nix store. */
|
the Nix store. */
|
||||||
bool isStorePath(const Path & path) const;
|
bool isStorePath(std::string_view path) const;
|
||||||
|
|
||||||
/* Chop off the parts after the top-level store name, e.g.,
|
/* Chop off the parts after the top-level store name, e.g.,
|
||||||
/nix/store/abcd-foo/bar => /nix/store/abcd-foo. */
|
/nix/store/abcd-foo/bar => /nix/store/abcd-foo. */
|
||||||
|
|
|
@ -295,7 +295,8 @@ static void _main(int argc, char * * argv)
|
||||||
try {
|
try {
|
||||||
absolute = canonPath(absPath(i), true);
|
absolute = canonPath(absPath(i), true);
|
||||||
} catch (Error & e) {};
|
} catch (Error & e) {};
|
||||||
if (store->isStorePath(absolute) && std::regex_match(absolute, std::regex(".*\\.drv(!.*)?")))
|
auto [path, outputNames] = parsePathWithOutputs(absolute);
|
||||||
|
if (store->isStorePath(path) && hasSuffix(path, ".drv"))
|
||||||
drvs.push_back(DrvInfo(*state, store, absolute));
|
drvs.push_back(DrvInfo(*state, store, absolute));
|
||||||
else
|
else
|
||||||
/* If we're in a #! script, interpret filenames
|
/* If we're in a #! script, interpret filenames
|
||||||
|
|
Loading…
Reference in a new issue