aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-01 12:21:11 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-01 12:21:11 +0100
commita1f798a4945b1ae8fcf642698ec6009c3971b2e5 (patch)
tree7c5fabd4683fe1ded9c196df154aa324fd1facf5
parent76dc1cfafcb9e97972693f2574f06934c5f4b0e8 (diff)
downloadpaludis-a1f798a4945b1ae8fcf642698ec6009c3971b2e5.tar.gz
paludis-a1f798a4945b1ae8fcf642698ec6009c3971b2e5.tar.xz
preserve_work by default for unpackaged
-rw-r--r--paludis/elike_choices.cc11
-rw-r--r--paludis/elike_choices.hh16
-rw-r--r--paludis/repositories/e/ebuild_id.cc2
-rw-r--r--paludis/repositories/unpackaged/unpackaged_key.cc2
4 files changed, 26 insertions, 5 deletions
diff --git a/paludis/elike_choices.cc b/paludis/elike_choices.cc
index 6e35cdf..0c42970 100644
--- a/paludis/elike_choices.cc
+++ b/paludis/elike_choices.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -550,6 +550,15 @@ ELikePreserveWorkChoiceValue::ELikePreserveWorkChoiceValue(const std::tr1::share
{
}
+ELikePreserveWorkChoiceValue::ELikePreserveWorkChoiceValue(const std::tr1::shared_ptr<const PackageID> & id,
+ const Environment * const env, const std::tr1::shared_ptr<const Choice> & choice,
+ const bool by_default) :
+ _enabled(by_default ?
+ ! env->want_choice_enabled(id, choice, canonical_unprefixed_name()).is_false() :
+ env->want_choice_enabled(id, choice, canonical_unprefixed_name()).is_true())
+{
+}
+
const UnprefixedChoiceName
ELikePreserveWorkChoiceValue::unprefixed_name() const
{
diff --git a/paludis/elike_choices.hh b/paludis/elike_choices.hh
index 21948af..992e6be 100644
--- a/paludis/elike_choices.hh
+++ b/paludis/elike_choices.hh
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2008, 2009 Ciaran McCreesh
+ * Copyright (c) 2008, 2009, 2010 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -197,8 +197,20 @@ namespace paludis
const bool _enabled;
public:
+ /**
+ * \deprecated \since 0.48.1 Use the four argument form.
+ */
ELikePreserveWorkChoiceValue(const std::tr1::shared_ptr<const PackageID> &,
- const Environment * const env, const std::tr1::shared_ptr<const Choice> &);
+ const Environment * const env, const std::tr1::shared_ptr<const Choice> &) PALUDIS_ATTRIBUTE((deprecated));
+
+ /**
+ * \since 0.48.1
+ */
+ ELikePreserveWorkChoiceValue(
+ const std::tr1::shared_ptr<const PackageID> &,
+ const Environment * const env,
+ const std::tr1::shared_ptr<const Choice> &,
+ const bool enabled_by_default);
virtual const UnprefixedChoiceName unprefixed_name() const PALUDIS_ATTRIBUTE((warn_unused_result));
virtual const ChoiceNameWithPrefix name_with_prefix() const PALUDIS_ATTRIBUTE((warn_unused_result));
diff --git a/paludis/repositories/e/ebuild_id.cc b/paludis/repositories/e/ebuild_id.cc
index 82b5013..d597554 100644
--- a/paludis/repositories/e/ebuild_id.cc
+++ b/paludis/repositories/e/ebuild_id.cc
@@ -1435,7 +1435,7 @@ EbuildID::add_build_options(const std::tr1::shared_ptr<Choices> & choices) const
/* preserve_work */
build_options->add(make_shared_ptr(new ELikePreserveWorkChoiceValue(
- shared_from_this(), _imp->environment, build_options)));
+ shared_from_this(), _imp->environment, build_options, false)));
/* jobs */
if (! eapi()->supported()->ebuild_environment_variables()->env_jobs().empty())
diff --git a/paludis/repositories/unpackaged/unpackaged_key.cc b/paludis/repositories/unpackaged/unpackaged_key.cc
index de888f4..1f29628 100644
--- a/paludis/repositories/unpackaged/unpackaged_key.cc
+++ b/paludis/repositories/unpackaged/unpackaged_key.cc
@@ -174,7 +174,7 @@ UnpackagedChoicesKey::value() const
)));
build_options->add(make_shared_ptr(new ELikeSplitChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options)));
build_options->add(make_shared_ptr(new ELikeStripChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options)));
- build_options->add(make_shared_ptr(new ELikePreserveWorkChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options)));
+ build_options->add(make_shared_ptr(new ELikePreserveWorkChoiceValue(_imp->id->shared_from_this(), _imp->env, build_options, true)));
_imp->value->add(build_options);
}