Changeset 14736 for trunk/base
- Timestamp:
- Oct 20, 2005, 9:26:43 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/port/port.tcl
r14667 r14736 3 3 exec @TCLSH@ "$0" "$@" 4 4 # port.tcl 5 # $Id: port.tcl,v 1.13 6 2005/10/17 00:45:14jberry Exp $5 # $Id: port.tcl,v 1.137 2005/10/20 21:26:43 jberry Exp $ 6 6 # 7 7 # Copyright (c) 2004 Robert Shaw <rshaw@opendarwin.org> … … 155 155 156 156 Valid actions are: 157 help, info, location, provides, activate, deactivate, selfupdate, 158 upgrade, version, compact, uncompact, uninstall, installed, outdated,159 contents, deps, variants, search, list, echo, sync, dir, file, cat, edit,157 help, info, location, provides, activate, deactivate, selfupdate, upgrade, 158 version, compact, uncompact, uninstall, installed, outdated, contents, deps, 159 variants, search, list, echo, sync, dir, url, file, cat, edit, 160 160 fetch, patch, extract, build, destroot, install, test. 161 161 … … 343 343 344 344 proc url_to_portname { url } { 345 # Save directory and restore the directory, since dportopen changes it 346 set savedir [pwd] 347 set portname "" 345 348 if {[catch {set ctx [dportopen $url]} result]} { 346 349 puts stderr "Can't map the URL '$url' to a port description file (${result}). Please verify that the directory and portfile syntax are correct." 347 return ""348 350 } else { 349 351 array set portinfo [dportinfo $ctx] 350 352 set portname $portinfo(name) 351 353 dportclose $ctx 352 return $portname 353 } 354 } 355 cd $savedir 356 return $portname 354 357 } 355 358 … … 381 384 # will have been set 382 385 proc foreachport {portlist block} { 386 # Restore cwd after each port, since dportopen changes it, and relative 387 # urls will break on subsequent passes 388 set savedir [pwd] 383 389 foreach portspec $portlist { 384 390 uplevel 1 "array set portspec { $portspec }" … … 393 399 } 394 400 uplevel 1 $block 401 cd $savedir 395 402 } 396 403 } … … 1106 1113 D { advance 1107 1114 set global_porturl "file://[lookahead]" 1115 break 1108 1116 } 1109 u{ advance1117 U { advance 1110 1118 set global_porturl [lookahead] 1119 break 1111 1120 } 1112 1121 default { … … 1713 1722 cat - 1714 1723 dir - 1724 url - 1715 1725 file { 1716 1726 # Operations on the port's directory and Portfile … … 1733 1743 } 1734 1744 1735 set portdir [darwinports::getportdir $porturl $portdir] 1745 set portdir [file normalize [darwinports::getportdir $porturl $portdir]] 1746 set porturl "file://${portdir}"; # Rebuild url so it's fully qualified 1736 1747 set portfile "${portdir}/Portfile" 1737 1748 … … 1785 1796 } 1786 1797 1798 url { 1799 # output the url of the port's directory, suitable to feed back in later as a port descriptor 1800 puts $porturl 1801 } 1802 1787 1803 file { 1788 1804 # output the path to the port's portfile
Note: See TracChangeset
for help on using the changeset viewer.