aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-07 20:40:11 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-11 14:58:00 +0100
commite33b42581b34c05351abf817d2b7c9cca3075865 (patch)
tree2a24a998110bb2c0c4a137afc8c5800150809cac
parent6ee67af5c2c4d38b2b21898c6790c180c99da036 (diff)
downloadpaludis-e33b42581b34c05351abf817d2b7c9cca3075865.tar.gz
paludis-e33b42581b34c05351abf817d2b7c9cca3075865.tar.xz
dodoc -r, doins -r symlinks for EAPI 3
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc20
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh70
-rw-r--r--paludis/repositories/e/eapi.cc2
-rw-r--r--paludis/repositories/e/eapi.hh4
-rw-r--r--paludis/repositories/e/eapis/0.conf2
-rw-r--r--paludis/repositories/e/eapis/3.conf3
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf2
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc4
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/dodoc20
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/doins9
11 files changed, 134 insertions, 4 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 1162129..6f531de 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1657,6 +1657,26 @@ namespace test_cases
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("dodoc -r", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/dodoc-r-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("doins -r symlink", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doins-r-symlink-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_3;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 9588f18..1bcb3c5 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1294,6 +1294,76 @@ src_install() {
docompress bar || die
}
END
+mkdir -p "cat/dodoc-r" || exit 1
+cat << 'END' > cat/dodoc-r/dodoc-r-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ mkdir one two three
+ echo foo > one/first
+ echo foo > two/second
+ echo foo > four
+ mkdir dot
+ mkdir dot/five
+ echo foo > dot/five/fifth
+}
+
+src_install() {
+ dodoc -r one two three four
+ cd dot
+ dodoc -r .
+}
+
+pkg_preinst() {
+ [[ -e ${D}/usr/share/doc/${PF}/one/first ]] || die one/first
+ [[ -e ${D}/usr/share/doc/${PF}/two/second ]] || die two/second
+ [[ -e ${D}/usr/share/doc/${PF}/four ]] || die four
+ [[ -e ${D}/usr/share/doc/${PF}/five/fifth ]] || die five/fifth
+}
+END
+mkdir -p "cat/doins-r-symlink" || exit 1
+cat << 'END' > cat/doins-r-symlink/doins-r-symlink-3.ebuild || exit 1
+EAPI="${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+src_unpack() {
+ mkdir -p ${WORKDIR}
+ cd "${WORKDIR}"
+
+ echo foo > foo
+ ln -s foo bar
+}
+
+src_install() {
+ insinto /foo
+ doins -r .
+}
+
+pkg_preinst() {
+ find ${D} | xargs -n1 ls -ldh
+ [[ -f ${D}/foo/foo ]] || die foo
+ [[ -L ${D}/foo/bar ]] || die bar
+ [[ $(readlink ${D}/foo/bar ) == foo ]] || die sym
+}
+END
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index d14a7e8..c2ef7d9 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -207,6 +207,8 @@ namespace
std::tr1::shared_ptr<const EAPIToolsOptions> make_tool_options(const KeyValueConfigFile & k)
{
return make_shared_ptr(new EAPIToolsOptions(make_named_values<EAPIToolsOptions>(
+ value_for<n::dodoc_r>(destringify_key<bool>(k, "dodoc_r")),
+ value_for<n::doins_r_symlink>(destringify_key<bool>(k, "doins_r_symlink")),
value_for<n::doman_lang_filenames>(destringify_key<bool>(k, "doman_lang_filenames")),
value_for<n::dosym_mkdir>(destringify_key<bool>(k, "dosym_mkdir")),
value_for<n::failure_is_fatal>(destringify_key<bool>(k, "failure_is_fatal")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 4a77e49..b470117 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -54,6 +54,8 @@ namespace paludis
struct description_use;
struct directory_if_exists_variables;
struct directory_variables;
+ struct dodoc_r;
+ struct doins_r_symlink;
struct doman_lang_filenames;
struct dosym_mkdir;
struct eapi;
@@ -378,6 +380,8 @@ namespace paludis
struct EAPIToolsOptions
{
+ NamedValue<n::dodoc_r, bool> dodoc_r;
+ NamedValue<n::doins_r_symlink, bool> doins_r_symlink;
NamedValue<n::doman_lang_filenames, bool> doman_lang_filenames;
NamedValue<n::dosym_mkdir, bool> dosym_mkdir;
NamedValue<n::failure_is_fatal, bool> failure_is_fatal;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index b500917..2b49e00 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -254,6 +254,8 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = true
doman_lang_filenames = false
+dodoc_r = false
+doins_r_symlink = false
dosym_mkdir = true
failure_is_fatal = false
diff --git a/paludis/repositories/e/eapis/3.conf b/paludis/repositories/e/eapis/3.conf
index b5a49d0..ee7e041 100644
--- a/paludis/repositories/e/eapis/3.conf
+++ b/paludis/repositories/e/eapis/3.conf
@@ -33,3 +33,6 @@ utility_path_suffixes = 3 2 1 0
ebuild_pretend = \
skipname=pretend skipifno=pretend sandbox userpriv : pretend
+dodoc_r = true
+doins_r_symlink = true
+
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 582a79e..3c2e934 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -307,7 +307,9 @@ pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = true
unpack_fix_permissions = false
doman_lang_filenames = true
+dodoc_r = false
dosym_mkdir = false
+doins_r_symlink = false
failure_is_fatal = true
unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma lzma 7z,7Z tar.xz xz
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index ccbfb58..9ae00a6 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -266,7 +266,9 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = false
doman_lang_filenames = true
+dodoc_r = false
dosym_mkdir = false
+doins_r_symlink = false
failure_is_fatal = false
unpack_suffixes = tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,jar gz,Z,z bz2 rar,RAR lha,LHa,LHA,lzh a,deb tar.lzma lzma 7z,7Z tar.xz xz
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 64463c4..64fda66 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -201,6 +201,10 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_SUFFIXES",
params.package_id()->eapi()->supported()->tools_options()->unpack_suffixes())
+ .with_setenv("PALUDIS_DODOC_R",
+ params.package_id()->eapi()->supported()->tools_options()->dodoc_r() ? "yes" : "")
+ .with_setenv("PALUDIS_DOINS_R_SYMLINK",
+ params.package_id()->eapi()->supported()->tools_options()->doins_r_symlink() ? "yes" : "")
.with_setenv("PALUDIS_DOMAN_LANG_FILENAMES",
params.package_id()->eapi()->supported()->tools_options()->doman_lang_filenames() ? "yes" : "")
.with_setenv("PALUDIS_DOSYM_NO_MKDIR",
diff --git a/paludis/repositories/e/ebuild/utils/dodoc b/paludis/repositories/e/ebuild/utils/dodoc
index 00b64de..35d1472 100755
--- a/paludis/repositories/e/ebuild/utils/dodoc
+++ b/paludis/repositories/e/ebuild/utils/dodoc
@@ -2,7 +2,7 @@
# vim: set sw=4 sts=4 et :
# Copyright (c) 2006 Stephen Bennett
-# Copyright (c) 2007 Ciaran McCreesh
+# Copyright (c) 2007, 2009 Ciaran McCreesh
#
# Based in part upon dodoc from Portage, which is Copyright 1995-2005
# Gentoo Foundation and distributed under the terms of the GNU General
@@ -28,6 +28,15 @@ if [[ ! -d ${!PALUDIS_IMAGE_DIR_VAR} ]]; then
paludis_die_or_error "\${${PALUDIS_IMAGE_DIR_VAR}} not valid; aborting"
fi
+recurse=false
+
+if [[ -n ${PALUDIS_DODOC_R} ]] ; then
+ if [[ $1 == "-r" ]] ; then
+ shift
+ recurse=true
+ fi
+fi
+
if [[ $# -lt 1 ]]; then
paludis_die_or_error "at least one argument needed"
fi
@@ -40,7 +49,13 @@ fi
ret=0
for x in "$@"; do
- if [[ -s "${x}" ]]; then
+ if $recurse && [[ -d "${x}" ]] ; then
+ (
+ export DOCDESTTREE="${DOCDESTTREE}/${x}"
+ cd "${x}"
+ ls * >/dev/null 2>&1 && dodoc -r *
+ )
+ elif [[ -s "${x}" ]]; then
install -m0644 "${x}" "${dir}"
elif [[ ! -e "${x}" ]]; then
echo "${0}: ${x} does not exist" >&2
@@ -50,3 +65,4 @@ done
[[ 0 != "${ret}" ]] && paludis_die_or_error "dodoc returned error ${ret}"
exit ${ret}
+
diff --git a/paludis/repositories/e/ebuild/utils/doins b/paludis/repositories/e/ebuild/utils/doins
index b39c07d..f1fe6b9 100755
--- a/paludis/repositories/e/ebuild/utils/doins
+++ b/paludis/repositories/e/ebuild/utils/doins
@@ -63,8 +63,13 @@ ret=0
for x in "$@"; do
if [[ -L ${x} ]]; then
- cp "${x}" "${!PALUDIS_TEMP_DIR_VAR}"
- mysrc="${!PALUDIS_TEMP_DIR_VAR}/$(basename "${x}")"
+ if [[ -n ${PALUDIS_DOINS_R_SYMLINK} ]] && [[ -n "${DOINSRECUR}" ]] ; then
+ ln -s "$(readlink ${x} )" "${!PALUDIS_IMAGE_DIR_VAR}${INSDESTTREE}/${x}"
+ continue
+ else
+ cp "${x}" "${!PALUDIS_TEMP_DIR_VAR}"
+ mysrc="${!PALUDIS_TEMP_DIR_VAR}/$(basename "${x}")"
+ fi
elif [[ -d ${x} ]]; then
if [[ ${DOINSRECUR} == "n" ]]; then
continue