aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-08-03 22:32:03 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-08-03 22:34:49 +0100
commitd7ee26456cc76bf76c0e77b23b1d7ba6967008a2 (patch)
tree940f067f89f383159782a110a2685fd198fc785a
parent77be16f5c2de2ebcd7ce78084755f83c522edc39 (diff)
downloadpaludis-d7ee26456cc76bf76c0e77b23b1d7ba6967008a2.tar.gz
paludis-d7ee26456cc76bf76c0e77b23b1d7ba6967008a2.tar.xz
Support foo.lang.N in man page filenames for doman (Gentoo#222439) and pick up some miscellaneous doman changes from Portage.
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc48
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh172
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/doman19
9 files changed, 241 insertions, 6 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index c795497..f7aa903 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1256,6 +1256,16 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("doman 0", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-0",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "0");
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("best version", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("=cat/best-version-0",
@@ -1363,6 +1373,16 @@ namespace test_cases
TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("doman 1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-1",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "1");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_1;
@@ -1456,6 +1476,16 @@ namespace test_cases
TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
}
+
+ {
+ TestMessageSuffix suffix("doman kdebuild-1", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-kdebuild-1",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "kdebuild-1");
+ id->perform_action(action);
+ }
}
} test_e_repository_install_eapi_kdebuild_1;
@@ -1938,6 +1968,24 @@ namespace test_cases
TEST_CHECK(id);
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("doman success", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-success-0",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
+ TestMessageSuffix suffix("doman failure", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/doman-failure-0",
+ &env, UserPackageDepSpecOptions()))))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
}
} test_e_repository_install_exheres_0;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 63969b8..3bcbe31 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -745,6 +745,111 @@ src_install() {
}
END
cp cat/econf-source/econf-source-{0,1}.ebuild || exit 1
+mkdir -p "cat/doman"
+cat <<END > cat/doman/doman-0.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ echo \${PF} >foo.1
+ mkdir dir
+ echo \${PF} >dir/foo.2
+ echo \${PF} >foo.2
+ echo \${PF} >foo.3x
+ echo \${PF} >foo.4.gz
+ echo \${PF} >foo.5f.bz2
+ echo \${PF} >foo.6.Z
+ echo \${PF} >foo.en.7
+ echo \${PF} >foo.en_GB.8
+ echo \${PF} >foo.e.9
+ echo \${PF} >foo.enn.n
+ echo \${PF} >foo.EN.1
+ echo \${PF} >foo.en-GB.2
+ echo \${PF} >foo.en_gb.3
+ echo \${PF} >foo.en_G.4
+ echo \${PF} >foo.en_GBB.5
+ echo \${PF} >foo.nonkey
+ touch foo.1x
+ echo \${PF} >bar.m
+ echo \${PF} >bar.monkey
+ echo \${PF} >baz.6
+ echo \${PF} >baz.en_US.7
+}
+
+src_install() {
+ doman foo.* dir/foo.* || die
+ doman bar.m && die
+ doman bar.monkey && die
+ doman bar.1 && die
+ doman -i18n=en_GB baz.* || die
+ keepdir /meh || die
+ cd "\${D}"/meh || die
+ doman .keep* || die
+ rm "\${D}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
+ rm "\${D}"/usr/share/man/{man6/foo.6.Z,man7/foo.en.7,man8/foo.en_GB.8,man9/foo.e.9,mann/foo.enn.n} || die
+ rm "\${D}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
+ rm "\${D}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_GB/man7/baz.en_US.7} || die
+ rmdir "\${D}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man7,man8,man9,mann,en_GB/man6,en_GB/man7,en_GB,} || die
+}
+END
+cp cat/doman/doman-{0,1}.ebuild || exit 1
+cat <<END > cat/doman/doman-2.ebuild || exit 1
+EAPI="\${PV}"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+src_compile() {
+ echo \${PF} >foo.1
+ mkdir dir
+ echo \${PF} >dir/foo.2
+ echo \${PF} >foo.3x
+ echo \${PF} >foo.4.gz
+ echo \${PF} >foo.5f.bz2
+ echo \${PF} >foo.6.Z
+ echo \${PF} >foo.en.7
+ echo \${PF} >foo.en_GB.8
+ echo \${PF} >foo.e.9
+ echo \${PF} >foo.enn.n
+ echo \${PF} >foo.EN.1
+ echo \${PF} >foo.en-GB.2
+ echo \${PF} >foo.en_gb.3
+ echo \${PF} >foo.en_G.4
+ echo \${PF} >foo.en_GBB.5
+ echo \${PF} >foo.nonkey
+ touch foo.1x
+ echo \${PF} >bar.m
+ echo \${PF} >bar.monkey
+ echo \${PF} >baz.6
+ echo \${PF} >baz.en_US.7
+}
+
+src_install() {
+ doman foo.* dir/foo.* || die
+ doman bar.m && die
+ doman bar.monkey && die
+ doman bar.1 && die
+ doman -i18n=en_GB baz.* || die
+ keepdir /meh || die
+ cd "\${D}"/meh || die
+ doman .keep* || die
+ rm "\${D}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
+ rm "\${D}"/usr/share/man/{man6/foo.6.Z,en/man7/foo.7,en_GB/man8/foo.8,man9/foo.e.9,mann/foo.enn.n} || die
+ rm "\${D}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
+ rm "\${D}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_US/man7/baz.7} || die
+ rmdir "\${D}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man9,mann,en/man7,en_GB/man6,en_GB/man8,en_US/man7,en,en_GB,en_US,} || die
+}
+END
mkdir -p "cat/dosym-success"
cat <<'END' > cat/dosym-success/dosym-success-1.ebuild || exit 1
EAPI="${PV}"
@@ -985,6 +1090,8 @@ src_install() {
dosym foo /usr/bin/bar
}
END
+mkdir -p "cat/doman-kdebuild"
+sed -e /EAPI=/d cat/doman/doman-0.ebuild >cat/doman-kdebuild/doman-kdebuild-1.kdebuild-1 || exit 1
mkdir -p "cat/expand-vars"
cat <<"END" > cat/expand-vars/expand-vars-0.ebuild || exit 1
DESCRIPTION="The Description"
@@ -1679,6 +1786,71 @@ pkg_setup() {
[[ ${OPTIONS%%+( )} == "enabled-weasel linguas:enabled-en_GB" ]] || die "OPTIONS=$OPTIONS is wrong"
}
END
+mkdir -p "packages/cat/doman-success"
+cat <<END > packages/cat/doman-success/doman-success-0.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENSE="GPL-2"
+PLATFORMS="test"
+
+src_compile() {
+ echo \${PF} >foo.1
+ mkdir dir
+ echo \${PF} >dir/foo.2
+ echo \${PF} >foo.3x
+ echo \${PF} >foo.4.gz
+ echo \${PF} >foo.5f.bz2
+ echo \${PF} >foo.6.Z
+ echo \${PF} >foo.en.7
+ echo \${PF} >foo.en_GB.8
+ echo \${PF} >foo.e.9
+ echo \${PF} >foo.enn.n
+ echo \${PF} >foo.EN.1
+ echo \${PF} >foo.en-GB.2
+ echo \${PF} >foo.en_gb.3
+ echo \${PF} >foo.en_G.4
+ echo \${PF} >foo.en_GBB.5
+ echo \${PF} >foo.nonkey
+ touch foo.1x
+ echo \${PF} >baz.6
+ echo \${PF} >baz.en_US.7
+}
+
+src_install() {
+ doman foo.* dir/foo.* || die
+ nonfatal doman bar.1 && die
+ doman -i18n=en_GB baz.* || die
+ keepdir /meh || die
+ cd "\${D}"/meh || die
+ doman .keep* || die
+ rm "\${D}"/usr/share/man/{man1/foo.1,man2/foo.2,man3/foo.3x,man4/foo.4.gz,man5/foo.5f.bz2} || die
+ rm "\${D}"/usr/share/man/{man6/foo.6.Z,en/man7/foo.7,en_GB/man8/foo.8,man9/foo.e.9,mann/foo.enn.n} || die
+ rm "\${D}"/usr/share/man/{man1/foo.EN.1,man2/foo.en-GB.2,man3/foo.en_gb.3,man4/foo.en_G.4} || die
+ rm "\${D}"/usr/share/man/{man5/foo.en_GBB.5,mann/foo.nonkey,en_GB/man6/baz.6,en_US/man7/baz.7} || die
+ rmdir "\${D}"/usr/share/man/{man1,man2,man3,man4,man5,man6,man9,mann,en/man7,en_GB/man6,en_GB/man8,en_US/man7,en,en_GB,en_US,} || die
+}
+END
+mkdir -p "packages/cat/doman-failure"
+cat <<END > packages/cat/doman-failure/doman-failure-0.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENSE="GPL-2"
+PLATFORMS="test"
+
+src_compile() {
+ echo \${PF} >bar.m
+}
+
+src_install() {
+ doman bar.m
+}
+END
cd ..
mkdir -p repo15/{eclass,distfiles,profiles/profile/subprofile} || exit 1
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 9be81c7..cb1079f 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -182,6 +182,7 @@ 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::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")),
value_for<n::unpack_fix_permissions>(destringify_key<bool>(k, "unpack_fix_permissions")),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 0c91085..ad2ab88 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -49,6 +49,7 @@ namespace paludis
struct description_use;
struct directory_if_exists_variables;
struct directory_variables;
+ struct doman_lang_filenames;
struct dosym_mkdir;
struct eapi;
struct ebuild_config;
@@ -297,6 +298,7 @@ namespace paludis
struct EAPIToolsOptions
{
+ 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;
NamedValue<n::unpack_fix_permissions, bool> unpack_fix_permissions;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 3bcac91..0bd8dc5 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -204,6 +204,7 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = true
+doman_lang_filenames = false
dosym_mkdir = true
failure_is_fatal = false
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 8c75f1e..6960085 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -225,6 +225,7 @@ pipe_commands_no_slot_or_repo = false
unpack_unrecognised_is_fatal = true
unpack_fix_permissions = false
+doman_lang_filenames = true
dosym_mkdir = false
failure_is_fatal = true
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 31b26c9..9e7f0e4 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -218,6 +218,7 @@ pipe_commands_no_slot_or_repo = true
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = false
+doman_lang_filenames = true
dosym_mkdir = false
failure_is_fatal = false
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 3592e39..ac46393 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -178,6 +178,8 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->tools_options()->unpack_unrecognised_is_fatal() ? "yes" : "")
.with_setenv("PALUDIS_UNPACK_FIX_PERMISSIONS",
params.package_id()->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
+ .with_setenv("PALUDIS_DOMAN_LANG_FILENAMES",
+ params.package_id()->eapi()->supported()->tools_options()->doman_lang_filenames() ? "yes" : "")
.with_setenv("PALUDIS_DOSYM_NO_MKDIR",
params.package_id()->eapi()->supported()->tools_options()->dosym_mkdir() ? "" : "yes")
.with_setenv("PALUDIS_FAILURE_IS_FATAL",
diff --git a/paludis/repositories/e/ebuild/utils/doman b/paludis/repositories/e/ebuild/utils/doman
index 7ffefca..a61d635 100755
--- a/paludis/repositories/e/ebuild/utils/doman
+++ b/paludis/repositories/e/ebuild/utils/doman
@@ -22,6 +22,7 @@
# Place, Suite 330, Boston, MA 02111-1307 USA
source "${PALUDIS_EBUILD_DIR}"/die_functions.bash
+source "${PALUDIS_EBUILD_DIR}"/0/list_functions.bash
if [[ ! -d ${D} ]]; then
paludis_die_or_error "\${D} not valid; aborting"
@@ -40,20 +41,26 @@ for x in "$@"; do
i18n="${x:6}/"
continue
fi
- if [[ ${x} == .keep ]]; then
+ if [[ ${x} == .keep_* ]]; then
continue
fi
suffix=${x##*.}
- if [[ ${suffix} == "gz" ]]; then
+ if hasq ${suffix} Z gz bz2; then
realname=${x%.*}
suffix=${realname##*.}
+ fi
+
+ if [[ -n ${PALUDIS_DOMAN_LANG_FILENAMES} && \
+ $x =~ (.*)\.([a-z][a-z](_[A-Z][A-Z])?)\.(.*) ]] ; then
+ name=${BASH_REMATCH[1]##*/}.${BASH_REMATCH[4]}
+ mandir=${BASH_REMATCH[2]}/man${suffix:0:1}
else
- realname=${x}
+ name=${x##*/}
+ mandir=${i18n}man${suffix:0:1}
fi
- mandir="${i18n}man${suffix:0:1}"
match='man[0-9n](|f|p|pm)$'
if [[ ${mandir} =~ ${match} ]]; then
@@ -62,8 +69,8 @@ for x in "$@"; do
install -d "${D}${BASE}/man/${mandir}"
fi
- install -m0644 "${x}" "${D}${BASE}/man/${mandir}" || ret=2
- else
+ install -m0644 "${x}" "${D}${BASE}/man/${mandir}/${name}" || ret=2
+ elif [[ ! -e ${x} ]]; then
echo "${0}: ${x} does not exist" >&2
ret=2
fi