Ticket #43208: PortIndex2MySQL.tcl.diff
File PortIndex2MySQL.tcl.diff, 2.2 KB (added by ryandesign (Ryan Carsten Schmidt), 11 years ago) |
---|
-
PortIndex2MySQL.tcl
1 #!/ opt/local/bin/tclsh1 #!/bin/sh 2 2 # -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 3 # $Id$ 3 4 # 4 # PortIndex2MySQL.tcl5 5 # Kevin Van Vechten | kevin@opendarwin.org 6 6 # 3-Oct-2002 7 7 # Juan Manuel Palacios | jmpp@macports.org 8 8 # 22-Nov-2007 9 # $Id$10 9 # 11 10 # Copyright (c) 2007 Juan Manuel Palacios, The MacPorts Project. 12 11 # Copyright (c) 2003 Apple Inc. … … 37 36 # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 38 37 # POSSIBILITY OF SUCH DAMAGE. 39 38 39 # A short Bourne shell script to relaunch this file under MacPorts' tclsh.\ 40 PORT="$(which port 2>&1)" #\ 41 if [ ! -x "$PORT" ]; then #\ 42 echo "Could not find port command in PATH." 1>&2 #\ 43 exit 1 #\ 44 fi #\ 45 MACPORTS_PREFIX=${PORT%/bin/port} #\ 46 exec "$MACPORTS_PREFIX/libexec/macports/bin/tclsh8.5" "$0" "$@" 40 47 48 41 49 ##### 42 50 # The PortIndex2MySQL script populates a database with key information extracted 43 51 # from the Portfiles in the ports tree pointed to by the sources.conf file in a … … 57 65 # setup. 58 66 ##### 59 67 68 set macports_prefix [file join {*}[lrange [file split [info nameofexecutable]] 0 end-4]] 60 69 61 70 62 71 # Runtime information log file and reciepient. … … 178 187 } 179 188 180 189 # Load macports1.0 so that we can use some of its procs and the portinfo array. 181 if {[catch { source [file join "@macports_tcl_dir@"macports1.0 macports_fastload.tcl] } errstr]} {190 if {[catch { source [file join $macports_prefix share macports Tcl macports1.0 macports_fastload.tcl] } errstr]} { 182 191 puts $runlog_fd "${::errorInfo}" 183 192 puts $runlog_fd "Failed to locate the macports1.0 Tcl package file: $errstr" 184 193 cleanup lockfile … … 208 217 set portsdb_host localhost 209 218 set portsdb_name macports 210 219 set portsdb_user macports 211 set passwdfile "/opt/local/share/macports/resources/portmgr/password_file"220 set passwdfile [file join $macports_prefix share macports resources portmgr password_file] 212 221 set portsdb_passwd [getpasswd $passwdfile] 213 222 set portsdb_cmd [macports::findBinary mysql5] 214 223