aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Stephen P. Bennett <spb@exherbo.org> 2006-04-01 16:56:00 +0000
committerAvatar Stephen P. Bennett <spb@exherbo.org> 2006-04-01 16:56:00 +0000
commite35134bc5eecaab91303503c209423df73ffad82 (patch)
tree5d9f9af843533dcf620081ec7df39084c6879b19
parentbf0e7d5685bd9e433992ab165de4829b3b1cefee (diff)
downloadpaludis-e35134bc5eecaab91303503c209423df73ffad82.tar.gz
paludis-e35134bc5eecaab91303503c209423df73ffad82.tar.xz
Make USE=blah paludis -i work. Evil perhaps, but useful.
-rw-r--r--paludis/default_environment.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index 6d4635e..496ab04 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -24,6 +24,7 @@
#include <paludis/package_database.hh>
#include <paludis/repository.hh>
#include <paludis/util/stringify.hh>
+#include <paludis/util/system.hh>
#include <vector>
using namespace paludis;
@@ -49,6 +50,13 @@ DefaultEnvironment::~DefaultEnvironment()
bool
DefaultEnvironment::query_use(const UseFlagName & f, const PackageDatabaseEntry * e) const
{
+ std::string env_use = " " + getenv_with_default("USE", "") + " ";
+
+ if (env_use.find(" " + f.data() + " ") != std::string::npos)
+ return true;
+ else if (env_use.find(" -" + f.data() + " ") != std::string::npos)
+ return false;
+
if (e)
{
UseFlagState s(use_unspecified);