[25443] branches/dp2mp-move/base/src

source_changes at macosforge.org source_changes at macosforge.org
Mon May 21 22:55:41 PDT 2007


Revision: 25443
          http://trac.macosforge.org/projects/macports/changeset/25443
Author:   jmpp at macports.org
Date:     2007-05-21 22:55:40 -0700 (Mon, 21 May 2007)

Log Message:
-----------
Merging eridius' r25157: Declare file descriptors to be utf-8 and get rid of useless catches.

Modified Paths:
--------------
    branches/dp2mp-move/base/src/macports1.0/macports.tcl
    branches/dp2mp-move/base/src/port/portindex.tcl

Modified: branches/dp2mp-move/base/src/macports1.0/macports.tcl
===================================================================
--- branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-05-22 05:41:53 UTC (rev 25442)
+++ branches/dp2mp-move/base/src/macports1.0/macports.tcl	2007-05-22 05:55:40 UTC (rev 25443)
@@ -303,6 +303,7 @@
 		if [file exists $file] {
 			set portconf $file
 			set fd [open $file r]
+		        fconfigure $fd -encoding utf-8
 			while {[gets $fd line] >= 0} {
 				if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
 					if {[lsearch $bootstrap_options $option] >= 0} {
@@ -320,6 +321,7 @@
         set per_user "${macports_user_dir}/user.conf"
 	if [file exists $per_user] {
 		set fd [open $per_user r]
+	        fconfigure $fd -encoding utf-8
 		while {[gets $fd line] >= 0} {
 			if {[regexp {^(\w+)([ \t]+(.*))?$} $line match option ignore val] == 1} {
 				if {[lsearch $user_options $option] >= 0} {
@@ -352,9 +354,8 @@
 
 	if {[info exists variants_conf]} {
 		if {[file exist $variants_conf]} {
-			if {[catch {set fd [open $variants_conf r]} result]} {
-				return -code error "$result"
-			}
+		        set fd [open $variants_conf r]
+		        fconfigure $fd -encoding utf-8
 			while {[gets $fd line] >= 0} {
 				set line [string trimright $line]
 				if {![regexp {^[\ \t]*#.*$|^$} $line]} {
@@ -723,18 +724,14 @@
     global macports::portdbpath tcl_platform
     set fetchdir [file join $portdbpath portdirs]
     set fetchfile [file tail $url]
-    if {[catch {file mkdir $fetchdir} result]} {
-        return -code error $result
-    }
+    file mkdir $fetchdir
     if {![file writable $fetchdir]} {
     	return -code error "Port remote fetch failed: You do not have permission to write to $fetchdir"
     }
     if {[catch {exec curl -L -s -S -o [file join $fetchdir $fetchfile] $url} result]} {
         return -code error "Port remote fetch failed: $result"
     }
-    if {[catch {cd $fetchdir} result]} {
-	return -code error $result
-    }
+    cd $fetchdir
     if {[catch {exec tar -zxf $fetchfile} result]} {
 	return -code error "Port extract failed: $result"
     }
@@ -1238,9 +1235,7 @@
 	    }
 	    {^https?$|^ftp$} {
 		set indexfile [macports::getindex $source]
-		if {[catch {file mkdir [file dirname $indexfile]} result]} {
-		    return -code error $result
-		}
+		file mkdir [file dirname $indexfile]
 		exec curl -L -s -S -o $indexfile $source/PortIndex
 	    }
 	}
@@ -1262,6 +1257,7 @@
 			if {[catch {set fd [open [macports::getindex $source] r]} result]} {
 				ui_warn "Can't open index file for source: $source"
 			} else {
+			        fconfigure $fd -encoding utf-8
 				incr found 1
 				while {[gets $fd line] >= 0} {
 					array unset portinfo

Modified: branches/dp2mp-move/base/src/port/portindex.tcl
===================================================================
--- branches/dp2mp-move/base/src/port/portindex.tcl	2007-05-22 05:41:53 UTC (rev 25442)
+++ branches/dp2mp-move/base/src/port/portindex.tcl	2007-05-22 05:55:40 UTC (rev 25443)
@@ -202,6 +202,7 @@
 
 puts "Creating software index in $outdir"
 set fd [open [file join $outdir PortIndex] w]
+fconfigure $fd -encoding utf-8
 mporttraverse pindex $directory
 close $fd
 puts "\nTotal number of ports parsed:\t$stats(total)\

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20070521/aa79fa6f/attachment.html


More information about the macports-changes mailing list