Please see Message-ID: <1044037225.3e3abe69e8869@superman.bantai.com> from Johan Huldtgren <johan@huldtgren.com> on ports@freebsd.org: HTML_Select 1.0 is unfetchable, because it has been renamed into HTML_Select_Common 1.1. Fix: The "right way" (TM) is perhaps to do a repocopy from devel/pear-HTML_Select to devel/pear-HTML_Select_Common; the simplest is to remove devel/pear-HTML_Select and then create a new port devel/pear-HTML_Select_Common. Then, apply the diff to Horde's Makefile. 1) New file # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # devel/pear-HTML_Select_Common # devel/pear-HTML_Select_Common/files # devel/pear-HTML_Select_Common/files/Select.php # devel/pear-HTML_Select_Common/pkg-plist # devel/pear-HTML_Select_Common/pkg-descr # devel/pear-HTML_Select_Common/pkg-comment # devel/pear-HTML_Select_Common/Makefile # devel/pear-HTML_Select_Common/distinfo # echo c - devel/pear-HTML_Select_Common mkdir -p devel/pear-HTML_Select_Common > /dev/null 2>&1 echo c - devel/pear-HTML_Select_Common/files mkdir -p devel/pear-HTML_Select_Common/files > /dev/null 2>&1 echo x - devel/pear-HTML_Select_Common/files/Select.php sed 's/^X//' >devel/pear-HTML_Select_Common/files/Select.php << 'END-of-devel/pear-HTML_Select_Common/files/Select.php' X<?php X/* vim: set expandtab tabstop=4 shiftwidth=4: */ X// +----------------------------------------------------------------------+ X// | PHP Version 4 | X// +----------------------------------------------------------------------+ X// | Copyright (c) 1997, 1998, 1999, 2000, 2001 The PHP Group | X// +----------------------------------------------------------------------+ X// | This source file is subject to version 2.0 of the PHP license, | X// | that is bundled with this package in the file LICENSE, and is | X// | available at through the world-wide-web at | X// | http://www.php.net/license/2_02.txt. | X// | If you did not receive a copy of the PHP license and are unable to | X// | obtain it through the world-wide-web, please send a note to | X// | license@php.net so we can mail you a copy immediately. | X// +----------------------------------------------------------------------+ X// | Author: Adam Daniel <adaniel1@eesus.jnj.com> | X// +----------------------------------------------------------------------+ X// X// $Id: Select.php,v 1.10.2.2 2002/04/09 19:04:19 ssb Exp $ X Xrequire_once 'PEAR.php'; Xrequire_once 'HTML/Common.php'; X X/** X * Class to dynamically create an HTML SELECT X * X * @author Adam Daniel <adaniel1@eesus.jnj.com> X * @version 1.2 X * @since PHP4.04pl1 X * @access public X */ Xclass HTML_Select extends HTML_Common X{ X X /** X * Contains the select options X * X * @var array X * @since 1.0 X * @access private X */ X var $_options = array(); X X /** X * Default values of the SELECT X * X * @var string X * @since 1.0 X * @access private X */ X var $_values = array(); X X /** X * Class constructor X * X * @param string $name (optional)Name attribute of the SELECT X * @param int $size (optional) Size attribute of the SELECT X * @param bool $multiple (optional)Whether the select will allow multiple X * selections or not X * @param mixed $attributes (optional)Either a typical HTML attribute string X * or an associative array X * @param int $tabOffset (optional)Number of tabs to offset HTML source X * @since 1.0 X * @access public X * @return void X * @throws X */ X function HTML_Select($name = '', $size = 1, $multiple = false, $attributes = null, $tabOffset = 0) X { X HTML_Common::HTML_Common($attributes, $tabOffset); X $attr = array('name' => $name, 'size' => $size); X if ($multiple) { X $attr[] = 'multiple="multiple"'; X } X $this->updateAttributes($attr); X $this->setSelectedValues(array()); X } X X /** X * Returns the current API version X * X * @since 1.0 X * @access public X * @return double X * @throws X */ X function apiVersion() X { X return 1.2; X } X X /** X * Sets the default values of the select box X * X * @param mixed $values Array or comma delimited string of selected values X * @since 1.0 X * @access public X * @return void X * @throws X */ X function setSelectedValues($values) X { X if (is_string($values)) { X $values = split("[ ]?,[ ]?", $values); X } X $this->_values = $values; X } X X /** X * Returns an array of the selected values X * X * @since 1.0 X * @access public X * @return array of selected values X * @throws X */ X function getSelectedValues() X { X return $this->_values; X } X X /** X * Adds a new OPTION to the SELECT X * X * @param string $text Display text for the OPTION X * @param string $value Value for the OPTION X * @param bool $selected Whether the option is selected or not X * @param mixed $attributes Either a typical HTML attribute string X * or an associative array X * @since 1.0 X * @access public X * @return void X * @throws X */ X function addOption($text, $value, $selected = false, $attributes = null) X { X if ($selected && !in_array($value, $this->_values)) { X $this->_values[] = $value; X } X X $attributes = $this->_parseAttributes($attributes); X $attr['value'] = $value; X $this->_updateAttrArray($attributes, $attr); X $this->_options[] = array('text' => $text, 'attr' => $attributes); X } X X /** X * Loads the options from an associative array X * X * @param array $arr Associative array of options X * @param mixed $values (optional) Array or comma delimited string of selected values X * @since 1.0 X * @access public X * @return PEAR_Error on error or true X * @throws PEAR_Error X */ X function loadArray($arr, $values=null) X { X if (!is_array($arr)) { X return new PEAR_ERROR('First argument to HTML_Select::loadArray is not a valid array'); X } X if (isset($values)) { X $this->setSelectedValues($values); X } X while (list($key, $value) = each($arr)) { X $this->addOption($key, $value); X } X return true; X } X X /** X * Loads the options from an array with numeric keys, using the X * array values as the form values as well as labels. X * X * @param array $arr Array of options X * @param mixed $values (optional) Array or comma delimited string of selected values X * @since 1.2 X * @access public X * @return PEAR_Error on error or true X * @throws PEAR_Error X */ X function loadValueArray($arr, $values = null) X { X if (!is_array($arr)) { X return new PEAR_ERROR("First argument to HTML_Select::loadArray is not a valid array"); X } X if (isset($values)) { X $this->setSelectedValues($values); X } X foreach ($arr as $value) { X $this->addOption($value, $value); X } X return true; X } X X /** X * Loads the options from DB_result object X * X * If no column names are specified the first two columns of the result are X * used as the text and value columns respectively X * @param object $result DB_result object X * @param string $textCol (optional) Name of column to display as the OPTION text X * @param string $valueCol (optional) Name of column to use as the OPTION value X * @param mixed $values (optional) Array or comma delimited string of selected values X * @since 1.0 X * @access public X * @return PEAR_Error on error or true X * @throws PEAR_Error X */ X function loadDbResult(&$result, $textCol=null, $valueCol=null, $values=null) X { X include_once 'DB.php'; X X if (!is_object($result) || (get_class($result) != "db_result" && X is_subclass_of($result, "db_result"))) { X return new PEAR_ERROR("First argument to HTML_Select::loadDbResult is not a valid DB_result"); X } X if (isset($values)) { X $this->setSelectedValues($values); X } X $fetchMode = ($textCol && $valueCol) ? DB_FETCHMODE_ASSOC : DB_FETCHMODE_DEFAULT; X while (is_array($row = $result->fetchRow($fetchMode)) ) { X if ($fetchMode == DB_FETCHMODE_ASSOC) { X $this->addOption($row[$textCol], $row[$valueCol]); X } else { X $this->addOption($row[0], $row[1]); X } X } X return true; X } X X /** X * Queries a database and loads the options from the results X * X * @param mixed $conn Either an existing DB connection or a valid dsn X * @param string $sql SQL query string X * @param string $textCol (optional) Name of column to display as the OPTION text X * @param string $valueCol (optional) Name of column to use as the OPTION value X * @param mixed $values (optional) Array or comma delimited string of selected values X * @since 1.1 X * @access private X * @return void X * @throws X */ X function loadQuery(&$conn, $sql, $textCol=null, $valueCol=null, $values=null) X { X include_once 'DB.php'; X X if (is_string($conn)) { X $dbConn = &DB::connect($conn, true); X if (DB::isError($dbConn)) return $dbConn; X } elseif (is_subclass_of($conn, "db_common")) { X $dbConn = $conn; X } else { X return new PEAR_Error("Argument 1 of HTML_Select::loadQuery is not a valid type"); X } X $result = @$dbConn->query($sql); X if (DB::isError($result)) return $result; X return $this->loadDbResult($result, $textCol, $valueCol, $values); X } X X /** X * Loads options from different types of data sources X * X * This method is a simulated overloaded method. The arguments, other than the X * first are optional and only mean something depending on the type of the first argument. X * If the first argument is an array then all arguments are passed in order to loadArray. X * If the first argument is a db_result then all arguments are passed in order to loadDbResult. X * If the first argument is a string or a DB connection then all arguments are X * passed in order to loadQuery. X * @param mixed $options Options source currently supports assoc array or DB_result X * @param mixed $param1 (optional) See function detail X * @param mixed $param2 (optional) See function detail X * @param mixed $param3 (optional) See function detail X * @param mixed $param4 (optional) See function detail X * @since 1.1 X * @access public X * @return PEAR_Error on error or true X * @throws PEAR_Error X */ X function load(&$options, $param1=null, $param2=null, $param3=null, $param4=null) X { X switch (true) { X case is_array($options): X return $this->loadArray($options, $param1); X break; X case (get_class($options) == "db_result" || is_subclass_of($options, "db_result")): X return $this->loadDbResult($options, $param1, $param2, $param3); X break; X case (is_string($options) || is_subclass_of($options, "db_common")): X return $this->loadQuery($options, $param1, $param2, $param3, $param4); X break; X } X } X X /** X * Returns the SELECT in HTML X * X * @since 1.0 X * @access public X * @return string X * @throws X */ X function toHtml() X { X $tabs = $this->_getTabs(); X $name = $this->_attributes['name']; X $strHtml = $tabs; X if ($this->_comment) { X $strHtml .= "<!-- $this->_comment -->\n$tabs"; X } X $strHtml .= X '<select' . $this->_getAttrString($this->_attributes) . '>'; X foreach ($this->_options as $option) { X if (@in_array($option['attr']['value'], $this->_values)) { X $option['attr']['selected'] = 'selected'; X } X $attrString = $this->_getAttrString($option['attr']); X $strHtml .= X '<option' . $attrString . '>' . X htmlspecialchars($option['text']) . '</option>'; X } X $strHtml .= '</select>'; X return $strHtml; X } X X} X?> END-of-devel/pear-HTML_Select_Common/files/Select.php echo x - devel/pear-HTML_Select_Common/pkg-plist sed 's/^X//' >devel/pear-HTML_Select_Common/pkg-plist << 'END-of-devel/pear-HTML_Select_Common/pkg-plist' X%%PEARDIR%%/HTML/Select.php X%%PEARDIR%%/HTML/Select/Common/Country.php X%%PEARDIR%%/HTML/Select/Common/FRDepartements.php X%%PEARDIR%%/HTML/Select/Common/UKCounty.php X%%PEARDIR%%/HTML/Select/Common/USState.php X%%PORTDOCS%%%%EXAMPLESDIR%%/Country.php X%%PORTDOCS%%%%EXAMPLESDIR%%/FRDepartements.php X%%PORTDOCS%%%%EXAMPLESDIR%%/UKCounty.php X%%PORTDOCS%%%%EXAMPLESDIR%%/USState.php X@dirrm %%PEARDIR%%/HTML/Select/Common X@dirrm %%PEARDIR%%/HTML/Select X%%PORTDOCS%%@dirrm %%EXAMPLESDIR%% END-of-devel/pear-HTML_Select_Common/pkg-plist echo x - devel/pear-HTML_Select_Common/pkg-descr sed 's/^X//' >devel/pear-HTML_Select_Common/pkg-descr << 'END-of-devel/pear-HTML_Select_Common/pkg-descr' XProvides <select> lists for: Xo Country Xo UK counties Xo US States Xo FR Departements X XWWW: http://pear.php.net/package-info.php?pacid=165 END-of-devel/pear-HTML_Select_Common/pkg-descr echo x - devel/pear-HTML_Select_Common/pkg-comment sed 's/^X//' >devel/pear-HTML_Select_Common/pkg-comment << 'END-of-devel/pear-HTML_Select_Common/pkg-comment' XSome small PEAR classes to handle common <select> lists END-of-devel/pear-HTML_Select_Common/pkg-comment echo x - devel/pear-HTML_Select_Common/Makefile sed 's/^X//' >devel/pear-HTML_Select_Common/Makefile << 'END-of-devel/pear-HTML_Select_Common/Makefile' X# Ports collection makefile for: pear-HTML_Select X# Date created: 30 November 2002 X# Whom: Thierry Thomas (<thierry@pompo.net>) X# X# $FreeBSD$ X# X XPORTNAME= HTML_Select_Common XPORTVERSION= 1.1 XCATEGORIES= devel www XMASTER_SITES= http://pear.php.net/get/ XPKGNAMEPREFIX= pear- XEXTRACT_SUFX= .tgz XDIST_SUBDIR= PEAR X XMAINTAINER= ports@FreeBSD.org X XBUILD_DEPENDS= ${PEARDIR}/HTML/Common.php:${PORTSDIR}/devel/pear-HTML_Common XRUN_DEPENDS= ${PEARDIR}/HTML/Common.php:${PORTSDIR}/devel/pear-HTML_Common \ X ${PEARDIR}/I18N/Common.php:${PORTSDIR}/devel/pear-I18N X XNO_BUILD= yes XEXAMPLESDIR= ${PREFIX}/share/examples/pear/${PORTNAME} X XLPHP_LIB= lib/php XPEARDIR= ${LOCALBASE}/${LPHP_LIB} XPLIST_SUB= PEARDIR=${LPHP_LIB} XMANIFEST= Country.php FRDepartements.php UKCounty.php USState.php XEXAMPLES= Country.php FRDepartements.php UKCounty.php USState.php X Xdo-install: X @${MKDIR} ${PEARDIR}/HTML/Select/Common X.for FILE in ${MANIFEST} X @${CP} -p ${WRKSRC}/Select/Common/${FILE} ${PEARDIR}/HTML/Select/Common X.endfor X @${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${PEARDIR}/HTML/Select/Common X @${CHMOD} a-x ${PEARDIR}/HTML/Select/Common/* X#Note: Select.php is still needed for Kronolith 1.0 X# but should be removed with the next release. X @${CP} -p ${FILESDIR}/Select.php ${PEARDIR}/HTML X @${CHOWN} ${SHAREOWN}:${SHAREGRP} ${PEARDIR}/HTML/Select.php X Xpost-install: X.if !defined(NOPORTDOCS) X @${MKDIR} ${EXAMPLESDIR} X.for FILE in ${EXAMPLES} X @${INSTALL_DATA} ${WRKSRC}/Select/Common/examples/${FILE} ${EXAMPLESDIR} X.endfor X @${ECHO_MSG} "===> Examples installed in ${EXAMPLESDIR}." X.endif X X.include <bsd.port.mk> END-of-devel/pear-HTML_Select_Common/Makefile echo x - devel/pear-HTML_Select_Common/distinfo sed 's/^X//' >devel/pear-HTML_Select_Common/distinfo << 'END-of-devel/pear-HTML_Select_Common/distinfo' XMD5 (PEAR/HTML_Select_Common-1.1.tgz) = 182210f08e809d51208ae4ecc70a4f3c END-of-devel/pear-HTML_Select_Common/distinfo exit 2) Updating Horde's depend: How-To-Repeat: Try to install mail/imp3 on a clean machine: it will break, because HTML_Select no longer exists.
Responsible Changed From-To: freebsd-ports-bugs->edwin Requested repocopy at portmgr@
State Changed From-To: open->closed Commited, thanks!