aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-01-06 23:32:33 +0000
committerAvatar Danny van Dyk <dvandyk@exherbo.org> 2007-01-06 23:32:33 +0000
commit6ccbb59a86acef238e1aa173fdb6b585bbc488d3 (patch)
treeaa2d98ad5ecf221b4169417cf1be9674358563d7
parent21c2e7184a172f4ce049d99fd5dcee0a77824828 (diff)
downloadpaludis-6ccbb59a86acef238e1aa173fdb6b585bbc488d3.tar.gz
paludis-6ccbb59a86acef238e1aa173fdb6b585bbc488d3.tar.xz
Initial tidy up for bundles.
-rw-r--r--cran/cran.bash8
-rw-r--r--paludis/repositories/cran/cran_description.cc21
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc29
-rw-r--r--paludis/repositories/cran/cran_repository.cc16
-rw-r--r--paludis/version_metadata.cc3
-rw-r--r--paludis/version_metadata.sr2
-rw-r--r--src/clients/paludis/query.cc2
7 files changed, 68 insertions, 13 deletions
diff --git a/cran/cran.bash b/cran/cran.bash
index 3baf2e1..04e0925 100644
--- a/cran/cran.bash
+++ b/cran/cran.bash
@@ -126,19 +126,23 @@ cran_do_install() {
# \todo Sandbox this?
R CMD INSTALL -l "${IMAGE}/${PALUDIS_CRAN_LIBRARY##${ROOT}}" ${PN}
+
+ if [[ ${IS_BUNDLE} == "yes" ]] ; then
+ cp "${PN}/DESCRIPTION" "${IMAGE}/${PALUDIS_CRAN_LIBRARY##${ROOT}}/paludis/bundles/"
+ fi
}
cran_do_merge() {
[[ -e "${IMAGE}/${INSTALL_TO##${ROOT}}/R.css" ]] \
&& rm -f "${IMAGE}/${PALUDIS_CRAN_LIBRARY##${ROOT}}/R.css"
mkdir -p "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}"
- ${PALUDIS_EBUILD_DIR}/utils/merge "${IMAGE}" "${ROOT}" "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}/CONTENTS"
+ ${PALUDIS_EBUILD_DIR}/merge "${IMAGE}" "${ROOT}" "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}/CONTENTS"
echo ${REPOSITORY} > "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}/REPOSITORY"
}
cran_do_unmerge() {
[[ -e "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}/CONTENTS" ]] || die "CONTENTS file is missing for package ${PN}"
- ${PALUDIS_EBUILD_DIR}/utils/unmerge "${ROOT}" "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}/CONTENTS"
+ ${PALUDIS_EBUILD_DIR}/unmerge "${ROOT}" "${PALUDIS_CRAN_LIBRARY}/paludis/${PN}/CONTENTS"
}
for cmd in $* ; do
diff --git a/paludis/repositories/cran/cran_description.cc b/paludis/repositories/cran/cran_description.cc
index b831414..924724d 100644
--- a/paludis/repositories/cran/cran_description.cc
+++ b/paludis/repositories/cran/cran_description.cc
@@ -66,18 +66,21 @@ CRANDescription::CRANDescription(const std::string & n, const FSEntry & f) :
value = strip_leading(strip_trailing(line.substr(pos + 1), " \t\r\n"), " \t\r\n");
}
- if ("Package" == key)
+ if (("Package" == key) || ("Bundle" == key))
{
metadata->get_cran_interface()->package = value;
metadata->homepage = "http://cran.r-project.org/src/contrib/Descriptions/" + value + ".html";
- CRANDescription::normalise_name(value);
- if (n != value)
- Log::get_instance()->message(ll_warning, lc_context, "Inconsistent package name in file '" +
- stringify(name) + "': '" + n + "', '" + value + "':");
- }
- else if ("Bundle" == key)
- {
- metadata->get_cran_interface()->is_bundle = true;
+ if ("Package" == key)
+ {
+ CRANDescription::normalise_name(value);
+ if (n != value)
+ Log::get_instance()->message(ll_warning, lc_context, "Inconsistent package name in file '" +
+ stringify(name) + "': '" + n + "', '" + value + "':");
+ }
+ else
+ {
+ metadata->get_cran_interface()->is_bundle = true;
+ }
}
else if ("Version" == key)
{
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index 3879375..519a6dd 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -136,6 +136,35 @@ Implementation<CRANInstalledRepository>::load_entries() const
QualifiedPackageName q("cran/" + n);
metadata.insert(std::make_pair(std::make_pair(q, VersionSpec(desc.version)), desc.metadata));
}
+
+ if (! FSEntry(location / "paludis" / "bundles").is_directory())
+ return;
+
+ // Load Bundle Metadata
+ Log::get_instance()->message(ll_warning, lc_no_context, "Bundles start now REMOVE");
+ for (DirIterator f(location / "paludis" / "bundles"), f_end ; f != f_end ; ++f)
+ {
+ Context local_context("When parsing file '" + stringify(*f) + "'.");
+ Log::get_instance()->message(ll_warning, lc_no_context, "REMOVE Bundle: " + strinfify(*f));
+
+ if (! f.is_regular_file())
+ {
+ continue;
+ }
+
+ std::string n(f->basename());
+ std::string::size_type pos(n.find_last_of("."));
+ if (std::string::npos != pos)
+ n.erase(pos);
+ CRANDescription::normalise_name(n);
+
+ CRANDescription desc(n, f);
+ entries.push_back(desc);
+
+ QualifiedPackageName q("cran/" + n);
+ metadata.insert(std::make_pair(std::make_pair(q, VersionSpec(desc.version)), desc.metadata));
+ }
+
}
catch (...)
{
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index de699db..ccaa95f 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -365,7 +365,7 @@ CRANRepository::need_packages() const
for ( ; i != i_end ; ++i)
{
Context c("When processing 'Contains:' line: '" + stringify(*i) + "':");
-
+ Log::get_instance()->message(ll_warning, lc_no_context, "Contains: " + stringify(*i));
if (*i == last_package_name)
continue;
@@ -378,6 +378,7 @@ CRANRepository::need_packages() const
else
dep += "," + pkg;
d.metadata->deps.build_depend_string = dep;
+ d.metadata->get_cran_interface()->is_bundle_member = true;
_imp->package_names[d.name] = true;
_imp->metadata.insert(std::make_pair(std::make_pair(d.name, d.version), d.metadata));
@@ -421,6 +422,7 @@ CRANRepository::do_version_metadata(
if (d.is_regular_file())
{
+ Log::get_instance()->message(ll_warning, lc_no_context, "do_version_metadata: " + stringify(p));
CRANDescription desc(stringify(p), d);
result = desc.metadata;
}
@@ -505,6 +507,16 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
PackageNamePart pn(q.package);
CategoryNamePart c("cran");
VersionMetadata::ConstPointer vm(do_version_metadata(q, vn));
+
+ if (vm->get_cran_interface()->is_bundle_member)
+ {
+ MakeEnvCommand cmd(LIBEXECDIR "/paludis/cran.bash skip", "");
+ cmd = cmd("CATEGORY", "cran");
+ cmd = cmd("PN", stringify(pn));
+ cmd = cmd("PV", stringify(vn));
+ return;
+ }
+
std::string p(vm->get_cran_interface()->package);
std::string v(vm->get_cran_interface()->version);
@@ -534,6 +546,8 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
cmd = cmd("DISTDIR", stringify(_imp->distdir));
cmd = cmd("DISTFILE", std::string(p + "_" + v + ".tar.gz"));
cmd = cmd("IMAGE", image);
+ cmd = cmd("IS_BUNDLE", (vm->get_cran_interface()->is_bundle() ? "yes" : ""));
+ cmd = cmd("LOCATION", stringify(_imp->location));
cmd = cmd("PN", stringify(pn));
cmd = cmd("PV", stringify(vn));
cmd = cmd("PALUDIS_CRAN_LIBRARY", stringify(_imp->library));
diff --git a/paludis/version_metadata.cc b/paludis/version_metadata.cc
index fce66bb..f8e2fa5 100644
--- a/paludis/version_metadata.cc
+++ b/paludis/version_metadata.cc
@@ -62,7 +62,8 @@ VersionMetadata::CRAN::CRAN(ParserFunction f) :
.keywords("")
.package("")
.version("")
- .is_bundle(false))
+ .is_bundle(false)
+ .is_bundle_member(false))
{
}
diff --git a/paludis/version_metadata.sr b/paludis/version_metadata.sr
index c7de2ca..99285d8 100644
--- a/paludis/version_metadata.sr
+++ b/paludis/version_metadata.sr
@@ -119,6 +119,8 @@ make_class_CRANVersionMetadata()
key package std::string
key version std::string
key is_bundle bool
+ key is_bundle_member bool
+
allow_named_args
diff --git a/src/clients/paludis/query.cc b/src/clients/paludis/query.cc
index 38e3c07..8e00523 100644
--- a/src/clients/paludis/query.cc
+++ b/src/clients/paludis/query.cc
@@ -191,6 +191,8 @@ void do_one_package_query(
" " << metadata->get_cran_interface()->version << endl;
cout << " " << std::setw(22) << std::left << "IS_BUNDLE:" << std::setw(0) <<
" " << std::boolalpha << metadata->get_cran_interface()->is_bundle << endl;
+ cout << " " << std::setw(22) << std::left << "IS_BUNDLE_MEMBER:" << std::setw(0) <<
+ " " << std::boolalpha << metadata->get_cran_interface()->is_bundle_member << endl;
}
if (metadata->get_ebuild_interface())