summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hoffmann <hoffie@gentoo.org>2009-12-29 23:30:27 +0000
committerChristian Hoffmann <hoffie@gentoo.org>2009-12-29 23:30:27 +0000
commit43547ae28377846c563f738fa704426503396722 (patch)
treea2c60230242f5285adabf41d4a1da7c893795346 /app-admin
parentrefix bug #298044 to set false instead of true (diff)
downloadgentoo-2-43547ae28377846c563f738fa704426503396722.tar.gz
gentoo-2-43547ae28377846c563f738fa704426503396722.tar.bz2
gentoo-2-43547ae28377846c563f738fa704426503396722.zip
cleaning files/ from leftovers (pre-tarball times)
(Portage version: 2.1.7.15/cvs/Linux x86_64)
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/php-toolkit/ChangeLog11
-rw-r--r--app-admin/php-toolkit/files/php-select380
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/apache1.sh20
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/apache2.sh20
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/libapache.sh233
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/libsymlink.sh250
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/php-cgi.sh18
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/php-devel.sh21
-rw-r--r--app-admin/php-toolkit/files/php-select-modules/php.sh18
9 files changed, 10 insertions, 961 deletions
diff --git a/app-admin/php-toolkit/ChangeLog b/app-admin/php-toolkit/ChangeLog
index 0310957d9d5c..ea37a8d7bab2 100644
--- a/app-admin/php-toolkit/ChangeLog
+++ b/app-admin/php-toolkit/ChangeLog
@@ -1,6 +1,15 @@
# ChangeLog for app-admin/php-toolkit
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-admin/php-toolkit/ChangeLog,v 1.29 2009/07/29 15:28:37 darkside Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/php-toolkit/ChangeLog,v 1.30 2009/12/29 23:30:26 hoffie Exp $
+
+ 29 Dec 2009; Christian Hoffmann <hoffie@gentoo.org> -files/php-select,
+ -files/php-select-modules/apache1.sh,
+ -files/php-select-modules/apache2.sh,
+ -files/php-select-modules/libapache.sh,
+ -files/php-select-modules/libsymlink.sh, -files/php-select-modules/php.sh,
+ -files/php-select-modules/php-cgi.sh,
+ -files/php-select-modules/php-devel.sh:
+ cleaning files/ from leftovers (pre-tarball times)
29 Jul 2009; Jeremy Olexa <darkside@gentoo.org>
-php-toolkit-1.0-r2.ebuild:
diff --git a/app-admin/php-toolkit/files/php-select b/app-admin/php-toolkit/files/php-select
deleted file mode 100644
index 7b5f2771e6d4..000000000000
--- a/app-admin/php-toolkit/files/php-select
+++ /dev/null
@@ -1,380 +0,0 @@
-#!/bin/bash
-#
-# /usr/sbin/php-select
-# Tool for managing PHP symlinks on Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under v2 of the GNU General Public License
-#
-# ========================================================================
-#
-# USAGE
-# -----
-#
-# php-select <component> [<php-version>]
-#
-# where
-# <component> is one of
-# php|php-cgi|php-devel|apache|apache2
-#
-# <php-version> is the directory under /usr/lib where PHP is installed
-#
-# php-select with no arguments will list all components for each installed
-# php-version
-#
-# php-select <component> will list the current php-version in use for that
-# component
-#
-# php-select <component> <php-version> will reconfigure Gentoo to use
-# <php-version> of <component>. This normally involves replacing symlinks
-# on the system
-
-# ========================================================================
-
-G_ACTION=
-G_COMPONENT=
-G_COPYRIGHT[0]="Copyright (c) 2005 Gentoo Foundation, Inc."
-G_COPYRIGHT[1]="Released under v2 of the GNU General Public License"
-G_EXITSTATUS=0
-G_LIBDIR[0]="/usr/lib64"
-G_LIBDIR[1]="/usr/lib32"
-G_LIBDIR[2]="/usr/lib"
-G_MODULE_PATH="/usr/share/php-select"
-G_NEED_COMPONENT=0
-G_NEED_PHPVERSION=0
-G_PN="$0"
-G_PN_BASE="`basename $G_PN`"
-G_PVR="1.0.1"
-G_PHPVERSION=
-
-G_STATUS_OK=0
-G_STATUS_USAGE=1
-G_STATUS_NOTINSTALLED=2
-G_STATUS_NOTCOMPATIBLE=3
-G_STATUS_USINGOTHER=4
-G_STATUS_USINGNONE=5
-
-# ========================================================================
-# The Main Actions
-# ========================================================================
-
-# ------------------------------------------------------------------------
-# doCopyright() - output the copyright info
-#
-# No arguments
-
-doCopyright ()
-{
- local i
-
- for (( i = 0 ; i < ${#G_COPYRIGHT[@]} ; i = i + 1 )) ; do
- echo ${G_COPYRIGHT[$i]}
- done
-}
-
-# ------------------------------------------------------------------------
-# doHelp() - show full help
-#
-# No arguments
-
-doHelp ()
-{
- doVerboseVersion
- echo
-
- doUsageShort
- echo
- echo " $G_PN_BASE <component>"
- echo " Show which version of PHP is used for <component>"
- echo
- echo " $G_PN_BASE -t <component> <php-version>"
- echo " Test if <component> uses <php-version> or not"
- echo
- echo " $G_PN_BASE <component> <php-version>"
- echo " Set which version of PHP is used for <component>"
- echo
- echo " $G_PN_BASE -v"
- echo " Show version number"
- echo
- echo " $G_PN_BASE -h"
- echo " Show this help"
- echo
- echo "where <component> is one of:"
- echo
- echo " apache1 - Apache webserver v1.x"
- echo " apache2 - Apache webserver v2.x"
- echo " php - /usr/bin/php (the CLI SAPI)"
- echo " php-cgi - /usr/bin/php-cgi (the CGI SAPI)"
- echo " php-devel - the scripts used to build PECL extensions"
- echo
- echo "and where <php-version> is one of:"
- echo
- echo " php5 - php 5.x"
- echo
- echo "NOTE: none of these settings affect how Portage installs PHP or PEAR"
- echo " packages or PECL extensions."
- echo
- echo "Exit status is one of:"
- echo
- echo " 0 == ok"
- echo " 1 == usage error"
- echo " 2 == no compatible PHP version found"
- echo " 3 == incompatible PHP version specified"
- echo " 4 == component uses a different PHP version"
- echo " 5 == component not configured to use PHP"
-
- echo
- # doManPageDetails
-}
-
-# ------------------------------------------------------------------------
-# doManPageDetails() - show man page details
-#
-# No arguments
-
-doManPageDetails ()
-{
- echo "See 'man $G_PN_BASE' for full details"
-}
-
-# ------------------------------------------------------------------------
-# doSetComponent() - set a component to use a particular php version
-#
-# $1: component to set
-# $2: php version to set the component to
-
-doSetComponent ()
-{
- loadComponent $1 || exit 1
- actionSet $2
-}
-
-# ------------------------------------------------------------------------
-# doShowComponent() - show which version of php a particular component is
-# currently using
-#
-# $1: component to show
-
-doShowComponent ()
-{
- loadComponent $1 || exit 1
- actionShow
-}
-
-# ------------------------------------------------------------------------
-# doTest() - check to see if a particular component is using a specified
-# version or not
-#
-# $1: component to test
-
-doTest ()
-{
- loadComponent $1 || exit 1
- actionTest
-}
-
-# ------------------------------------------------------------------------
-# doUsage() - tell the user to stop being a muppet :)
-#
-# No arguments
-
-doUsage ()
-{
- doUsageShort
- echo "use $G_PN_BASE --help for full details"
- G_EXITSTATUS=1
-}
-
-# ------------------------------------------------------------------------
-# doUsageShort() - print out just the line to tell the user what to do
-#
-# No arguments
-
-doUsageShort ()
-{
- echo "usage: $G_PN_BASE [-htv] [<component> [<php-version>] ]"
-}
-
-# ------------------------------------------------------------------------
-# doVerboseVersion() - show more version info
-#
-# No arguments
-
-doVerboseVersion ()
-{
- doVersion
- doCopyright
-}
-
-# ------------------------------------------------------------------------
-# doVersion() - show version info
-#
-# No arguments
-
-doVersion ()
-{
- echo "$G_PN_BASE v$G_PVR"
-}
-
-# ========================================================================
-# Helping Functions
-# ========================================================================
-
-# ------------------------------------------------------------------------
-# loadComponent() - load a component's code into the script
-#
-# $1: component to load
-
-loadComponent ()
-{
- # only load one component, and only do it once
-
- if [[ -n $G_COMPONENT_LOADED ]] ; then
- return
- fi
-
- local l_module="$G_MODULE_PATH/$1.sh"
-
- if [[ ! -f $l_module ]] ; then
- echo "Error: module $l_module not found"
- return 1
- fi
-
- if [[ ! -r $l_module ]] ; then
- echo "Error: module $l_module not readable"
- return 1
- fi
-
- . "$l_module" && G_COMPONENT_LOADED=1
- [[ $? != 0 ]] && echo "Error: component $l_module not loadable"
-
- return 0
-}
-
-# ------------------------------------------------------------------------
-# missingComponent() - check to see if the user did not specify which
-# component to work on
-#
-# No arguments
-
-missingComponent ()
-{
- if [[ -z $G_COMPONENT && $G_NEED_COMPONENT == 1 ]] ; then
- echo "*** error: missing <component> argument"
- return 0
- fi
-
- return 1
-}
-
-# ------------------------------------------------------------------------
-# missingPhpVersion() - check to see if the user did not specify which
-# PHP version to use
-#
-# No arguments
-
-missingPhpVersion ()
-{
- if [[ -z $G_PHPVERSION && $G_NEED_PHPVERSION == 1 ]] ; then
- echo "*** error: missing <php-version> argument"
- return 0
- fi
-
- return 1
-}
-
-# ------------------------------------------------------------------------
-# parseArgs() - work out what the user has asked us to do
-#
-# $1: a php component (optional)
-# $2: a php version (optional)
-
-parseArgs ()
-{
- # do we have any parameters at all?
-
- if [[ -z $1 ]]; then
- G_ACTION=doUsage
- return
- fi
-
- # handle switches
-
- while [[ -n $1 && ${1:0:1} == '-' ]]; do
- case "$1" in
- -v|--version)
- G_ACTION=doVersion
- return
- ;;
- -V)
- G_ACTION=doVerboseVersion
- return
- ;;
- -h|-\?|--help)
- G_ACTION=doHelp
- return
- ;;
- -t|--test)
- G_ACTION=doTest
- G_NEED_COMPONENT=1
- G_NEED_PHPVERSION=1
- ;;
- *)
- G_ACTION=doUsage
- return
- ;;
- esac
-
- shift
- done
-
- # if we get here, we have a non-switch to examine, or we
- # don't have anything at all to look at
-
- if [[ -z $1 ]]; then
- if missingComponent || missingPhpVersion ; then
- G_ACTION=doUsage
- fi
- return
- fi
-
- # we have a component - make a note of it
-
- G_COMPONENT="$1"
- shift
-
- # do we have a php version too?
-
- if [[ -z $1 ]]; then
- if missingComponent || missingPhpVersion ; then
- G_ACTION=doUsage
- fi
-
- [[ -z $G_ACTION ]] && G_ACTION=doShowComponent
- return
- fi
-
- # yes we do - make a note of it too
-
- G_PHPVERSION="$1"
- [[ -z $G_ACTION ]] && G_ACTION=doSetComponent
- shift
-
- # we're done for now
-}
-
-# ------------------------------------------------------------------------
-# main() - it all happens here
-
-main ()
-{
- parseArgs "$@"
- $G_ACTION $G_COMPONENT $G_PHPVERSION
-
- exit $G_EXITSTATUS
-}
-
-main "$@"
diff --git a/app-admin/php-toolkit/files/php-select-modules/apache1.sh b/app-admin/php-toolkit/files/php-select-modules/apache1.sh
deleted file mode 100644
index 903819ca5b7b..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/apache1.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# /usr/share/php-select/apache1.sh
-# Module to manage mod_php for Apache2
-#
-# Written for Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under version 2 of the GNU General Public License
-#
-# ========================================================================
-
-G_APACHE_CONF=/etc/conf.d/apache
-G_APACHE_INIT=/etc/init.d/apache
-G_OPTS_VAR="APACHE_OPTS"
-G_APACHE_MOD_DIR="/usr/lib/apache/modules"
-
-. $G_MODULE_PATH/libapache.sh
diff --git a/app-admin/php-toolkit/files/php-select-modules/apache2.sh b/app-admin/php-toolkit/files/php-select-modules/apache2.sh
deleted file mode 100644
index 2add19ddfe30..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/apache2.sh
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# /usr/share/php-select/apache2.sh
-# Module to manage mod_php for Apache2
-#
-# Written for Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under version 2 of the GNU General Public License
-#
-# ========================================================================
-
-G_APACHE_CONF=/etc/conf.d/apache2
-G_APACHE_INIT=/etc/init.d/apache2
-G_OPTS_VAR="APACHE2_OPTS"
-G_APACHE_MOD_DIR="/usr/lib/apache2/modules"
-
-. $G_MODULE_PATH/libapache.sh
diff --git a/app-admin/php-toolkit/files/php-select-modules/libapache.sh b/app-admin/php-toolkit/files/php-select-modules/libapache.sh
deleted file mode 100644
index a03f36410cfe..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/libapache.sh
+++ /dev/null
@@ -1,233 +0,0 @@
-#
-# /usr/share/php-select/libapache.sh
-# Tool for managing Apache options on Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under v2 of the GNU General Public License
-#
-# ========================================================================
-
-actionSet ()
-{
- setApacheConf $1
-}
-
-actionShow ()
-{
- showApacheConf
-}
-
-actionTest ()
-{
- testApacheConf
-}
-
-# ------------------------------------------------------------------------
-# chooseApacheVersion () - select which version of Apache[2] will use
-#
-# $1 - PHP version to set
-# $G_APACHE_CONF - apache config file to edit
-# $G_OPTS_VAR - config variable to edit
-# $G_APACHE_MOD_DIR - directory to look in for mod_php
-
-chooseApacheVersion ()
-{
- # convert the PHP version to upper-case
- chosen=$( echo $1 | tr '[[:lower:]]' '[[:upper:]]' )
-
- # make a list of the mod_php versions available
- choices=( $(learnApacheMods $G_APACHE_MOD_DIR) )
-
- for (( i = 0 ; i < ${#choices[@]} ; i = i + 1 )) ; do
- if [[ ${choices[$i]} == $1 ]] ; then
- echo $chosen
- fi
- done
-}
-
-# ------------------------------------------------------------------------
-# isInstalledForApache() - do we have any mod_php's installed for this
-# version of Apache or not?
-
-isInstalledForApache ()
-{
- # find out which mod_php's are installed (if any!)
- choices=( $(learnApacheMods ${G_APACHE_MOD_DIR}) )
-
- # if there are no installed mod_php's, we tell the user
- if [[ -z $choices ]] ; then
- echo "*** error: mod_php is not installed for this version of Apache"
- G_EXITSTATUS=$G_STATUS_NOTINSTALLED
- return 1
- fi
-
- return 0
-}
-
-# ------------------------------------------------------------------------
-# isUsingModPhp() - determine if Apache is configured to use mod_php or not
-
-isUsingModPhp ()
-{
- chosen=$(learnApacheConf ${G_APACHE_CONF})
- if [[ -z $chosen ]] ; then
- echo "No mod_php configured in $G_APACHE_CONF"
- G_EXITSTATUS=$G_STATUS_USINGNONE
- return 1
- fi
-
- return 0
-}
-
-# ------------------------------------------------------------------------
-# learnApacheConf() - determine which PHP mod is set
-#
-# $1 - apache config file to examine
-
-learnApacheConf ()
-{
- . $1
- echo "${!G_OPTS_VAR}" | sed -e 's|^.*\(PHP[0-9]\).*|\1|;'
-}
-
-# ------------------------------------------------------------------------
-# learnApacheMods() - learn which versions of mod_php are available for
-# a chosen Apache version
-#
-# $1 - directory to search
-
-learnApacheMods ()
-{
- ls -1 $1/libphp*.so 2>/dev/null | sed -e 's|^.*lib\(php[0-9]\).*|\1|;'
-}
-
-# ------------------------------------------------------------------------
-# setApacheConf () - set which version of Apache[2] will use
-#
-# $1 - PHP version to set
-# $G_APACHE_CONF - apache config file to edit
-# $G_OPTS_VAR - config variable to edit
-# $G_APACHE_MOD_DIR - directory to look in for mod_php
-
-setApacheConf ()
-{
- isInstalledForApache || return 1
-
- # find out which option to set for Apache[2]
- #
- # if we can't find a matching mod_php to use, tell the user what
- # versions are available
-
- apacheChoice=$(chooseApacheVersion $1)
- if [[ -z $apacheChoice ]] ; then
- echo "*** error: compatible PHP version not found"
- echo "Compatible versions are:"
- echo
- for (( i = 0 ; i < ${#choices[@]} ; i = i + 1 )) ; do
- echo "* ${choices[$i]}"
- done
-
- G_EXITSTATUS=$G_STATUS_NOTCOMPATIBLE
- return
- fi
-
- # we know which version of mod_php we want to use
- #
- # create a new APACHE_OPTS variable
-
- . $G_APACHE_CONF
- newVar="$( echo ${!G_OPTS_VAR} | sed -e 's|-D PHP[0-9]||;' )"
- newVar="$( echo $newVar -D $apacheChoice | sed -e 's| | |g;' )"
-
- # replace the old variable in the config file with the new one
-
- sed -e "s|$G_OPTS_VAR=.*|$G_OPTS_VAR=\"$newVar\"|;" -i $G_APACHE_CONF
-
- # remember to tell the user to restart apache!
-
- echo "Apache conf.d file updated. For this change to take effect, you"
- echo "must restart the Apache webserver using this command:"
- echo
- echo "$G_APACHE_INIT restart"
-}
-
-# ------------------------------------------------------------------------
-# showApacheConf() - show which version of PHP that Apache[2] is configured
-# to use
-#
-# $G_APACHE_CONF - the Gentoo config file for Apache
-# $G_OPTS_VAR - the variable in the config file to check
-
-showApacheConf ()
-{
- isInstalledForApache || return 1
-
- # if we get here, then we have 1 or more mod_php's installed
- #
- # find out which mod_php Apache is configured for (if any)
-
- isUsingModPhp || return 1
-
- # if we get here, then apache is configured for a mod_php ...
- # is it one that is installed?
-
- chosen="$( echo $chosen | tr '[[:upper:]]' '[[:lower:]]' )"
- for (( i = 0 ; i < ${#choices[@]} ; i = i + 1 )) ; do
- if [[ ${choices[$i]} == $chosen ]] ; then
- echo $chosen
- return
- fi
- done
-
- # no, it is not installed
- # tell the user that they have a problem
-
- echo "*** warning: Apache is configured to use $chosen, but there is no"
- echo " matching mod_php installed on this machine"
-}
-
-# ------------------------------------------------------------------------
-# testApacheConf() - test which version of PHP that Apache[2] is configured
-# to use
-#
-# $G_APACHE_CONF - the Gentoo config file for Apache
-# $G_OPTS_VAR - the variable in the config file to check
-
-testApacheConf ()
-{
- isInstalledForApache || return 1
-
- # if we get here, then we have 1 or more mod_php's installed
- #
- # find out which mod_php Apache is configured for (if any)
-
- isUsingModPhp || return 1
-
- # if we get here, then apache is configured for a mod_php ...
- # is it one that is installed?
-
- chosen="$( echo $chosen | tr '[[:upper:]]' '[[:lower:]]' )"
- for (( i = 0 ; i < ${#choices[@]} ; i = i + 1 )) ; do
- if [[ ${choices[$i]} == $chosen ]] ; then
- # we have one installed; but is it what we want?
- if [[ $chosen == $G_PHPVERSION ]]; then
- echo "Okay"
- return
- fi
- echo "*** warning: Apache is configured to use a different version of PHP"
- G_EXITSTATUS=$G_STATUS_USINGOTHER
- return 1
- fi
- done
-
- # no, it is not installed
- # tell the user that they have a problem
-
- echo "*** warning: Apache is configured to use $chosen, but there is no"
- echo " matching mod_php installed on this machine"
-
- G_EXITSTATUS=$G_STATUS_NOTINSTALLED
-}
diff --git a/app-admin/php-toolkit/files/php-select-modules/libsymlink.sh b/app-admin/php-toolkit/files/php-select-modules/libsymlink.sh
deleted file mode 100644
index 9e5b6da853b5..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/libsymlink.sh
+++ /dev/null
@@ -1,250 +0,0 @@
-#
-# /usr/share/php-select/libsymlink.sh
-# Library for managing PHP symlinks on Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under v2 of the GNU General Public License
-#
-# ========================================================================
-
-actionSet ()
-{
- setSymlinks
-}
-
-actionShow ()
-{
- showSymlinks
-}
-
-actionTest ()
-{
- testSymlinks
-}
-
-# ------------------------------------------------------------------------
-# buildTargets() - map source files to target files
-#
-# $1 - php topdir to map from
-# $G_SYMLINK_SOURCE - array of files to map from
-#
-# echo's a list of files to map to - capture and turn into an array
-
-buildTargets ()
-{
- for (( i = 0 ; i < ${#G_SYMLINK_SOURCE[@]} ; i + i + 1 )) ; do
- echo "$1/${G_SYMLINK_SOURCE[$i]}"
- done
-}
-
-# ------------------------------------------------------------------------
-# choosePhpVersion() - select which version of PHP to use for our files
-#
-# $1 - php version required
-# $G_SYMLINK_SOURCE - array of files to look for
-#
-# returns 0 on success, 1 on failure
-# echos the path to the PHP libdir containing the files on success
-
-choosePhpVersion ()
-{
- # which PHP versions supply our files?
- local choices
- choices=( $(learnPhpVersions) )
-
- # do we have the PHP version we want in our list of choices?
- for (( i = 0 ; i < ${#choices[@]} ; i = i + 1 )) ; do
- if [[ `basename ${choices[$i]}` == $1 ]] ; then
- echo "${choices[$i]}"
- fi
- done
-}
-
-# ------------------------------------------------------------------------
-# hasCompatiblePhpVersions() - do we have compatible PHP versions installed
-# or not?
-
-hasCompatiblePhpVersions ()
-{
- # find out which compatible PHP versions are installed (if any!)
- choices=$(learnPhpVersions)
-
- # if there are no installed php versions, we tell the user
- if [[ -z $choices ]] ; then
- echo "*** error: no compatible PHP version installed"
- G_EXITSTATUS=$G_STATUS_NOTINSTALLED
- return 1
- fi
-
- return 0
-}
-
-# ------------------------------------------------------------------------
-# learnPhpVersions() - generate a list of valid PHP versions for this
-# particular machine and component
-#
-# $G_SYMLINK_SOURCE - array of files to look for
-
-learnPhpVersions ()
-{
- local i
- local musthave
- local x
- local n
- local breakit
-
- # how many files are we looking for?
- musthave=${#G_SYMLINK_SOURCE[@]}
- breakit="no"
-
- for (( i = 0 ; i < ${#G_LIBDIR[@]} ; i = i + 1 )) ; do
- for x in `echo ${G_LIBDIR[$i]}/php*` ; do
- (( dohave = 0 ))
-
- for (( n = 0 ; n < musthave ; n = n + 1 )) ; do
- if [[ -f $x/${G_SYMLINK_SOURCE[$n]} ]] ; then
- (( dohave = dohave + 1 ))
- fi
- done
-
- if (( dohave == musthave )) ; then
- echo "$x"
- breakit="yes"
- fi
- done
-
- if [[ ${breakit} == "yes" ]] ; then
- break
- fi
- done
-}
-
-# ------------------------------------------------------------------------
-# learnSymlinks() - generate a list of where the files are symlinked to
-#
-# $G_SYMLINK_TARGET - array of files to look at
-
-learnSymlinks ()
-{
- for (( i = 0 ; i < ${#G_SYMLINK_TARGET[$i]} ; i = i + 1 )) ; do
- if [[ ! -e ${G_SYMLINK_TARGET[$i]} ]] ; then
- echo "Not_found"
- elif [[ ! -L ${G_SYMLINK_TARGET[$i]} ]] ; then
- echo "Not_link"
- else
- echo "$(readlink ${G_SYMLINK_TARGET[$i]})"
- fi
- done
-}
-
-# ------------------------------------------------------------------------
-# setSymlinks () - set our target files to link to our source files
-#
-# $1 - PHP version to link to
-# $G_SYMLINK_SOURCE - array of files to symlink to
-# $G_SYMLINK_TARGET - array of symlink targets to create
-
-setSymlinks ()
-{
- # find out which compatible PHP versions are installed (if any!)
- hasCompatiblePhpVersions || return 1
-
- # find the directory holding the requested PHP version
- #
- # if we can't find the directory, tell the user which PHP
- # versions they can use with this module
-
- libdir=$(choosePhpVersion $G_PHPVERSION)
- if [[ -z $libdir ]] ; then
- echo "*** error: compatible php version not found"
- echo "Compatible versions are:"
- echo
-
- for (( i = 0 ; i < ${#choices[@]} ; i = i + 1 )) ; do
- echo "* `basename ${choices[$i]}`"
- done
-
- G_EXITSTATUS=$G_STATUS_NOTCOMPATIBLE
- return 1
- fi
-
- # we know where the file(s) are - create the symlinks
-
- for (( i = 0 ; i < ${#G_SYMLINK_SOURCE[@]} ; i = i + 1 )) ; do
- ln -sf ${libdir}/${G_SYMLINK_SOURCE[$i]} ${G_SYMLINK_TARGET[$i]}
- done
-}
-
-# ------------------------------------------------------------------------
-# showSymlinks () - show the files that we link to
-#
-# $G_SYMLINK_TARGET - array of files that may be linked
-
-showSymlinks ()
-{
- # find out which compatible PHP versions are installed (if any!)
- hasCompatiblePhpVersions || return 1
-
- # find out where each symlink points
- files=( $(learnSymlinks) )
-
- for (( i = 0 ; i < ${#files[@]} ; i = i + 1 )) ; do
- if [[ ${files[$i]} == "Not_found" ]]; then
- echo "${G_SYMLINK_TARGET[$i]} is not set"
- if (( G_EXITSTATUS < $G_STATUS_USINGNONE )) ; then
- G_EXITSTATUS=$G_STATUS_USINGNONE
- fi
- elif [[ ${files[$i]} == "Not_link" ]] ; then
- echo "${G_SYMLINK_TARGET[$i]} is not a symlink"
- if (( G_EXITSTATUS < $G_STATUS_USINGOTHER )) ; then
- G_EXITSTATUS=$G_STATUS_USINGOTHER
- fi
- else
- echo "${G_SYMLINK_TARGET[$i]} is set to ${files[$i]}"
- fi
- done
-}
-
-# ------------------------------------------------------------------------
-# testSymlinks () - test symlinks for a specified PHP version
-#
-# $G_SYMLINK_TARGET - array of files that may be linked
-# $G_PHPVERSION - PHP version to check against
-
-testSymlinks ()
-{
- # find out which compatible PHP versions are installed (if any!)
- hasCompatiblePhpVersions || return 1
-
- # find out where each symlink points
- files=( $(learnSymlinks) )
-
- for (( i = 0 ; i < ${#files[@]} ; i = i + 1 )) ; do
- if [[ ${files[$i]} == "Not_found" ]]; then
- echo "*** warning: ${G_SYMLINK_TARGET[$i]} does not exist"
- if (( G_EXITSTATUS < $G_STATUS_USINGNONE )) ; then
- G_EXITSTATUS=$G_STATUS_USINGNONE
- fi
- elif [[ ${files[$i]} == "Not_link" ]] ; then
- echo "*** warning: ${G_SYMLINK_TARGET[$i]} is not a symlink"
- if (( G_EXITSTATUS < $G_STATUS_USINGNONE )) ; then
- G_EXITSTATUS=$G_STATUS_USINGNONE
- fi
- else
- echo ${files[$i]} | grep $G_PHPVERSION > /dev/null 2>&1
- if [[ $? != 0 ]] ; then
- echo "*** warning: ${G_SYMLINK_TARGET[$i]} does not use $G_PHPVERSION"
- if (( G_EXITSTATUS < $G_STATUS_USINGOTHER )) ; then
- G_EXITSTATUS=$G_STATUS_USINGOTHER
- fi
- fi
- fi
- done
-
- if [[ $G_EXITSTATUS == 0 ]] ; then
- echo "Okay"
- fi
-}
diff --git a/app-admin/php-toolkit/files/php-select-modules/php-cgi.sh b/app-admin/php-toolkit/files/php-select-modules/php-cgi.sh
deleted file mode 100644
index 2fe84c1a79ed..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/php-cgi.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# /usr/share/php-select/php-cgi.sh
-# Module to manage /usr/bin/php-cgi binary
-#
-# Written for Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under version 2 of the GNU General Public License
-#
-# ========================================================================
-
-G_SYMLINK_SOURCE[0]="bin/php-cgi"
-G_SYMLINK_TARGET[0]="/usr/bin/php-cgi"
-
-. $G_MODULE_PATH/libsymlink.sh
diff --git a/app-admin/php-toolkit/files/php-select-modules/php-devel.sh b/app-admin/php-toolkit/files/php-select-modules/php-devel.sh
deleted file mode 100644
index f016fc7623ce..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/php-devel.sh
+++ /dev/null
@@ -1,21 +0,0 @@
-#
-# /usr/share/php-select/php-devel.sh
-# Module to manage PHP development scripts
-#
-# Written for Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under version 2 of the GNU General Public License
-#
-# ========================================================================
-
-G_SYMLINK_SOURCE[0]="bin/php-config"
-G_SYMLINK_TARGET[0]="/usr/bin/php-config"
-
-G_SYMLINK_SOURCE[1]="bin/phpize"
-G_SYMLINK_TARGET[1]="/usr/bin/phpize"
-
-. $G_MODULE_PATH/libsymlink.sh
diff --git a/app-admin/php-toolkit/files/php-select-modules/php.sh b/app-admin/php-toolkit/files/php-select-modules/php.sh
deleted file mode 100644
index 21430f3ecb82..000000000000
--- a/app-admin/php-toolkit/files/php-select-modules/php.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# /usr/share/php-select/php.sh
-# Module to manage /usr/bin/php binary
-#
-# Written for Gentoo Linux
-#
-# Author Stuart Herbert
-# (stuart@gentoo.org)
-#
-# Copyright (c) 2005 Gentoo Foundation, Inc.
-# Released under version 2 of the GNU General Public License
-#
-# ========================================================================
-
-G_SYMLINK_SOURCE[0]="bin/php"
-G_SYMLINK_TARGET[0]="/usr/bin/php"
-
-. $G_MODULE_PATH/libsymlink.sh