From f47cd0fc88306b0d635bb0c96cb4953c53a75254 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Tue, 3 Dec 2024 20:38:41 +0100 Subject: [PATCH] libcmd, libexpr: remove dead code Change-Id: I555d81bd78770dd1b773c1e90f1a41779fccad7f --- lix/libcmd/installable-flake.cc | 14 -------------- lix/libcmd/installable-flake.hh | 2 -- lix/libexpr/get-drvs.cc | 15 --------------- lix/libexpr/get-drvs.hh | 1 - 4 files changed, 32 deletions(-) diff --git a/lix/libcmd/installable-flake.cc b/lix/libcmd/installable-flake.cc index 27c4efc35..06ca7d39a 100644 --- a/lix/libcmd/installable-flake.cc +++ b/lix/libcmd/installable-flake.cc @@ -41,20 +41,6 @@ std::vector InstallableFlake::getActualAttrPaths() return res; } -Value * InstallableFlake::getFlakeOutputs(const flake::LockedFlake & lockedFlake) -{ - auto vFlake = state->mem.allocValue(); - - callFlake(*state, lockedFlake, *vFlake); - - auto aOutputs = vFlake->attrs->get(state->symbols.create("outputs")); - assert(aOutputs); - - state->forceValue(*aOutputs->value, aOutputs->value->determinePos(noPos)); - - return aOutputs->value; -} - static std::string showAttrPaths(const std::vector & paths) { std::string s; diff --git a/lix/libcmd/installable-flake.hh b/lix/libcmd/installable-flake.hh index 8e74d1533..555e94394 100644 --- a/lix/libcmd/installable-flake.hh +++ b/lix/libcmd/installable-flake.hh @@ -52,8 +52,6 @@ struct InstallableFlake : InstallableValue std::vector getActualAttrPaths(); - Value * getFlakeOutputs(const flake::LockedFlake & lockedFlake); - DerivedPathsWithInfo toDerivedPaths() override; std::pair toValue() override; diff --git a/lix/libexpr/get-drvs.cc b/lix/libexpr/get-drvs.cc index 59c30985c..d146ff6ee 100644 --- a/lix/libexpr/get-drvs.cc +++ b/lix/libexpr/get-drvs.cc @@ -316,21 +316,6 @@ NixInt DrvInfo::queryMetaInt(const std::string & name, NixInt def) return def; } -NixFloat DrvInfo::queryMetaFloat(const std::string & name, NixFloat def) -{ - Value * v = queryMeta(name); - if (!v) return def; - if (v->type() == nFloat) return v->fpoint; - if (v->type() == nString) { - /* Backwards compatibility with before we had support for - float meta fields. */ - if (auto n = string2Float(v->string.s)) - return *n; - } - return def; -} - - bool DrvInfo::queryMetaBool(const std::string & name, bool def) { Value * v = queryMeta(name); diff --git a/lix/libexpr/get-drvs.hh b/lix/libexpr/get-drvs.hh index 08bd75503..c34de39be 100644 --- a/lix/libexpr/get-drvs.hh +++ b/lix/libexpr/get-drvs.hh @@ -64,7 +64,6 @@ public: Value * queryMeta(const std::string & name); std::string queryMetaString(const std::string & name); NixInt queryMetaInt(const std::string & name, NixInt def); - NixFloat queryMetaFloat(const std::string & name, NixFloat def); bool queryMetaBool(const std::string & name, bool def); void setMeta(const std::string & name, Value * v);