[39036] trunk/base/src/port/port.tcl

raimue at macports.org raimue at macports.org
Wed Aug 6 06:56:52 PDT 2008


Revision: 39036
          http://trac.macosforge.org/projects/macports/changeset/39036
Author:   raimue at macports.org
Date:     2008-08-06 06:56:52 -0700 (Wed, 06 Aug 2008)
Log Message:
-----------
port/port.tcl:
In 'port gohome', use homepage variable from PortIndex if available. Otherwise
read it from the Portfile. This way, this command works faster. Closes #16146.

Modified Paths:
--------------
    trunk/base/src/port/port.tcl

Modified: trunk/base/src/port/port.tcl
===================================================================
--- trunk/base/src/port/port.tcl	2008-08-06 13:36:49 UTC (rev 39035)
+++ trunk/base/src/port/port.tcl	2008-08-06 13:56:52 UTC (rev 39036)
@@ -2377,19 +2377,27 @@
                 }
 
                 gohome {
-                    # Get the homepage for the port by opening the portfile
-                    if {![catch {set ctx [mportopen $porturl]} result]} {
+                    set homepage ""
+
+                    # Get the homepage as read from PortIndex
+                    if {[info exists portinfo(homepage)]} {
+                        set homepage $portinfo(homepage)
+                    }
+
+                    # If not available, get the homepage for the port by opening the Portfile
+                    if {$homepage == "" && ![catch {set ctx [mportopen $porturl]} result]} {
                         array set portinfo [mportinfo $ctx]
-                        set homepage $portinfo(homepage)
+                        if {[info exists portinfo(homepage)]} {
+                            set homepage $portinfo(homepage)
+                        }
                         mportclose $ctx
                     }
 
                     # Try to open a browser to the homepage for the given port
-                    set homepage $portinfo(homepage)
                     if { $homepage != "" } {
                         system "${macports::autoconf::open_path} $homepage"
                     } else {
-                        puts "(no homepage)"
+                        ui_error [format "No homepage for %s" $portname]
                     }
                 }
             }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080806/f2ad84b2/attachment.html 


More information about the macports-changes mailing list