aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-05 15:31:54 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-06-05 15:31:54 +0000
commit0a61058949ee2080351ae7c4fa63129f8c0c5d09 (patch)
treef6cc0e071a69c1de34cea33abb35dd952f563770
parent816a31996697da580a8b1dde7c538c531f21afc9 (diff)
downloadpaludis-0a61058949ee2080351ae7c4fa63129f8c0c5d09.tar.gz
paludis-0a61058949ee2080351ae7c4fa63129f8c0c5d09.tar.xz
Stop hardcoding BIGTEMPDIR. Make the build directory a repository configuration parameter (buildroot) instead.
-rw-r--r--paludis/Makefile.am.m43
-rw-r--r--paludis/ebuild.cc6
-rw-r--r--paludis/ebuild.hh4
-rw-r--r--paludis/portage_repository.cc21
-rw-r--r--paludis/portage_repository.hh4
-rw-r--r--paludis/vdb_repository.cc7
-rw-r--r--src/Makefile.am3
-rw-r--r--src/paludis.cc1
8 files changed, 34 insertions, 15 deletions
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index 8eeebb9..3fa759c 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -37,8 +37,7 @@ AM_CXXFLAGS = -I$(top_srcdir)
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
- -DDATADIR=\"$(datadir)\" \
- -DBIGTEMPDIR=\"/var/tmp\"
+ -DDATADIR=\"$(datadir)\"
EXTRA_DIST = about.hh.in Makefile.am.m4 paludis.hh.m4 files.m4 \
hashed_containers.hh.in testscriptlist
SUBDIRS = util . args qa
diff --git a/paludis/ebuild.cc b/paludis/ebuild.cc
index 641b604..10091aa 100644
--- a/paludis/ebuild.cc
+++ b/paludis/ebuild.cc
@@ -90,7 +90,7 @@ EbuildCommand::operator() ()
("ECLASSDIR", stringify(params.get<ecpk_eclass_dir>()))
("PORTDIR", stringify(params.get<ecpk_portdir>()))
("DISTDIR", stringify(params.get<ecpk_distdir>()))
- ("PALUDIS_TMPDIR", BIGTEMPDIR "/paludis/")
+ ("PALUDIS_TMPDIR", stringify(params.get<ecpk_buildroot>()))
("PALUDIS_CONFIG_DIR", SYSCONFDIR "/paludis/")
("PALUDIS_BASHRC_FILES", params.get<ecpk_environment>()->bashrc_files())
("PALUDIS_HOOK_DIRS", params.get<ecpk_environment>()->hook_dirs())
@@ -111,7 +111,7 @@ EbuildCommand::add_portage_vars(const MakeEnvCommand & cmd) const
return cmd
("PORTAGE_ACTUAL_DISTDIR", stringify(params.get<ecpk_distdir>()))
("PORTAGE_BASHRC", "/dev/null")
- ("PORTAGE_BUILDDIR", BIGTEMPDIR "/paludis/" +
+ ("PORTAGE_BUILDDIR", stringify(params.get<ecpk_buildroot>()) + "/" +
stringify(params.get<ecpk_db_entry>()->get<pde_name>().get<qpn_category>()) + "/" +
stringify(params.get<ecpk_db_entry>()->get<pde_name>().get<qpn_package>()) + "-" +
stringify(params.get<ecpk_db_entry>()->get<pde_version>()))
@@ -121,7 +121,7 @@ EbuildCommand::add_portage_vars(const MakeEnvCommand & cmd) const
("PORTAGE_INST_UID", "0")
("PORTAGE_MASTER_PID", stringify(::getpid()))
("PORTAGE_NICENCESS", stringify(::getpriority(PRIO_PROCESS, 0)))
- ("PORTAGE_TMPDIR", BIGTEMPDIR)
+ ("PORTAGE_TMPDIR", stringify(params.get<ecpk_buildroot>()))
("PORTAGE_TMPFS", "/dev/shm")
("PORTAGE_WORKDIR_MODE", "0700");
}
diff --git a/paludis/ebuild.hh b/paludis/ebuild.hh
index 4ab87c8..9299fbe 100644
--- a/paludis/ebuild.hh
+++ b/paludis/ebuild.hh
@@ -52,6 +52,7 @@ namespace paludis
ecpk_eclass_dir,
ecpk_portdir,
ecpk_distdir,
+ ecpk_buildroot,
last_ecpk
};
@@ -74,7 +75,8 @@ namespace paludis
SmartRecordKey<ecpk_files_dir, const FSEntry>,
SmartRecordKey<ecpk_eclass_dir, const FSEntry>,
SmartRecordKey<ecpk_portdir, const FSEntry>,
- SmartRecordKey<ecpk_distdir, const FSEntry>
+ SmartRecordKey<ecpk_distdir, const FSEntry>,
+ SmartRecordKey<ecpk_buildroot, const FSEntry>
{
};
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 17777ef..243ff76 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -151,6 +151,9 @@ namespace paludis
/// Root location
FSEntry root;
+ /// Build root
+ FSEntry buildroot;
+
/// Have we loaded our category names?
mutable bool has_category_names;
@@ -259,6 +262,7 @@ Implementation<PortageRepository>::Implementation(const PortageRepositoryParams
sync(p.get<prpk_sync>()),
sync_exclude(p.get<prpk_sync_exclude>()),
root(p.get<prpk_root>()),
+ buildroot(p.get<prpk_buildroot>()),
has_category_names(false),
has_repo_mask(false),
has_virtuals(false),
@@ -536,6 +540,7 @@ PortageRepository::PortageRepository(const PortageRepositoryParams & p) :
_info.insert(std::make_pair(std::string("newsdir"), stringify(_imp->newsdir)));
_info.insert(std::make_pair(std::string("format"), std::string("portage")));
_info.insert(std::make_pair(std::string("root"), stringify(_imp->root)));
+ _info.insert(std::make_pair(std::string("buildroot"), stringify(_imp->buildroot)));
if (! _imp->sync.empty())
_info.insert(std::make_pair(std::string("sync"), _imp->sync));
if (! _imp->sync_exclude.empty())
@@ -937,7 +942,8 @@ PortageRepository::do_version_metadata(
stringify(q.get<qpn_package>()) / "files"),
param<ecpk_eclass_dir>(_imp->eclassdir),
param<ecpk_portdir>(_imp->location),
- param<ecpk_distdir>(_imp->distdir)
+ param<ecpk_distdir>(_imp->distdir),
+ param<ecpk_buildroot>(_imp->buildroot)
)));
if (! cmd())
Log::get_instance()->message(ll_warning, "No usable metadata for '" + stringify(q)
@@ -1200,6 +1206,10 @@ PortageRepository::make_portage_repository(
if (m.end() == m.find("root") || ((root = m.find("root")->second)).empty())
root = "/";
+ std::string buildroot;
+ if (m.end() == m.find("buildroot") || ((buildroot = m.find("buildroot")->second)).empty())
+ buildroot = "/var/tmp/paludis";
+
return CountedPtr<Repository>(new PortageRepository(PortageRepositoryParams::create((
param<prpk_environment>(env),
param<prpk_package_database>(db),
@@ -1213,7 +1223,8 @@ PortageRepository::make_portage_repository(
param<prpk_newsdir>(newsdir),
param<prpk_sync>(sync),
param<prpk_sync_exclude>(sync_exclude),
- param<prpk_root>(root)))));
+ param<prpk_root>(root),
+ param<prpk_buildroot>(buildroot)))));
}
PortageRepositoryConfigurationError::PortageRepositoryConfigurationError(
@@ -1492,7 +1503,8 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
stringify(q.get<qpn_package>()) / "files"),
param<ecpk_eclass_dir>(_imp->eclassdir),
param<ecpk_portdir>(_imp->location),
- param<ecpk_distdir>(_imp->distdir)
+ param<ecpk_distdir>(_imp->distdir),
+ param<ecpk_buildroot>(_imp->buildroot)
)),
EbuildFetchCommandParams::create((
param<ecfpk_a>(archives),
@@ -1521,7 +1533,8 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
stringify(q.get<qpn_package>()) / "files"),
param<ecpk_eclass_dir>(_imp->eclassdir),
param<ecpk_portdir>(_imp->location),
- param<ecpk_distdir>(_imp->distdir)
+ param<ecpk_distdir>(_imp->distdir),
+ param<ecpk_buildroot>(_imp->buildroot)
)),
EbuildInstallCommandParams::create((
param<ecipk_use>(use),
diff --git a/paludis/portage_repository.hh b/paludis/portage_repository.hh
index b1c0400..9960c7c 100644
--- a/paludis/portage_repository.hh
+++ b/paludis/portage_repository.hh
@@ -58,6 +58,7 @@ namespace paludis
prpk_sync,
prpk_sync_exclude,
prpk_root,
+ prpk_buildroot,
last_prpk
};
@@ -82,7 +83,8 @@ namespace paludis
SmartRecordKey<prpk_newsdir, const FSEntry>,
SmartRecordKey<prpk_sync, const std::string>,
SmartRecordKey<prpk_sync_exclude, const std::string>,
- SmartRecordKey<prpk_root, const FSEntry>
+ SmartRecordKey<prpk_root, const FSEntry>,
+ SmartRecordKey<prpk_buildroot, const FSEntry>
{
};
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index d10c310..e3a441f 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -183,6 +183,9 @@ namespace paludis
/// Root location
FSEntry root;
+ /// Build root
+ FSEntry buildroot;
+
/// World file
FSEntry world_file;
@@ -220,6 +223,7 @@ Implementation<VDBRepository>::Implementation(const VDBRepositoryParams & p) :
env(p.get<vdbrpk_environment>()),
location(p.get<vdbrpk_location>()),
root(p.get<vdbrpk_root>()),
+ buildroot("/var/tmp/paludis"),
world_file(p.get<vdbrpk_world>()),
entries_valid(false),
has_provide_map(false)
@@ -733,7 +737,8 @@ VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec &
(stringify(q.get<qpn_package>()) + "-" + stringify(v))),
param<ecpk_portdir>(_imp->location),
param<ecpk_distdir>(_imp->location / stringify(q.get<qpn_category>()) /
- (stringify(q.get<qpn_package>()) + "-" + stringify(v)))
+ (stringify(q.get<qpn_package>()) + "-" + stringify(v))),
+ param<ecpk_buildroot>(_imp->buildroot)
)),
EbuildUninstallCommandParams::create((
param<ecupk_root>(stringify(_imp->root) + "/"),
diff --git a/src/Makefile.am b/src/Makefile.am
index 807f55f..6734acf 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,7 @@
AM_CXXFLAGS = -I$(top_srcdir)
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
- -DLIBEXECDIR=\"$(libexecdir)\" \
- -DBIGTEMPDIR=\"/var/tmp\"
+ -DLIBEXECDIR=\"$(libexecdir)\"
SUBDIRS = . qualudis
bin_PROGRAMS = paludis
diff --git a/src/paludis.cc b/src/paludis.cc
index cfe2dc2..930598e 100644
--- a/src/paludis.cc
+++ b/src/paludis.cc
@@ -278,7 +278,6 @@ main(int argc, char *argv[])
cout << "LDFLAGS: " << PALUDIS_BUILD_LDFLAGS << endl;
cout << "SYSCONFDIR: " << SYSCONFDIR << endl;
cout << "LIBEXECDIR: " << LIBEXECDIR << endl;
- cout << "BIGTEMPDIR: " << BIGTEMPDIR << endl;
cout << "stdlib: "
#if defined(__GLIBCXX__)
# define XSTRINGIFY(x) #x