[38100] branches/variant-descs-14482/base
raimue at macports.org
raimue at macports.org
Sun Jul 6 09:38:22 PDT 2008
Revision: 38100
http://trac.macosforge.org/projects/macports/changeset/38100
Author: raimue at macports.org
Date: 2008-07-06 09:38:22 -0700 (Sun, 06 Jul 2008)
Log Message:
-----------
Merged revisions 37526,37543,37552,37621,37682,37711,37728,37756-37759,37780,37786,37909,37913-37914,37981,38033,38037-38038,38040 via svnmerge from
https://svn.macports.org/repository/macports/trunk/base
........
r37526 | raimue at macports.org | 2008-06-11 14:58:33 +0200 (Wed, 11 Jun 2008) | 4 lines
port/port.tcl:
If env(COLUMNS) is not available, do not wrap.
See #15488.
........
r37543 | jmr at macports.org | 2008-06-12 15:05:44 +0200 (Thu, 12 Jun 2008) | 2 lines
Add new Internode SourceForge mirror
........
r37552 | ryandesign at macports.org | 2008-06-13 10:11:24 +0200 (Fri, 13 Jun 2008) | 2 lines
Properly detect Mac OS X versions earlier than Panther, where sw_vers doesn't accept any parameters
........
r37621 | jmr at macports.org | 2008-06-15 22:32:58 +0200 (Sun, 15 Jun 2008) | 2 lines
Treat port names case-insensitively in filemap. (#11759)
........
r37682 | raimue at macports.org | 2008-06-19 02:00:16 +0200 (Thu, 19 Jun 2008) | 2 lines
Add tcldox directory to svn:ignore
........
r37711 | dluke at macports.org | 2008-06-20 15:07:41 +0200 (Fri, 20 Jun 2008) | 2 lines
Use the $SVN variable for the commit too.
........
r37728 | raimue at macports.org | 2008-06-21 03:14:18 +0200 (Sat, 21 Jun 2008) | 3 lines
port/port.tcl:
Sort portlists case-insensitive (e.g. for port installed)
........
r37756 | raimue at macports.org | 2008-06-22 03:25:48 +0200 (Sun, 22 Jun 2008) | 5 lines
port/port.tcl:
Add new option --editor to port edit
Bug with "port ed --editor" fixed in r37786.
........
r37757 | raimue at macports.org | 2008-06-22 03:37:04 +0200 (Sun, 22 Jun 2008) | 3 lines
port/port.tcl:
Simplify the cmd_args_array
........
r37758 | raimue at macports.org | 2008-06-22 03:47:12 +0200 (Sun, 22 Jun 2008) | 4 lines
port/port.tcl:
* Rename cmd_args_array to cmd_opts_array, as this name is more appropriate
* Fix a possible issue with the restructured array in proc action_get_usage
........
r37759 | raimue at macports.org | 2008-06-22 06:43:13 +0200 (Sun, 22 Jun 2008) | 3 lines
cregistry/registry.c:
Fix an invalid free introduced in r36500.
........
r37780 | eridius at macports.org | 2008-06-23 09:00:08 +0200 (Mon, 23 Jun 2008) | 2 lines
Remove some redundant code in mportinit
........
r37786 | ryandesign at macports.org | 2008-06-23 13:44:41 +0200 (Mon, 23 Jun 2008) | 2 lines
port.tcl: fix bug from r37756: allow 'port ed --editor' to work
........
r37909 | raimue at macports.org | 2008-06-29 00:39:49 +0200 (Sun, 29 Jun 2008) | 4 lines
port/port.tcl:
Added new port selectors depends_lib:, depends_build:, depends_run:.
Also added a shorthand depends: for all three of them.
........
r37913 | raimue at macports.org | 2008-06-29 03:15:46 +0200 (Sun, 29 Jun 2008) | 3 lines
pextlib1.0/Pextlib.c:
Whitespace only, correct indent
........
r37914 | jmr at macports.org | 2008-06-29 06:03:03 +0200 (Sun, 29 Jun 2008) | 2 lines
Try the distfiles mirror for tagged files too. Closes #15485.
........
r37981 | ryandesign at macports.org | 2008-07-02 00:09:20 +0200 (Wed, 02 Jul 2008) | 2 lines
portlint.tcl: warn when using "configure {}" instead of "use_configure no"; closes #15806
........
r38033 | raimue at macports.org | 2008-07-04 01:49:00 +0200 (Fri, 04 Jul 2008) | 3 lines
port/port.tcl:
Document depends: and depends_*: from r37909
........
r38037 | raimue at macports.org | 2008-07-04 04:58:10 +0200 (Fri, 04 Jul 2008) | 3 lines
portmgr/dmg/postflight:
Copy the postflight script from the release_1_6 branch so the changes will not be lost or forgotten
........
r38038 | raimue at macports.org | 2008-07-04 06:30:56 +0200 (Fri, 04 Jul 2008) | 4 lines
port1.0/portextract.tcl:
If the $distfile exists in $filespath, use it from there as it was not fetched
to the distpath in this case.
........
r38040 | raimue at macports.org | 2008-07-04 06:59:54 +0200 (Fri, 04 Jul 2008) | 3 lines
portmgr/dmg/postflight:
Remove old non-compressed man pages on install
........
Modified Paths:
--------------
branches/variant-descs-14482/base/configure
branches/variant-descs-14482/base/configure.ac
branches/variant-descs-14482/base/portmgr/dmg/postflight
branches/variant-descs-14482/base/portmgr/jobs/PortIndexRegen.sh
branches/variant-descs-14482/base/src/cregistry/registry.c
branches/variant-descs-14482/base/src/macports1.0/macports.tcl
branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c
branches/variant-descs-14482/base/src/pextlib1.0/filemap.c
branches/variant-descs-14482/base/src/port/port.tcl
branches/variant-descs-14482/base/src/port1.0/portextract.tcl
branches/variant-descs-14482/base/src/port1.0/portfetch.tcl
branches/variant-descs-14482/base/src/port1.0/portlint.tcl
branches/variant-descs-14482/base/src/port1.0/resources/fetch/mirror_sites.tcl
Property Changed:
----------------
branches/variant-descs-14482/base/
Property changes on: branches/variant-descs-14482/base
___________________________________________________________________
Name: svn:ignore
- autom4te.cache
config.log
config.status
Makefile
Doxyfile
+ autom4te.cache
config.log
config.status
Makefile
Doxyfile
tcldox
Name: svnmerge-integrated
- /trunk/base:1-37508
+ /trunk/base:1-38098
Modified: branches/variant-descs-14482/base/configure
===================================================================
--- branches/variant-descs-14482/base/configure 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/configure 2008-07-06 16:38:22 UTC (rev 38100)
@@ -2123,7 +2123,7 @@
if test "x$SW_VERS" != "x"; then
{ echo "$as_me:$LINENO: checking Mac OS X version" >&5
echo $ECHO_N "checking Mac OS X version... $ECHO_C" >&6; }
- MACOSX_VERSION=`$SW_VERS -productVersion | cut -f 1-3 -d.`
+ MACOSX_VERSION=`$SW_VERS | sed -n "s/^ProductVersion:[[:space:]]//p" | cut -f 1-3 -d.`
{ echo "$as_me:$LINENO: result: $MACOSX_VERSION" >&5
echo "${ECHO_T}$MACOSX_VERSION" >&6; }
fi
Modified: branches/variant-descs-14482/base/configure.ac
===================================================================
--- branches/variant-descs-14482/base/configure.ac 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/configure.ac 2008-07-06 16:38:22 UTC (rev 38100)
@@ -22,7 +22,7 @@
AC_CHECK_PROGS(SW_VERS, sw_vers)
if test "x$SW_VERS" != "x"; then
AC_MSG_CHECKING(Mac OS X version)
- MACOSX_VERSION=`$SW_VERS -productVersion | cut -f 1-3 -d.`
+ MACOSX_VERSION=`$SW_VERS | sed -n "s/^ProductVersion:[[[:space:]]]//p" | cut -f 1-3 -d.`
AC_MSG_RESULT([$MACOSX_VERSION])
fi
Modified: branches/variant-descs-14482/base/portmgr/dmg/postflight
===================================================================
--- branches/variant-descs-14482/base/portmgr/dmg/postflight 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/portmgr/dmg/postflight 2008-07-06 16:38:22 UTC (rev 38100)
@@ -1,9 +1,7 @@
#!/bin/bash
+# -*- coding: utf-8; mode: shell-script-mode; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=sh:et:sw=4:ts=4:sts=4
#
-# Copyright (c) 2007 Juan Manuel Palacios <jmpp at macports.org>
-# Copyright (c) 2005 Ole Guldberg Jensen <olegb at opendarwin.org>
-# Copyright (c) 2005 Dr. Ernie Prabhakar <drernir at opendarwin.org>
-# Copyright (c) 2005 Matt Anton <matt at opendarwin.org>
+# Copyright (c) 2002-2007 Juan Manuel Palacios <jmpp at macports.org>, The MacPorts Project.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -14,11 +12,14 @@
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in the
# documentation and/or other materials provided with the distribution.
+# 3. Neither the name of Apple, Inc., The MacPorts Project nor the
+# names of its contributors may be used to endorse or promote products
+# derived from this software without specific prior written permission.
#
-# THIS SOFTWARE IS PROVIDED BY Eric Melville AND CONTRIBUTORS ``AS IS'' AND
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
@@ -31,62 +32,136 @@
# $Id$
-BINPATH=/opt/local/bin
-SBINPATH=/opt/local/sbin
+#set -x
+# Script identification ('cause more often than not the svn Id is not expanded):
+VERSION=1.7.0
-echo -e "\nChecking the PATH variable for $USER...\n"
+# Abstraction variables:
+PREFIX=/opt/local
+BINPATH=${PREFIX}/bin
+SBINPATH=${PREFIX}/sbin
+MANPAGES=${PREFIX}/share/man
+TIMESTAMP=$(date +"%Y-%m-%d_at_%H:%M:%S")
+BACKUP_SUFFIX=macports-saved_${TIMESTAMP}
+OUR_STRING="MacPorts Installer addition on ${TIMESTAMP}"
-# No need to do any path adjustments if we're on Leopard, as we already install our path configs into /etc/paths.d/ and /etc/manpaths.d/
-if [ $(sw_vers -productVersion | awk -F . '{print $2}') -eq 5 ]; then
- echo "No need to adjust the PATH and MANPATH environment variables on Leopard!"
- exit 0
-fi
-if $SHELL -c "/usr/bin/printenv PATH" | grep -c $BINPATH > /dev/null; then
- echo "You already have the right PATH!"
-else
- USHELL=`basename $SHELL`
- echo "Setting the PATH of $USHELL for $USER in ${HOME:=/Users/$USER}..."
- case $USHELL in
- *csh)
- # we backup the original
- /bin/cp -fp $HOME/.cshrc $HOME/.cshrc.mpsaved
- echo "#" >> $HOME/.cshrc
- echo "# Your previous .cshrc (if any) is saved as .cshrc.mpsaved" >> $HOME/.cshrc
- echo "# Setting the path for MacPorts." >> $HOME/.cshrc
- echo "set path=($BINPATH $SBINPATH" '$path'")" >> $HOME/.cshrc
- chown $USER $HOME/.cshrc
- echo "Finished modifying $HOME/.cshrc"
+# Command to update the MacPorts installation through "selfupdate":
+function update_macports {
+ echo "Synchronizing the MacPorts installation with the project's rsync server..."
+ if ! ${BINPATH}/port -v selfupdate; then
+ echo "An attempt to synchronize your recent MacPorts installation with the project's rsync server failed!"
+ echo "Please run 'sudo port -d selfupdate' manually to find out the cause of the error."
+ else
+ echo "Successful!"
+ fi
+}
+
+# Through this command we write an environment variable to an appropriate shell configuration file,
+# backing up the original only if it exists and if it doesn't contain the ${OUR_STRING} identification string,
+# which hints that we've already tweaked it and therefore already baked it up.
+function write_setting () {
+ if [ -f ${HOME}/.${CONF_FILE} ] && ! grep "${OUR_STRING}" ${HOME}/.${CONF_FILE} > /dev/null; then
+ echo "Backing up your ${HOME}/.${CONF_FILE} shell confguration file as ${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX} before adapting it for MacPorts."
+ /bin/cp -fp ${HOME}/.${CONF_FILE} "${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX}" || {
+ echo "An attempt to backup your original configuration file failed! Please set your MacPorts compatible environment manually."
+ update_macports
+ exit 1
+ }
+ echo -e "\n##\n# Your previous ${HOME}/.${CONF_FILE} file was backed up as ${HOME}/.${CONF_FILE}.${BACKUP_SUFFIX}\n##" >> ${HOME}/.${CONF_FILE}
+ fi
+ echo -e "\n# ${OUR_STRING}: adding an appropriate ${1} variable for use with MacPorts." >> ${HOME}/.${CONF_FILE}
+ echo "${ENV_COMMAND} ${1}${ASSIGN}${2}" >> ${HOME}/.${CONF_FILE}
+ echo -e "# Finished adapting your ${1} environment variable for use with MacPorts.\n" >> ${HOME}/.${CONF_FILE}
+ chown ${USER} ${HOME}/.${CONF_FILE} || echo "Warning: unable to adapt permissions on your ${HOME}/.${CONF_FILE} shell configuration file!"
+ echo "An appropriate ${1} variable has been added to your shell environment by the MacPorts installer."
+}
+
+function cleanup_man () {
+ # Remove old non-compressed man pages
+ echo -e "\nRemoving old man pages..."
+ MAN1="port.1"
+ MAN5="macports.conf.5"
+ MAN7="portfile.7 portstyle.7 porthier.7 portgroup.7"
+ for m in ${MAN1}; do rm -vf ${MANPAGES}/man1/$m ; done
+ for m in ${MAN5}; do rm -vf ${MANPAGES}/man5/$m ; done
+ for m in ${MAN7}; do rm -vf ${MANPAGES}/man7/$m ; done
+ echo -e "Done.\n"
+}
+
+
+echo "The MacPorts Project, postflight script version ${VERSION}: checking the shell environment for user \"${USER}\"."
+
+# Remove old stuff
+cleanup_man
+
+# Determine the user's shell, in order to choose an appropriate configuration file we'll be tweaking.
+# Exit nicely if the shell is any other than bash or tcsh, as that's considered non-standard.
+USHELL=$(dscl . -read /users/${USER} shell | awk -F'/' '{print $NF}') || {
+ echo "An attempt to determine your shell name failed! Please set your MacPorts compatible environment manually."
+ update_macports
+ exit 1
+}
+case "${USHELL}" in
+ tcsh)
+ echo "Detected the tcsh shell."
+ LOGIN_FLAG=""
+ ENV_COMMAND="setenv"
+ ASSIGN=" "
+ CONF_FILE=tcshrc
;;
- *sh)
- # we backup the original
- /bin/cp -fp $HOME/.profile $HOME/.profile.mpsaved
- echo "#" >> $HOME/.profile
- echo "# Your previous .profile (if any) is saved as .profile.mpsaved" >> $HOME/.profile
- echo "# Setting the path for MacPorts." >> $HOME/.profile
- echo "export PATH=$BINPATH:$SBINPATH:\$PATH" >> $HOME/.profile
- chown $USER $HOME/.profile
- echo "Finished modifying $HOME/.profile"
+ bash)
+ echo "Detected the bash shell."
+ LOGIN_FLAG="-l"
+ ENV_COMMAND="export"
+ ASSIGN="="
+ CONF_FILE=profile
;;
- *)
- echo "Unknown shell! Please set your own PATH manually."
+ *)
+ echo "Unknown shell ($USHELL)! Please set your MacPorts compatible environment manually."
+ update_macports
+ exit 0
;;
- esac
+esac
+
+
+# Adding our setting to the PATH variable if not already there:
+if ${SHELL} ${LOGIN_FLAG} -c "/usr/bin/printenv PATH" | grep ${PREFIX} > /dev/null; then
+ echo "Your shell already has the right PATH environment variable for use with MacPorts!"
+else
+ write_setting PATH "${BINPATH}:${SBINPATH}:\$PATH"
fi
+# We gather the path into a variable of our own for faster operation:
+ORIGINAL_MANPATH="$(${SHELL} ${LOGIN_FLAG} -c "/usr/bin/printenv MANPATH")"
+# Adding out setting to the MANPATH variable only if it exists:
+if ! ${SHELL} ${LOGIN_FLAG} -c "/usr/bin/env | grep MANPATH" > /dev/null || \
+# and following that, if it's not empty:
+ [ -z "${ORIGINAL_MANPATH}" ] || \
+# or if it doesn't already contain our path:
+ echo "${ORIGINAL_MANPATH}" | grep ${MANPAGES} > /dev/null || \
+# or if there's no empty component somewhere in the middle of it:
+ echo "${ORIGINAL_MANPATH}" | grep :: > /dev/null || \
+# or at the start of it:
+ [ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $1}')" ] || \
+# or at the end of it:
+ [ -z "$(echo "${ORIGINAL_MANPATH}" | awk -F : '{print $NF}')" ]; then
+ echo "Your shell already has the right MANPATH environment variable for use with MacPorts!"
+else
+ write_setting MANPATH "${MANPAGES}:\$MANPATH"
+fi
-# Run selfupdate:
-export PATH=$BINPATH:$PATH
-echo -e "\nSelfupdating The MacPorts system...\n"
-port -d selfupdate
-if [ $? != 0 ]; then
- echo "An attempt to synchronize your recent MacPorts installation with the rsync server failed, please run 'port -d selfupdate' manually to find out the cause of the error."
- exit 1
+# Adding a DISPLAY variable only if we're running on Tiger or less and if it doesn't already exist:
+if (($(sw_vers -productVersion | awk -F . '{print $2}') >= 5)) || ${SHELL} ${LOGIN_FLAG} -c "/usr/bin/env | grep DISPLAY" > /dev/null; then
+ echo "Your shell already has the right DISPLAY environment variable for use with MacPorts!"
+else
+ write_setting DISPLAY ":0"
fi
-# Postflight script is done with its job!
-echo -e "\nYou have succesfully installed the MacPorts system.\n"
-echo "Launch a terminal and try it out!"
-echo -e "Read the port manual page for help.\n"
+# Postflight script is done with its job, update MacPorts and exit gracefully!
+update_macports
+echo "You have succesfully installed the MacPorts system, launch a terminal and try it out!"
+echo "Read the port(1) manual page and http://guide.macports.org for help, http://www.macports.org/contact.php if you need to get in touch with The MacPorts Project."
+exit 0
Modified: branches/variant-descs-14482/base/portmgr/jobs/PortIndexRegen.sh
===================================================================
--- branches/variant-descs-14482/base/portmgr/jobs/PortIndexRegen.sh 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/portmgr/jobs/PortIndexRegen.sh 2008-07-06 16:38:22 UTC (rev 38100)
@@ -127,7 +127,7 @@
echo "" >> $COMMIT_MSG
grep Failed $FAILURE_LOG >> $COMMIT_MSG
{ cd ${SRCTREE}/dports/ && \
- svn --config-dir $SVN_CONFIG_DIR commit -F $COMMIT_MSG PortIndex > $FAILURE_LOG 2>&1 ; } \
+ $SVN --config-dir $SVN_CONFIG_DIR commit -F $COMMIT_MSG PortIndex > $FAILURE_LOG 2>&1 ; } \
|| { echo "SVN commit failed." >> $FAILURE_LOG ; bail ; }
# At this point the index was committed successfuly, so we cleanup before we exit.
Modified: branches/variant-descs-14482/base/src/cregistry/registry.c
===================================================================
--- branches/variant-descs-14482/base/src/cregistry/registry.c 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/cregistry/registry.c 2008-07-06 16:38:22 UTC (rev 38100)
@@ -162,12 +162,13 @@
if (stat(path, &sb) != 0) {
initialized = 0;
if (errno == ENOENT) {
- char *mypath = strdup(path);
- mypath = dirname(mypath);
- if (stat(mypath, &sb) != 0) {
+ char *dirc, *dname;
+ dirc = strdup(path);
+ dname = dirname(dirc);
+ if (stat(dname, &sb) != 0) {
can_write = 0;
}
- free(mypath);
+ free(dirc);
} else {
can_write = 0;
}
Modified: branches/variant-descs-14482/base/src/macports1.0/macports.tcl
===================================================================
--- branches/variant-descs-14482/base/src/macports1.0/macports.tcl 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/macports1.0/macports.tcl 2008-07-06 16:38:22 UTC (rev 38100)
@@ -456,23 +456,12 @@
if {[catch {file mkdir $portdbpath} result]} {
return -code error "portdbpath $portdbpath does not exist and could not be created: $result"
}
+ } else {
+ return -code error "$portdbpath is not a directory. Please create the directory $portdbpath and try again"
}
}
- if {![file isdirectory $portdbpath]} {
- return -code error "$portdbpath is not a directory. Please create the directory $portdbpath and try again"
- }
set registry.path $portdbpath
- if {![file isdirectory ${registry.path}]} {
- if {![file exists ${registry.path}]} {
- if {[catch {file mkdir ${registry.path}} result]} {
- return -code error "portdbpath ${registry.path} does not exist and could not be created: $result"
- }
- }
- }
- if {![file isdirectory ${macports::registry.path}]} {
- return -code error "${macports::registry.path} is not a directory. Please create the directory $portdbpath and try again"
- }
# Format for receipts, can currently be either "flat" or "sqlite"
if {[info exists portdbformat]} {
Modified: branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c
===================================================================
--- branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/pextlib1.0/Pextlib.c 2008-07-06 16:38:22 UTC (rev 38100)
@@ -1194,8 +1194,8 @@
Tcl_CreateObjCommand(interp, "mkchannelfromfd", MkChannelFromFdCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "pipe", PipeCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "curl", CurlCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "symlink", CreateSymlinkCmd, NULL, NULL);
- Tcl_CreateObjCommand(interp, "unsetenv", UnsetEnvCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "symlink", CreateSymlinkCmd, NULL, NULL);
+ Tcl_CreateObjCommand(interp, "unsetenv", UnsetEnvCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "readline", ReadlineCmd, NULL, NULL);
Tcl_CreateObjCommand(interp, "rl_history", RLHistoryCmd, NULL, NULL);
Modified: branches/variant-descs-14482/base/src/pextlib1.0/filemap.c
===================================================================
--- branches/variant-descs-14482/base/src/pextlib1.0/filemap.c 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/pextlib1.0/filemap.c 2008-07-06 16:38:22 UTC (rev 38100)
@@ -1003,7 +1003,7 @@
if (inRoot->fNodeType == kLeaf)
{
/* it's a leaf. Does the value match? */
- if (strcmp(((SLeaf*) inRoot)->fValue, inValue) == 0)
+ if (strcasecmp(((SLeaf*) inRoot)->fValue, inValue) == 0)
{
/* It matches. */
char* thePath = ckalloc(inSubpathLen + NAME_MAX + 1);
Modified: branches/variant-descs-14482/base/src/port/port.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port/port.tcl 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/port/port.tcl 2008-07-06 16:38:22 UTC (rev 38100)
@@ -55,7 +55,6 @@
puts stderr "\"$cmdname help\" or \"man 1 port\" for more information."
}
-
proc print_help {args} {
global cmdname
global action_array
@@ -97,9 +96,10 @@
These pseudo-portnames expand to the set of ports named.
Additional pseudo-portnames start with...
-variants:, variant:, description:, portdir:, homepage:, epoch:,
-platforms:, platform:, name:, long_description:, maintainers:,
-maintainer:, categories:, category:, version:, and revision:.
+variants:, variant:, description:, depends:, depends_lib:, depends_run:,
+depends_build:, portdir:, homepage:, epoch:, platforms:, platform:, name:,
+long_description:, maintainers:, maintainer:, categories:, category:, version:,
+and revision:.
These each select a set of ports based on a regex search of metadata
about the ports. In all such cases, a standard regex pattern following
the colon will be used to select the set of ports to which the
@@ -356,7 +356,7 @@
proc portlist_compare { a b } {
array set a_ $a
array set b_ $b
- set namecmp [string compare $a_(name) $b_(name)]
+ set namecmp [string compare -nocase $a_(name) $b_(name)]
if {$namecmp != 0} {
return $namecmp
}
@@ -408,10 +408,6 @@
regexp {(\d+) (\d+)} $err -> rows cols
set env(COLUMNS) $cols
set env(LINES) $rows
- } else {
- puts stderr "Warning: Unable to get terminal size, using 80x24!"
- set cols 80
- set rows 24
}
}
}
@@ -429,6 +425,10 @@
global env
if {$maxlen == 0} {
+ if {![info exists env(COLUMNS)]} {
+ # no width for wrapping
+ return $string
+ }
set maxlen $env(COLUMNS)
}
@@ -452,6 +452,10 @@
global env
if {$maxlen == 0} {
+ if {![info exists env(COLUMNS)]} {
+ # no width for wrapping
+ return $string
+ }
set maxlen $env(COLUMNS)
}
@@ -860,6 +864,9 @@
^categories: -
^category: -
^version: -
+ ^depends_lib: -
+ ^depends_build: -
+ ^depends_run: -
^revision: { # Handle special port selectors
advance
@@ -877,6 +884,19 @@
set el 1
}
+ ^depends: { # A port selector shorthand for depends_lib, depends_build or depends_run
+ advance
+
+ # Break up the token, because older Tcl switch doesn't support -matchvar
+ regexp {^(\w+):(.*)} $token matchvar field pat
+
+ add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_lib"]
+ add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_build"]
+ add_multiple_ports reslist [get_matching_ports $pat no regexp "depends_run"]
+
+ set el 1
+ }
+
[][?*] { # Handle portname glob patterns
advance; add_multiple_ports reslist [get_matching_ports $token no glob]
set el 1
@@ -1189,18 +1209,23 @@
##########################################
proc action_get_usage { action } {
- global action_array cmd_args_array
+ global action_array cmd_opts_array
if {[info exists action_array($action)]} {
set cmds ""
- if {[info exists cmd_args_array($action)]} {
- foreach cmd $cmd_args_array($action) {
- set name [lindex $cmd 0]
- set argc [lindex $cmd 1]
+ if {[info exists cmd_opts_array($action)]} {
+ foreach opt $cmd_opts_array($action) {
+ if {[llength $opt] == 1} {
+ set name $opt
+ set optc 0
+ } else {
+ set name [lindex $opt 0]
+ set optc [lindex $opt 1]
+ }
append cmds " --$name"
- for {set i 1} {$i <= $argc} {incr i} {
+ for {set i 1} {$i <= $optc} {incr i} {
append cmds " <arg$i>"
}
}
@@ -2237,6 +2262,8 @@
# Operations on the port's directory and Portfile
global env boot_env
global current_portdir
+
+ array set local_options $opts
set status 0
if {[require_portlist portlist]} {
@@ -2288,10 +2315,16 @@
# Find an editor to edit the portfile
set editor ""
- foreach ed { VISUAL EDITOR } {
- if {[info exists env($ed)]} {
- set editor $env($ed)
- break
+ if {[info exists local_options(ports_edit_editor)]} {
+ set editor $local_options(ports_edit_editor)
+ } elseif {[info exists local_options(ports_ed_editor)]} {
+ set editor $local_options(ports_ed_editor)
+ } else {
+ foreach ed { VISUAL EDITOR } {
+ if {[info exists env($ed)]} {
+ set editor $env($ed)
+ break
+ }
}
}
@@ -2612,25 +2645,25 @@
return $ret
}
-# cmd_args_array specifies which arguments the commands accept
+# cmd_opts_array specifies which arguments the commands accept
# Commands not listed here do not accept any arguments
# Syntax if {option argn}
# Where option is the name of the option and argn specifies how many arguments
# this argument takes
-global cmd_args_array
-array set cmd_args_array {
- info {{category 0} {categories 0} {depends_build 0} {depends_lib 0}
- {depends_run 0} {depends 0} {description 0} {epoch 0}
- {homepage 0} {index 0} {line 0} {long_description 0}
- {maintainer 0} {maintainers 0} {name 0} {platform 0}
- {platforms 0} {portdir 0} {revision 0} {variant 0} {variants 0}
- {version 0}}
- search {{line 0}}
- selfupdate {{nosync 0} {pretend 0}}
- uninstall {{follow-dependents 0}}
- variants {{index 0}}
- clean {{all 0} {archive 0} {dist 0} {work 0}}
- mirror {{new 0}}
+global cmd_opts_array
+array set cmd_opts_array {
+ edit {{editor 1}}
+ ed {{editor 1}}
+ info {category categories depends_build depends_lib depends_run
+ depends description epoch homepage index line long_description
+ maintainer maintainers name platform platforms portdir
+ revision variant variants version}
+ search {line}
+ selfupdate {nosync pretend}
+ uninstall {follow-dependents}
+ variants {index}
+ clean {all archive dist work}
+ mirror {new}
}
##
@@ -2641,19 +2674,24 @@
# @param upoptargc reference to upvar for storing the number of arguments for
# this option
proc cmd_option_exists { action option {upoptargc ""}} {
- global cmd_args_array
+ global cmd_opts_array
upvar 1 $upoptargc optargc
# This could be so easy with lsearch -index,
# but that's only available as of Tcl 8.5
- if {![info exists cmd_args_array($action)]} {
+ if {![info exists cmd_opts_array($action)]} {
return 0
}
- foreach item $cmd_args_array($action) {
- set name [lindex $item 0]
- set argc [lindex $item 1]
+ foreach item $cmd_opts_array($action) {
+ if {[llength $item] == 1} {
+ set name $item
+ set argc 0
+ } else {
+ set name [lindex $item 0]
+ set argc [lindex $item 1]
+ }
if {$name == $option} {
set optargc $argc
@@ -2675,7 +2713,7 @@
proc parse_options { action ui_options_name global_options_name } {
upvar $ui_options_name ui_options
upvar $global_options_name global_options
- global cmdname cmd_args_array
+ global cmdname cmd_opts_array
while {[moreargs]} {
set arg [lookahead]
Modified: branches/variant-descs-14482/base/src/port1.0/portextract.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portextract.tcl 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/port1.0/portextract.tcl 2008-07-06 16:38:22 UTC (rev 38100)
@@ -92,7 +92,7 @@
}
proc extract_main {args} {
- global UI_PREFIX
+ global UI_PREFIX filespath
if {![exists distfiles] && ![exists extract.only]} {
# nothing to do
@@ -101,7 +101,11 @@
foreach distfile [option extract.only] {
ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] $distfile]"
- option extract.args "[option distpath]/$distfile"
+ if {[file exists $filespath/$distfile]} {
+ option extract.args "$filespath/$distfile"
+ } else {
+ option extract.args "[option distpath]/$distfile"
+ }
if {[catch {command_exec extract} result]} {
return -code error "$result"
}
Modified: branches/variant-descs-14482/base/src/port1.0/portfetch.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portfetch.tcl 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/port1.0/portfetch.tcl 2008-07-06 16:38:22 UTC (rev 38100)
@@ -256,7 +256,22 @@
}
}
+ # add in the global and fallback mirrors for each tag
foreach site $site_list {
+ if {[regexp {([a-zA-Z]+://.+/?):([0-9A-Za-z_-]+)$} $site match site tag]} {
+ if {![info exists extras_added($tag)]} {
+ set site_list [concat $site_list [mirror_sites $global_mirror_site $tag ""] [mirror_sites $fallback_mirror_site $tag ""]]
+ if {[string equal $list master_sites] && [info exists env(MASTER_SITE_LOCAL)]} {
+ set site_list [concat [list $env(MASTER_SITE_LOCAL)] $site_list]
+ } elseif {[string equal $list patch_sites] && [info exists env(PATCH_SITE_LOCAL)]} {
+ set site_list [concat [list $env(PATCH_SITE_LOCAL)] $site_list]
+ }
+ set extras_added($tag) yes
+ }
+ }
+ }
+
+ foreach site $site_list {
if {[regexp {([a-zA-Z]+://.+/?):([0-9A-Za-z_-]+)$} $site match site tag]} {
lappend portfetch::$tag $site
} else {
Modified: branches/variant-descs-14482/base/src/port1.0/portlint.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/portlint.tcl 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/port1.0/portlint.tcl 2008-07-06 16:38:22 UTC (rev 38100)
@@ -271,6 +271,11 @@
}
}
+ if {[regexp {(^|\s)configure\s+\{\s*\}} $line]} {
+ ui_warn "Line $lineno should say \"use_configure no\" instead of declaring an empty configure phase"
+ incr warnings
+ }
+
### TODO: more checks to Portfile syntax
incr lineno
Modified: branches/variant-descs-14482/base/src/port1.0/resources/fetch/mirror_sites.tcl
===================================================================
--- branches/variant-descs-14482/base/src/port1.0/resources/fetch/mirror_sites.tcl 2008-07-06 16:33:48 UTC (rev 38099)
+++ branches/variant-descs-14482/base/src/port1.0/resources/fetch/mirror_sites.tcl 2008-07-06 16:38:22 UTC (rev 38100)
@@ -258,6 +258,7 @@
set portfetch::mirror_sites::sites(sourceforge) {
http://downloads.sourceforge.net/
+ http://internode.dl.sourceforge.net/
http://easynews.dl.sourceforge.net/
http://ufpr.dl.sourceforge.net/
http://kent.dl.sourceforge.net/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080706/6aa6f2c8/attachment-0001.html
More information about the macports-changes
mailing list