From 03d34bd608859ea149c9e582ea656935b49ddaba Mon Sep 17 00:00:00 2001 From: "Robin H. Johnson" Date: Wed, 25 Apr 2007 18:22:37 +0000 Subject: [PATCH] Use MY_DATADIR instead of DATADIR, as DATADIR breaks when the environment already contains it, per bug #174755. --- eclass/java-pkg.eclass | 35 ++++++++++++++++++++++++- eclass/kernel-2.eclass | 19 ++++++++++---- eclass/mysql.eclass | 46 ++++++++++++++++----------------- eclass/php-ext-source-r1.eclass | 6 +++-- 4 files changed, 75 insertions(+), 31 deletions(-) diff --git a/eclass/java-pkg.eclass b/eclass/java-pkg.eclass index 10daeb819a8f..a2add64a53d5 100644 --- a/eclass/java-pkg.eclass +++ b/eclass/java-pkg.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg.eclass,v 1.50 2007/01/03 14:14:22 caster Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/java-pkg.eclass,v 1.51 2007/04/25 18:22:37 robbat2 Exp $ inherit multilib @@ -184,6 +184,14 @@ java-pkg_do_write_() echo "DEPEND=${pkgs}" >> "${package_env}" fi + if [ -n "${JAVADOC_PATH}" ] ; then + echo "JAVADOC_PATH=${JAVADOC_PATH}" >> "${package_env}" + fi + + if [ -n "${JAVA_SOURCES}" ] ; then + echo "JAVA_SOURCES=${JAVA_SOURCES}" >> "${package_env}" + fi + # Strip unnecessary leading and trailing colons sed -e "s/=:/=/" -e "s/:$//" -i "${package_env}" } @@ -449,9 +457,14 @@ java-pkg_getjars() } + java-pkg_dohtml() { dohtml -f package-list $@ + # this probably shouldn't be here but it provides + # a reasonable way to catch # docs for all of the + # old ebuilds. + java-pkg_recordjavadoc } java-pkg_jarinto() @@ -487,6 +500,26 @@ java-pkg_dosrc() { dodir ${target} install ${INSOPTIONS} "${T}/${PN}-src.zip" "${D}${target}" \ || die "failed to install sources" + # Record the existence of the sources in the package.env + JAVA_SOURCES="${target}${PN}-src.zip" + java-pkg_do_write_ +} + +# Scan for JavaDocs, and record their existence in the package.env file +java-pkg_recordjavadoc() +{ + java-pkg_do_init_ + # the find statement is important + # as some packages include multiple trees of javadoc + JAVADOC_PATH="$(find ${D}/usr/share/doc/ -name allclasses-frame.html -printf '%h:')" + # remove $D - TODO: check this is ok with all cases of the above + JAVADOC_PATH="${JAVADOC_PATH//${D}}" + if [ -n "${JAVADOC_PATH}" ] ; then + debug-print "JavaDocs found in ${JAVADOC_PATH%:}" + java-pkg_do_write_ + else + debug-print "No JavaDocs found" + fi } diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass index 0a733e747616..ee2c152d791c 100644 --- a/eclass/kernel-2.eclass +++ b/eclass/kernel-2.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.202 2007/02/14 16:40:49 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v 1.203 2007/04/25 18:22:37 robbat2 Exp $ # Description: kernel.eclass rewrite for a clean base regarding the 2.6 # series of kernel with back-compatibility for 2.4 @@ -154,11 +154,18 @@ detect_version() { KERNEL_URI="mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" + debug-print "0.0 CKV: ${CKV}" + debug-print "0.0 OKV: ${OKV}" RELEASE=${CKV/${OKV}} + debug-print "0 RELEASE: ${RELEASE}" RELEASE=${RELEASE/_beta} + debug-print "1 RELEASE: ${RELEASE}" RELEASE=${RELEASE/_rc/-rc} + debug-print "2 RELEASE: ${RELEASE}" RELEASE=${RELEASE/_pre/-pre} + debug-print "3 RELEASE: ${RELEASE}" kernel_is ge 2 6 && RELEASE=${RELEASE/-pre/-git} + debug-print "4 RELEASE: ${RELEASE}" RELEASETYPE=${RELEASE//[0-9]} # Now we know that RELEASE is the -rc/-git @@ -825,13 +832,14 @@ unipatch() { ebegin "Applying ${i/*\//} (-p${PATCH_DEPTH}+)" while [ ${PATCH_DEPTH} -lt 5 ]; do echo "Attempting Dry-run:" >> ${STDERR_T} - echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i}" >> ${STDERR_T} + cmdopts="-d${S} --no-backup-if-mismatch -p${PATCH_DEPTH} -f < ${i}" + echo "cmd: patch --dry-run ${cmdopts}" >> ${STDERR_T} echo "=======================================================" >> ${STDERR_T} - if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch --dry-run -f < ${i} >> ${STDERR_T}) $? -eq 0 ]; then + if [ $(eval patch --dry-run ${cmdopts} >> ${STDERR_T}) $? -eq 0 ]; then echo "Attempting patch:" > ${STDERR_T} - echo "cmd: patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i}" >> ${STDERR_T} + echo "cmd: patch ${cmdopts}" >> ${STDERR_T} echo "=======================================================" >> ${STDERR_T} - if [ $(patch -p${PATCH_DEPTH} --no-backup-if-mismatch -f < ${i} >> ${STDERR_T}) "$?" -eq 0 ]; then + if [ $(eval patch ${cmdopts} >> ${STDERR_T}) "$?" -eq 0 ]; then eend 0 rm ${STDERR_T} break @@ -1053,6 +1061,7 @@ kernel-2_pkg_postinst() { } kernel-2_pkg_setup() { + debug-print-kernel2-variables if kernel_is 2 4; then if [ "$( gcc-major-version )" -eq "4" ] ; then echo diff --git a/eclass/mysql.eclass b/eclass/mysql.eclass index 7acb891bccf1..06b5e09b1752 100644 --- a/eclass/mysql.eclass +++ b/eclass/mysql.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.74 2007/04/23 19:35:05 swegener Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/mysql.eclass,v 1.75 2007/04/25 18:22:37 robbat2 Exp $ # Author: Francesco Riosa (Retired) # Maintainer: Luca Longinotti @@ -200,25 +200,25 @@ mysql_init_vars() { MY_LOGDIR=${MY_LOGDIR="/var/log/mysql"} MY_INCLUDEDIR=${MY_INCLUDEDIR="/usr/include/mysql"} - if [[ -z "${DATADIR}" ]] ; then - DATADIR="" + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="" if [[ -f "${MY_SYSCONFDIR}/my.cnf" ]] ; then - DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ + MY_DATADIR=`"my_print_defaults" mysqld 2>/dev/null \ | sed -ne '/datadir/s|^--datadir=||p' \ | tail -n1` - if [[ -z "${DATADIR}" ]] ; then - DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR=`grep ^datadir "${MY_SYSCONFDIR}/my.cnf" \ | sed -e 's/.*=\s*//'` fi fi - if [[ -z "${DATADIR}" ]] ; then - DATADIR="${MY_LOCALSTATEDIR}" - einfo "Using default DATADIR" + if [[ -z "${MY_DATADIR}" ]] ; then + MY_DATADIR="${MY_LOCALSTATEDIR}" + einfo "Using default MY_DATADIR" fi - elog "MySQL DATADIR is ${DATADIR}" + elog "MySQL MY_DATADIR is ${MY_DATADIR}" if [[ -z "${PREVIOUS_DATADIR}" ]] ; then - if [[ -e "${DATADIR}" ]] ; then + if [[ -e "${MY_DATADIR}" ]] ; then elog "Previous datadir found, it's YOUR job to change" elog "ownership and take care of it" PREVIOUS_DATADIR="yes" @@ -234,7 +234,7 @@ mysql_init_vars() { export MY_SHAREDSTATEDIR MY_SYSCONFDIR export MY_LIBDIR MY_LOCALSTATEDIR MY_LOGDIR - export MY_INCLUDEDIR DATADIR MY_SOURCEDIR + export MY_INCLUDEDIR MY_DATADIR MY_SOURCEDIR } configure_minimal() { @@ -647,7 +647,7 @@ mysql_src_install() { fi insinto "${MY_SYSCONFDIR}" doins scripts/mysqlaccess.conf - sed -e "s!@DATADIR@!${DATADIR}!g" \ + sed -e "s!@DATADIR@!${MY_DATADIR}!g" \ "${FILESDIR}/my.cnf-${mysql_mycnf_version}" \ > "${TMPDIR}/my.cnf.ok" if mysql_version_is_at_least "4.1" && use latin1 ; then @@ -660,9 +660,9 @@ mysql_src_install() { # Empty directories ... diropts "-m0750" if [[ "${PREVIOUS_DATADIR}" != "yes" ]] ; then - dodir "${DATADIR}" - keepdir "${DATADIR}" - chown -R mysql:mysql "${D}/${DATADIR}" + dodir "${MY_DATADIR}" + keepdir "${MY_DATADIR}" + chown -R mysql:mysql "${D}/${MY_DATADIR}" fi diropts "-m0755" @@ -760,7 +760,7 @@ mysql_pkg_config() { # Make sure the vars are correctly initialized mysql_init_vars - [[ -z "${DATADIR}" ]] && die "Sorry, unable to find DATADIR" + [[ -z "${MY_DATADIR}" ]] && die "Sorry, unable to find MY_DATADIR" if built_with_use ${CATEGORY}/${PN} minimal ; then die "Minimal builds do NOT include the MySQL server" @@ -770,9 +770,9 @@ mysql_pkg_config() { local pwd2="b" local maxtry=5 - if [[ -d "${ROOT}/${DATADIR}/mysql" ]] ; then + if [[ -d "${ROOT}/${MY_DATADIR}/mysql" ]] ; then ewarn "You have already a MySQL database in place." - ewarn "(${ROOT}/${DATADIR}/*)" + ewarn "(${ROOT}/${MY_DATADIR}/*)" ewarn "Please rename or delete it if you wish to replace it." die "MySQL database already exists!" fi @@ -803,10 +803,10 @@ mysql_pkg_config() { pushd "${TMPDIR}" &>/dev/null "${ROOT}/usr/bin/mysql_install_db" | grep -B5 -A999 -i "ERROR" popd &>/dev/null - [[ -f "${ROOT}/${DATADIR}/mysql/user.frm" ]] \ + [[ -f "${ROOT}/${MY_DATADIR}/mysql/user.frm" ]] \ || die "MySQL databases not installed" - chown -R mysql:mysql "${ROOT}/${DATADIR}" 2> /dev/null - chmod 0750 "${ROOT}/${DATADIR}" 2> /dev/null + chown -R mysql:mysql "${ROOT}/${MY_DATADIR}" 2> /dev/null + chmod 0750 "${ROOT}/${MY_DATADIR}" 2> /dev/null if mysql_version_is_at_least "4.1.3" ; then options="--skip-ndbcluster" @@ -827,7 +827,7 @@ mysql_pkg_config() { --user=mysql \ --skip-grant-tables \ --basedir=${ROOT}/usr \ - --datadir=${ROOT}/${DATADIR} \ + --datadir=${ROOT}/${MY_DATADIR} \ --skip-innodb \ --skip-bdb \ --skip-networking \ diff --git a/eclass/php-ext-source-r1.eclass b/eclass/php-ext-source-r1.eclass index d9cbd0189948..3fb748eb8a55 100644 --- a/eclass/php-ext-source-r1.eclass +++ b/eclass/php-ext-source-r1.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.7 2007/03/22 20:12:56 chtekk Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/php-ext-source-r1.eclass,v 1.8 2007/04/25 18:22:37 robbat2 Exp $ # # Author: Tal Peer # Author: Stuart Herbert @@ -38,7 +38,9 @@ php-ext-source-r1_src_compile() { my_conf="--prefix=${PHPPREFIX} --with-php-config=${PHPCONFIG} ${my_conf}" # Create configure out of config.m4 - ${PHPIZE} + if [ "${PHP_EXT_SKIP_PHPIZE}" != 'yes' ]; then + ${PHPIZE} + fi # Concurrent PHP Apache2 modules support if has_concurrentmodphp ; then -- 2.26.2