aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-14 23:34:24 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-03-14 23:34:24 +0000
commit35a1f8412c59db53e8398ca19b1d0f394a317473 (patch)
treedd9fc82d1c173a6860d07b78963c83d58e455c1d
parentb3ef01b84fa830757897ef17e98424916a2c1210 (diff)
downloadpaludis-35a1f8412c59db53e8398ca19b1d0f394a317473.tar.gz
paludis-35a1f8412c59db53e8398ca19b1d0f394a317473.tar.xz
More install work
-rwxr-xr-xebuild/ebuild.bash2
-rw-r--r--ebuild/pkg_init.bash3
-rw-r--r--paludis/default_environment.cc2
-rw-r--r--paludis/portage_repository.cc37
-rw-r--r--paludis/portage_repository.hh4
-rw-r--r--paludis/qa/environment.cc2
-rw-r--r--paludis/repository.hh5
7 files changed, 45 insertions, 10 deletions
diff --git a/ebuild/ebuild.bash b/ebuild/ebuild.bash
index c47c67f..78f998d 100755
--- a/ebuild/ebuild.bash
+++ b/ebuild/ebuild.bash
@@ -50,6 +50,8 @@ EBUILD_MODULES_DIR=$(readlink -f $(dirname $0 ) )
[[ -d ${EBUILD_MODULES_DIR} ]] || die "${EBUILD_MODULES_DIR} is not a directory"
source /sbin/functions.sh || die "Couldn't source functions.sh"
+source /etc/make.globals || die "Couldn't source make.globals"
+source /etc/make.conf || die "Couldn't source make.conf"
ebuild_load_module()
{
diff --git a/ebuild/pkg_init.bash b/ebuild/pkg_init.bash
index 28da95e..7060664 100644
--- a/ebuild/pkg_init.bash
+++ b/ebuild/pkg_init.bash
@@ -30,6 +30,9 @@ pkg_init()
done
export WORKDIR="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/work"
+ if [[ -f "${WORKDIR}" ]] ; then
+ rm -fr "${WORKDIR}" || die "Couldn't clean out \$WORKDIR (\"${WORKDIR}\")"
+ fi
mkdir -p "${WORKDIR}" || die "Couldn't create \$WORKDIR (\"${WORKDIR}\")"
export T="${PALUDIS_TMPDIR}/${CATEGORY}/${PF}/temp"
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index 4c5a3d4..44dbf22 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -38,7 +38,7 @@ DefaultEnvironment::DefaultEnvironment() :
r_end(DefaultConfig::get_instance()->end_repositories()) ; r != r_end ; ++r)
package_database()->add_repository(
RepositoryMaker::get_instance()->find_maker(r->get<rce_format>())(
- package_database().raw_pointer(), r->get<rce_keys>()));
+ this, package_database().raw_pointer(), r->get<rce_keys>()));
/// \bug vdb
}
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index e07c9bb..870b0e1 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -20,6 +20,8 @@
#include "config.h"
#include <paludis/dep_atom.hh>
+#include <paludis/dep_atom_flattener.hh>
+#include <paludis/dep_parser.hh>
#include <paludis/hashed_containers.hh>
#include <paludis/config_file.hh>
#include <paludis/match_package.hh>
@@ -80,6 +82,9 @@ namespace paludis
/// Our owning db.
const PackageDatabase * const db;
+ /// Our owning env.
+ const Environment * const env;
+
/// Our base location.
FSEntry location;
@@ -139,7 +144,8 @@ namespace paludis
mutable MirrorSet mirrors;
/// Constructor.
- Implementation(const PackageDatabase * const d, const FSEntry & l, const FSEntry & p,
+ Implementation(const Environment * const,
+ const PackageDatabase * const d, const FSEntry & l, const FSEntry & p,
const FSEntry & c);
/// Destructor.
@@ -150,9 +156,11 @@ namespace paludis
};
}
-Implementation<PortageRepository>::Implementation(const PackageDatabase * const d,
+Implementation<PortageRepository>::Implementation(const Environment * const env,
+ const PackageDatabase * const d,
const FSEntry & l, const FSEntry & p, const FSEntry & c) :
db(d),
+ env(env),
location(l),
profile(p),
cache(c),
@@ -249,11 +257,12 @@ Implementation<PortageRepository>::add_profile(const FSEntry & f) const
}
}
-PortageRepository::PortageRepository(const PackageDatabase * const d,
+PortageRepository::PortageRepository(
+ const Environment * const e, const PackageDatabase * const d,
const FSEntry & location, const FSEntry & profile,
const FSEntry & cache) :
Repository(PortageRepository::fetch_repo_name(location)),
- PrivateImplementationPattern<PortageRepository>(new Implementation<PortageRepository>(
+ PrivateImplementationPattern<PortageRepository>(new Implementation<PortageRepository>(e,
d, location, profile, cache))
{
_info.insert(std::make_pair(std::string("location"), location));
@@ -781,6 +790,7 @@ PortageRepository::need_virtual_names() const
CountedPtr<Repository>
PortageRepository::make_portage_repository(
+ const Environment * const env,
const PackageDatabase * const db,
const std::map<std::string, std::string> & m)
{
@@ -799,7 +809,7 @@ PortageRepository::make_portage_repository(
if (m.end() == m.find("cache") || ((cache = m.find("cache")->second)).empty())
cache = location + "/metadata/cache";
- return CountedPtr<Repository>(new PortageRepository(db, location, profile, cache));
+ return CountedPtr<Repository>(new PortageRepository(env, db, location, profile, cache));
}
PortageRepositoryConfigurationError::PortageRepositoryConfigurationError(
@@ -887,8 +897,23 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
if (! has_version(q, v))
throw InternalError(PALUDIS_HERE, "TODO"); /// \todo fixme
+ VersionMetadata::ConstPointer metadata(version_metadata(q, v));
+
std::string archives;
- archives = "fluxbox-0.9.14.tar.bz2";
+ PackageDatabaseEntry e(q, v, name());
+ DepAtomFlattener f(_imp->env, &e,
+ DepParser::parse(metadata->get(vmk_src_uri),
+ DepParserPolicy<PlainTextDepAtom, false>::get_instance()));
+
+ for (DepAtomFlattener::Iterator ff(f.begin()), ff_end(f.end()) ; ff != ff_end ; ++ff)
+ {
+ std::string::size_type p((*ff)->text().rfind('/'));
+ if (std::string::npos == p)
+ archives.append((*ff)->text());
+ else
+ archives.append((*ff)->text().substr(p + 1));
+ archives.append(" ");
+ }
std::string cmd(
"env P='" + stringify(q.get<qpn_package>()) + "-" + stringify(v.remove_revision()) + "' " +
diff --git a/paludis/portage_repository.hh b/paludis/portage_repository.hh
index b576ebe..534e2e9 100644
--- a/paludis/portage_repository.hh
+++ b/paludis/portage_repository.hh
@@ -96,7 +96,8 @@ namespace paludis
/**
* Constructor.
*/
- PortageRepository(const PackageDatabase * const db,
+ PortageRepository(const Environment * const env,
+ const PackageDatabase * const db,
const FSEntry & location, const FSEntry & profile,
const FSEntry & cache);
@@ -104,6 +105,7 @@ namespace paludis
* Virtual constructor.
*/
static CountedPtr<Repository> make_portage_repository(
+ const Environment * const env,
const PackageDatabase * const db,
const std::map<std::string, std::string> &);
diff --git a/paludis/qa/environment.cc b/paludis/qa/environment.cc
index 27120e3..60ee8d0 100644
--- a/paludis/qa/environment.cc
+++ b/paludis/qa/environment.cc
@@ -36,7 +36,7 @@ QAEnvironment::QAEnvironment(const FSEntry & base) :
keys.insert(std::make_pair(std::string("profile"), stringify(base / "profiles" / "base")));
package_database()->add_repository(
- RepositoryMaker::get_instance()->find_maker("portage")(
+ RepositoryMaker::get_instance()->find_maker("portage")(this,
package_database().raw_pointer(), keys));
}
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 408cfc8..5bd842f 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -38,6 +38,8 @@
namespace paludis
{
+ class Environment;
+
/**
* A Repository provides a representation of a physical repository to a
* PackageDatabase.
@@ -395,7 +397,8 @@ namespace paludis
* Virtual constructor for repositories.
*/
typedef VirtualConstructor<std::string,
- Repository::Pointer (*) (const PackageDatabase * const, const std::map<std::string, std::string> &),
+ Repository::Pointer (*) (const Environment * const, const PackageDatabase * const,
+ const std::map<std::string, std::string> &),
virtual_constructor_not_found::ThrowException<NoSuchRepositoryTypeError> > RepositoryMaker;
}