build-remote: fix format string shenanigans
HintFmt(string) invokes the HintFmt("%s", literal) constructor, which is not what we want here. Add a constructor with a proper name and call that. Next step: rename all the other ones to HintFmt::literal(string). Fixes: https://git.lix.systems/lix-project/lix/issues/178 Change-Id: If52d2eb8864ceb8663e05992e9d1fffef573d6b8
This commit is contained in:
parent
73624f7d9c
commit
a69f6e185a
2 changed files with 5 additions and 1 deletions
|
@ -202,7 +202,7 @@ static int main_build_remote(int argc, char * * argv)
|
||||||
else
|
else
|
||||||
drvstr = "<unknown>";
|
drvstr = "<unknown>";
|
||||||
|
|
||||||
auto error = HintFmt(errorText);
|
auto error = HintFmt::fromFormatString(errorText);
|
||||||
error
|
error
|
||||||
% drvstr
|
% drvstr
|
||||||
% neededSystem
|
% neededSystem
|
||||||
|
|
|
@ -141,6 +141,10 @@ public:
|
||||||
: HintFmt("%s", Uncolored(literal))
|
: HintFmt("%s", Uncolored(literal))
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
static HintFmt fromFormatString(const std::string & format) {
|
||||||
|
return HintFmt(boost::format(format));
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interpolate the given arguments into the format string.
|
* Interpolate the given arguments into the format string.
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in a new issue