[116518] trunk/base/portmgr/packaging

cal at macports.org cal at macports.org
Mon Jan 27 07:39:11 PST 2014


Revision: 116518
          https://trac.macports.org/changeset/116518
Author:   cal at macports.org
Date:     2014-01-27 07:39:11 -0800 (Mon, 27 Jan 2014)
Log Message:
-----------
portmgr/packaging: whitespace only, unify whitespace, reindent

Modified Paths:
--------------
    trunk/base/portmgr/packaging/dpkgall.tcl
    trunk/base/portmgr/packaging/mpkgall.tcl
    trunk/base/portmgr/packaging/packageall.tcl
    trunk/base/portmgr/packaging/rpmall.tcl

Modified: trunk/base/portmgr/packaging/dpkgall.tcl
===================================================================
--- trunk/base/portmgr/packaging/dpkgall.tcl	2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/dpkgall.tcl	2014-01-27 15:39:11 UTC (rev 116518)
@@ -12,14 +12,14 @@
 # modification, are permitted provided that the following conditions
 # are met:
 # 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
+#	 notice, this list of conditions and the following disclaimer.
 # 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.
+#	 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. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
+#	 may be used to endorse or promote products derived from this software
+#	 without specific prior written permission.
+#
 # 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
@@ -88,20 +88,20 @@
 
 # MacPorts UI Event Callbacks
 proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "Debug: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
+	switch $priority {
+		debug {
+			return "Debug: "
+		}
+		error {
+			return "Error: "
+		}
+		warn {
+			return "Warning: "
+		}
+		default {
+			return ""
+		}
+	}
 }
 
 proc ui_channels {priority} {
@@ -302,7 +302,7 @@
 		exit 0
 	}
 
-	# We must have dpkg by now 
+	# We must have dpkg by now
 	if {[catch {set_architecture} result]} {
 		puts "$result."
 		puts "Have you initialized the build system? Use the -i flag:"
@@ -432,16 +432,16 @@
 		array set portinfo [lindex $res 1]
 
 		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(revision)] || 
+			![info exists portinfo(version)] ||
+			![info exists portinfo(revision)] ||
 			![info exists portinfo(categories)]} {
 			ui_noisy_error "Internal error: $name missing some portinfo keys"
 			close $logfd
 			continue
 		}
 
-        # open correct subport
-        set options(subport) $portinfo(name)
+		# open correct subport
+		set options(subport) $portinfo(name)
 
 		# Skip un-supported ports
 		if {[info exists portinfo(platforms)] && ${anyplatform_flag} != "true"} {
@@ -555,7 +555,7 @@
 		}
 
 		ui_silent "Package build for $portinfo(name) succeeded"
-		
+
 		# Into the apt repository you go!
 		copy_pkg_to_apt $portinfo(name) $portinfo(version) $portinfo(revision) [lindex $portinfo(categories) 0]
 
@@ -597,7 +597,7 @@
 			}
 		}
 
-		if {[info exists newpkglist]} {		
+		if {[info exists newpkglist]} {
 			set pkglist [lsort -unique [concat $newpkglist $pkglist]]
 		}
 
@@ -694,7 +694,7 @@
 	set variations ""
 
 	foreach port [get_required_ports] {
-	    set options(subport) $port
+		set options(subport) $port
 		if {[catch {do_portexec $port [array get options] [array get variants] activate} result]} {
 			global errorInfo
 			ui_debug "$errorInfo"
@@ -718,8 +718,8 @@
 		}
 		ui_msg "Done."
 	}
-			
 
+
 	if {[catch {set_architecture} result]} {
 		puts "Fatal error: $result."
 		exit 1
@@ -858,14 +858,14 @@
 
 proc get_dependencies_recurse {portname includeBuildDeps} {
 	set result {}
-	
+
 	set res [get_portinfo $portname]
 
 	foreach {name array} $res {
 		array set portinfo $array
 		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
-			![info exists portinfo(revision)] || 
+			![info exists portinfo(version)] ||
+			![info exists portinfo(revision)] ||
 			![info exists portinfo(categories)]} {
 			ui_error "Internal error: $name missing some portinfo keys"
 			continue
@@ -877,13 +877,13 @@
 		set depends {}
 		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
 		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} { 
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_build)]} {
 			eval "lappend depends $portinfo(depends_build)"
 		}
-		if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} { 
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_fetch)]} {
 			eval "lappend depends $portinfo(depends_fetch)"
 		}
-		if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} { 
+		if {$includeBuildDeps == "true" && [info exists portinfo(depends_extract)]} {
 			eval "lappend depends $portinfo(depends_extract)"
 		}
 		foreach depspec $depends {
@@ -913,7 +913,7 @@
 	} else {
 		set verstring ${portversion}
 	}
-	
+
 	set receiptdir [file join $portprefix var db receipts ${portname} ${verstring}]
 	set pkgpath [get_pkgpath ${portname} ${portversion} ${portrevision}]
 

Modified: trunk/base/portmgr/packaging/mpkgall.tcl
===================================================================
--- trunk/base/portmgr/packaging/mpkgall.tcl	2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/mpkgall.tcl	2014-01-27 15:39:11 UTC (rev 116518)
@@ -10,14 +10,14 @@
 # modification, are permitted provided that the following conditions
 # are met:
 # 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
+#	 notice, this list of conditions and the following disclaimer.
 # 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.
+#	 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. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
+#	 may be used to endorse or promote products derived from this software
+#	 without specific prior written permission.
+#
 # 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
@@ -53,7 +53,7 @@
 	# XXX: don't overwrite Apple X11
 	# XXX: probably should exclude KDE here too
 	if {$portname == "XFree86"} { return {} }
-	
+
 	if {[catch {set res [mportsearch "^$portname\$"]} error]} {
 		puts stderr "Internal error: port search failed: $error"
 		return
@@ -63,11 +63,11 @@
 		if {![info exists portinfo(name)]} { return -1 }
 		if {![info exists portinfo(version)]} { return -1 }
 		if {![info exists portinfo(categories)]} { return -1 }
-		
+
 		set portname $portinfo(name)
 		set portversion $portinfo(version)
 		set category [lindex $portinfo(categories) 0]
-		
+
 		set depends {}
 		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
 		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
@@ -75,13 +75,13 @@
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set result [copy_package_if_available $dep $basepath $destpath]
-			if {$result == -1} { 
+			if {$result == -1} {
 				return -1
 			} else {
 				eval "lappend dependencies $result"
 			}
 		}
-		
+
 		set pkgname "${portname}-${portversion}.pkg"
 		lappend dependencies $pkgname
 		set pkgpath "${basepath}/${category}/${pkgname}"
@@ -95,7 +95,7 @@
 			return -1
 		}
 	}
-	
+
 	return $dependencies
 }
 
@@ -120,10 +120,10 @@
 }
 
 proc write_welcome_html {filename portname portversion long_description description homepage} {
-    set fd [open ${filename} w+]
-    if {$long_description eq ""} {
-	set long_description $description
-    }
+	set fd [open ${filename} w+]
+	if {$long_description eq ""} {
+		set long_description $description
+	}
 
 puts $fd "
 <html lang=\"en\">
@@ -137,15 +137,15 @@
 <font face=\"Helvetica\">${long_description}</font>
 <p>"
 
-    if {$homepage ne ""} {
-	puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
-    }
+	if {$homepage ne ""} {
+		puts $fd "<font face=\"Helvetica\">${homepage}</font><p>"
+	}
 
-    puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
+	puts $fd "<font face=\"Helvetica\">This installer guides you through the steps necessary to install ${portname} ${portversion} for Mac OS X. To get started, click Continue.</font>
 </body>
 </html>"
 
-    close $fd
+	close $fd
 }
 
 proc write_PkgInfo {infofile} {
@@ -156,11 +156,11 @@
 
 proc mpkg_write_info_plist {infofile portname portversion portrevision destination dependencies} {
 	set vers [split $portversion "."]
-	
+
 	if {[string index $destination end] ne "/"} {
 		append destination /
 	}
-	
+
 	set depxml ""
 	foreach dep $dependencies {
 		append depxml "<dict>
@@ -206,9 +206,9 @@
 # Standard procedures
 
 proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
+	global argv0
+	puts stderr "$argv0: $args"
+	exit
 }
 
 # Main
@@ -217,120 +217,118 @@
 #	set ui_options(ports_verbose) yes
 
 if {[catch {mportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
+	puts "Failed to initialize ports system, $result"
+	exit 1
 }
 
 package require Pextlib
 
 # If no arguments were given, default to all ports.
 if {[llength $argv] == 0} {
-        lappend argv ".*"
+	lappend argv ".*"
 }
 
 foreach pname $argv {
+	if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
+		puts "port search failed: $result"
+		exit 1
+	}
 
-if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
+	foreach {name array} $res {
+		global prefix
+		array unset portinfo
+		array set portinfo $array
 
-foreach {name array} $res {
-	global prefix
-	array unset portinfo
-	array set portinfo $array
+		if {![info exists portinfo(porturl)]} {
+			puts stderr "Internal error: no porturl for $name"
+			continue
+		}
 
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	
-	set pkgbase "/darwinports/pkgs/"
-	set mpkgbase "/darwinports/mpkgs/"
-	set porturl $portinfo(porturl)
-	set prefix "/opt/local"
+		set pkgbase "/darwinports/pkgs/"
+		set mpkgbase "/darwinports/mpkgs/"
+		set porturl $portinfo(porturl)
+		set prefix "/opt/local"
 
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(categories)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set category [lindex $portinfo(categories) 0]
-			set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
-			if {[file readable $mpkgfile] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
-				continue
+		# Skip up-to-date packages
+		if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+			if {[info exists portinfo(name)] &&
+				[info exists portinfo(version)] &&
+				[info exists portinfo(categories)]} {
+				set portname $portinfo(name)
+				set portversion $portinfo(version)
+				set category [lindex $portinfo(categories) 0]
+				set mpkgfile ${mpkgbase}/${category}/${portname}-${portversion}.mpkg/Contents/Info.plist
+				if {[file readable $mpkgfile] && ([file mtime ${mpkgfile}] > [file mtime ${portpath}/Portfile])} {
+					puts stderr "Skipping ${portname}-${portversion}; meta-package is up to date."
+					continue
+				}
 			}
 		}
-	}
-	
-	# Skipt packages which previously failed
-		
-	# Building the mpkg:
-	# - create an mpkg skeleton
-	# - copy dependent pkgs into Contents/Resources directory
 
-	set portname ""
-	set portversion ""
-	set description ""
-	set long_description ""
-	set homepage ""
-	set category ""
+		# Skipt packages which previously failed
 
-	if {[info exists portinfo(name)]} {	set portname $portinfo(name) }
-	if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
-	if {[info exists portinfo(description)]} { set description $portinfo(description) }
-	if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
-	if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
-	if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
-	if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
-	
-	puts "meta-packaging ${category}/${portname}-${portversion}"
+		# Building the mpkg:
+		# - create an mpkg skeleton
+		# - copy dependent pkgs into Contents/Resources directory
 
-	set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
+		set portname ""
+		set portversion ""
+		set description ""
+		set long_description ""
+		set homepage ""
+		set category ""
 
-	if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	
-	# list of .pkg names for dependencies,
-	# built up by copy_package_if_available, and used in the Info.plist
-	set dependencies {}
-	set result [copy_package_if_available ${portname} $pkgbase "${mpkgpath}/Contents/Resources/"]
-	if {$result == -1} {
-		puts stderr "aborting; one or more dependencies was missing."
-		if {[catch {system "rm -R ${mpkgpath}"} error]} {
+		if {[info exists portinfo(name)]} {	set portname $portinfo(name) }
+		if {[info exists portinfo(version)]} { set portversion $portinfo(version) }
+		if {[info exists portinfo(description)]} { set description $portinfo(description) }
+		if {[info exists portinfo(long_description)]} { set long_description $portinfo(long_description) }
+		if {[info exists portinfo(homepage)]} { set homepage $portinfo(homepage) }
+		if {[info exists portinfo(categories)]} { set category [lindex $portinfo(categories) 0] }
+		if {[info exists portinfo(maintainers)]} { set maintainers $portinfo(maintainers) }
+
+		puts "meta-packaging ${category}/${portname}-${portversion}"
+
+		set mpkgpath "${mpkgbase}/${category}/${portname}-${portversion}.mpkg"
+
+		if {[catch {system "mkdir -p -m 0755 ${mpkgpath}/Contents/Resources"} error]} {
 			puts stderr "Internal error: $error"
 		}
-		continue
-	} else {
-		set result [lsort -uniq $result]
-		eval "lappend dependencies $result"
-	}
-	
-	#
-	# Begin quote from portmpkg.tcl
-	#
-    write_PkgInfo ${mpkgpath}/Contents/PkgInfo
-    mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
-    write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
-    # long_description, description, or homepage may not exist
-    foreach variable {long_description description homepage} {
-	if {![info exists $variable]} {
-	    set pkg_$variable ""
-	} else {
-	    set pkg_$variable [set $variable]
-	}
-    }
-    write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
-    file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
+
+		# list of .pkg names for dependencies,
+		# built up by copy_package_if_available, and used in the Info.plist
+		set dependencies {}
+		set result [copy_package_if_available ${portname} $pkgbase "${mpkgpath}/Contents/Resources/"]
+		if {$result == -1} {
+			puts stderr "aborting; one or more dependencies was missing."
+			if {[catch {system "rm -R ${mpkgpath}"} error]} {
+				puts stderr "Internal error: $error"
+			}
+			continue
+		} else {
+			set result [lsort -uniq $result]
+			eval "lappend dependencies $result"
+		}
+
+		#
+		# Begin quote from portmpkg.tcl
+		#
+		write_PkgInfo ${mpkgpath}/Contents/PkgInfo
+		mpkg_write_info_plist ${mpkgpath}/Contents/Info.plist $portname $portversion $prefix $dependencies
+		write_description_plist ${mpkgpath}/Contents/Resources/Description.plist $portname $portversion $description
+		# long_description, description, or homepage may not exist
+		foreach variable {long_description description homepage} {
+			if {![info exists $variable]} {
+				set pkg_$variable ""
+			} else {
+				set pkg_$variable [set $variable]
+			}
+		}
+		write_welcome_html ${mpkgpath}/Contents/Resources/Welcome.html $portname $portversion $pkg_long_description $pkg_description $pkg_homepage
+		file copy -force -- /opt/local/share/darwinports/resources/port1.0/package/background.tiff \
 			${mpkgpath}/Contents/Resources/background.tiff
-	#
-	# End quote from portmpkg.tcl
-	#
+		#
+		# End quote from portmpkg.tcl
+		#
+	}
 }
-
-}
 # end foreach pname

Modified: trunk/base/portmgr/packaging/packageall.tcl
===================================================================
--- trunk/base/portmgr/packaging/packageall.tcl	2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/packageall.tcl	2014-01-27 15:39:11 UTC (rev 116518)
@@ -11,14 +11,14 @@
 # modification, are permitted provided that the following conditions
 # are met:
 # 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
+#	 notice, this list of conditions and the following disclaimer.
 # 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.
+#	 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. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
+#	 may be used to endorse or promote products derived from this software
+#	 without specific prior written permission.
+#
 # 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
@@ -44,82 +44,82 @@
 
 # ui_options accessor
 proc ui_isset {val} {
-    global ui_options
-    if {[info exists ui_options($val)]} {
-	if {$ui_options($val) eq "yes"} {
-	    return 1
+	global ui_options
+	if {[info exists ui_options($val)]} {
+		if {$ui_options($val) eq "yes"} {
+			return 1
+		}
 	}
-    }
-    return 0
+	return 0
 }
 
-# UI Callback 
+# UI Callback
 
 proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "DEBUG: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
+	switch $priority {
+		debug {
+			return "DEBUG: "
+		}
+		error {
+			return "Error: "
+		}
+		warn {
+			return "Warning: "
+		}
+		default {
+			return ""
+		}
+	}
 }
 
 proc ui_channels {priority} {
-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-            	return {stdout}
-            } else {
-            	return {}
-            }
-        }
-        info {
+	global logfd
+	switch $priority {
+		debug {
+			if {[ui_isset ports_debug]} {
+				return {stdout}
+			} else {
+				return {}
+			}
+		}
+		info {
 			# put verbose stuff only to the log file
-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
+			if {[ui_isset ports_verbose]} {
+				return {$logfd}
+			} else {
+				return {}
 			}
 		}
-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
+		msg {
+			if {[ui_isset ports_quiet]} {
+				return {}
 			} else {
 				return {stdout}
 			}
 		}
-        default {
-        	return {stdout}
-        }
-    }
+		default {
+			return {stdout}
+		}
+	}
 }
-	
+
 proc pkg_ui_log {message} {
-    global logfd
-    if {$logfd ne ""} {
-	log_message $logfd $message
-    }
+	global logfd
+	if {$logfd ne ""} {
+		log_message $logfd $message
+	}
 }
 
 proc log_message {channel message} {
-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
+	seek $channel 0 end
+	puts $channel $message
+	flush $channel
 }
 
 # Recursive bottom-up approach of building a list of dependencies.
 proc get_dependencies {portname includeBuildDeps} {
 	set result {}
-	
+
 	if {[catch {set res [mportsearch "^$portname\$"]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
@@ -129,12 +129,12 @@
 	foreach {name array} $res {
 		array set portinfo $array
 		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
+			![info exists portinfo(version)] ||
 			![info exists portinfo(categories)]} {
 			ui_error "Internal error: $name missing some portinfo keys"
 			continue
 		}
-		
+
 		set portname $portinfo(name)
 		set portversion $portinfo(version)
 		set category [lindex $portinfo(categories) 0]
@@ -147,16 +147,16 @@
 		set depends {}
 		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
 		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} { 
+		if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} {
 			eval "lappend depends $portinfo(depends_build)"
 		}
-		if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} { 
+		if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} {
 			eval "lappend depends $portinfo(depends_fetch)"
 		}
-		if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} { 
+		if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} {
 			eval "lappend depends $portinfo(depends_extract)"
 		}
-		
+
 		foreach depspec $depends {
 			set dep [lindex [split $depspec :] end]
 			set x [get_dependencies $dep $includeBuildDeps]
@@ -175,7 +175,7 @@
 	set portname [lindex $dep 0]
 	set portversion [lindex $dep 1]
 	set category [lindex $dep 2]
-	
+
 	set pkgpath ${basepath}/${category}/${portname}-${portversion}.pkg
 	if {[file readable $pkgpath]} {
 		ui_msg "installing binary: $pkgpath"
@@ -194,13 +194,12 @@
 	}
 }
 
-
 # Standard procedures
 
 proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
+	global argv0
+	puts stderr "$argv0: $args"
+	exit
 }
 
 # Main
@@ -209,8 +208,8 @@
 #	set ui_options(ports_verbose) yes
 
 if {[catch {mportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
+	puts "Failed to initialize ports system, $result"
+	exit 1
 }
 
 package require Pextlib
@@ -221,210 +220,208 @@
 }
 
 foreach pname $argv {
+	if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
+		puts "port search failed: $result"
+		exit 1
+	}
 
-if {[catch {set res [mportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
+	set logpath "/darwinports/logs"
+	set logfd ""
 
-set logpath "/darwinports/logs"
-set logfd ""
+	foreach {name array} $res {
+		array unset portinfo
+		array set portinfo $array
 
-foreach {name array} $res {
-	array unset portinfo
-	array set portinfo $array
+		# Start with verbose output off;
+		# this will prevent the repopulation of /opt/local from getting logged.
+		set ui_options(ports_verbose) no
 
-	# Start with verbose output off;
-	# this will prevent the repopulation of /opt/local from getting logged.
-	set ui_options(ports_verbose) no
+		if {![info exists portinfo(porturl)]} {
+			puts stderr "Internal error: no porturl for $name"
+			continue
+		}
 
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	
-	set pkgbase /darwinports/pkgs/
-	set porturl $portinfo(porturl)
+		set pkgbase /darwinports/pkgs/
+		set porturl $portinfo(porturl)
 
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(categories)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set category [lindex $portinfo(categories) 0]
-			set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
-			if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "Skipping ${portname}-${portversion}; package is up to date."
-				continue
+		# Skip up-to-date packages
+		if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+			if {[info exists portinfo(name)] &&
+				[info exists portinfo(version)] &&
+				[info exists portinfo(categories)]} {
+				set portname $portinfo(name)
+				set portversion $portinfo(version)
+				set category [lindex $portinfo(categories) 0]
+				set pkgfile ${pkgbase}/${category}/${portname}-${portversion}.pkg/Contents/Archive.pax.gz
+				if {[file readable $pkgfile] && ([file mtime ${pkgfile}] > [file mtime ${portpath}/Portfile])} {
+					puts stderr "Skipping ${portname}-${portversion}; package is up to date."
+					continue
+				}
 			}
 		}
-	}
-	
-	# Skipt packages which previously failed
-		
-	# Building the port:
-	# - remove /opt/local so it won't pollute the port.
-	# - re-install MacPorts.
-	# - keep distfiles outside /opt/local so we don't have to keep fetching them.
-	# - send out an email to the maintainer if any errors occurred.
 
-	ui_msg "removing /opt/local"
-	#unset ui_options(ports_verbose)
-	if {[catch {system "rm -Rf /opt/local"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /etc/X11"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rm -Rf /etc/fonts"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	#set ui_options(ports_verbose) yes
+		# Skipt packages which previously failed
 
-	# If there was a log file left over from the previous pass,
-	# then the port failed with an error.  Send the log in an
-	# email to the maintainers.
-	if {$logfd ne ""} {
-		close $logfd
-		set logfd ""
-	}
-	#if {[file readable $logfilename]} {
-	#	if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
-	#		puts stderr "Internal error: $error"
-	#	}
-	#}
+		# Building the port:
+		# - remove /opt/local so it won't pollute the port.
+		# - re-install MacPorts.
+		# - keep distfiles outside /opt/local so we don't have to keep fetching them.
+		# - send out an email to the maintainer if any errors occurred.
 
-	# Open the log file for writing
-	set logfd [open ${logpath}/${name}.log w]
+		ui_msg "removing /opt/local"
+		#unset ui_options(ports_verbose)
+		if {[catch {system "rm -Rf /opt/local"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "rm -Rf /etc/X11"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "rm -Rf /etc/fonts"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		#set ui_options(ports_verbose) yes
 
-	set valid 1
+		# If there was a log file left over from the previous pass,
+		# then the port failed with an error.  Send the log in an
+		# email to the maintainers.
+		if {$logfd ne ""} {
+			close $logfd
+			set logfd ""
+		}
+		#if {[file readable $logfilename]} {
+		#	if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
+		#		puts stderr "Internal error: $error"
+		#	}
+		#}
 
-	set lint_errors {}
-	set portname ""
-	set portversion ""
-	set description ""
-	set category ""
+		# Open the log file for writing
+		set logfd [open ${logpath}/${name}.log w]
 
-	if {![info exists portinfo(name)]} {
-		lappend lint_errors "missing name key"
-		set valid 0
-	} else {
-		set portname $portinfo(name)
-	}
-	
-	if {![info exists portinfo(description)]} {
-		lappend lint_errors "missing description key"
-		set valid 0
-	} else {
-		set description $portinfo(description)
-	}
-	
-	if {![info exists portinfo(version)]} {
-		lappend lint_errors "missing version key"
-		set valid 0
-	} else {
-		set portversion $portinfo(version)
-	}
-	
-	if {![info exists portinfo(categories)]} {
-		lappend lint_errors "missing categories key"
-		set valid 0
-	} else {
-		set category [lindex $portinfo(categories) 0]
-	}
-	
-	if {![info exists portinfo(maintainers)]} {
-		append lint_errors "missing maintainers key"
-		set valid 0
-		set maintainers kevin at opendarwin.org
-	} else {
-		set maintainers $portinfo(maintainers)
-	}
-	
-	pkg_ui_log "To: [join $maintainers {, }]"
-	pkg_ui_log "From: donotreply at opendarwin.org"
-	pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
-	pkg_ui_log ""
-	pkg_ui_log "The following is a transcript produced by the MacPorts automated build       "
-	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
-	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
-	pkg_ui_log "the port as soon as possible."
-	pkg_ui_log ""
-	pkg_ui_log ""
-	pkg_ui_log "Thank you,"
-	pkg_ui_log "The MacPorts Team"
-	pkg_ui_log ""
-	pkg_ui_log "================================================================================"
-	pkg_ui_log ""
+		set valid 1
 
-	if {!$valid} {
-		foreach error $lint_errors {
-			ui_error $error
+		set lint_errors {}
+		set portname ""
+		set portversion ""
+		set description ""
+		set category ""
+
+		if {![info exists portinfo(name)]} {
+			lappend lint_errors "missing name key"
+			set valid 0
+		} else {
+			set portname $portinfo(name)
 		}
-	}
 
-	ui_msg "packaging ${category}/${portname}-${portversion}"
+		if {![info exists portinfo(description)]} {
+			lappend lint_errors "missing description key"
+			set valid 0
+		} else {
+			set description $portinfo(description)
+		}
 
-	# Install binary dependencies if we can, to speed things up.
-	#set depends {}
-	#if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
-	#if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-	#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-	#foreach depspec $depends {
-	#	set dep [lindex [split $depspec :] end]
-		#install_binary_if_available $dep $pkgbase
-	#}
-	set dependencies [get_dependencies $portname 1]
-	set dependencies [lsort -unique $dependencies]
-	foreach dep $dependencies {
-		install_binary_if_available $dep $pkgbase
-	}
+		if {![info exists portinfo(version)]} {
+			lappend lint_errors "missing version key"
+			set valid 0
+		} else {
+			set portversion $portinfo(version)
+		}
 
-	set options(package.type) pkg
-	set options(package.destpath) ${pkgbase}/${category}/
+		if {![info exists portinfo(categories)]} {
+			lappend lint_errors "missing categories key"
+			set valid 0
+		} else {
+			set category [lindex $portinfo(categories) 0]
+		}
 
-	# Turn on verbose output for the build
-	set ui_options(ports_verbose) yes
-	set options(subport) $name
-	if {[catch {set workername [mportopen $porturl [array get options] [array get variations] yes]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "Internal error: unable to open port: $result"
-	    continue
-	}	
-	if {[catch {set result [mportexec $workername pkg]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "port package failed: $result"
-		mportclose $workername
-	    continue
-	}
-	set ui_options(ports_verbose) no
-	# Turn verbose output off after the build
+		if {![info exists portinfo(maintainers)]} {
+			append lint_errors "missing maintainers key"
+			set valid 0
+			set maintainers kevin at opendarwin.org
+		} else {
+			set maintainers $portinfo(maintainers)
+		}
 
-	mportclose $workername
+		pkg_ui_log "To: [join $maintainers {, }]"
+		pkg_ui_log "From: donotreply at opendarwin.org"
+		pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
+		pkg_ui_log ""
+		pkg_ui_log "The following is a transcript produced by the MacPorts automated build		 "
+		pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer	"
+		pkg_ui_log "of this port, which has failed the automated packaging process.  Please update	"
+		pkg_ui_log "the port as soon as possible."
+		pkg_ui_log ""
+		pkg_ui_log ""
+		pkg_ui_log "Thank you,"
+		pkg_ui_log "The MacPorts Team"
+		pkg_ui_log ""
+		pkg_ui_log "================================================================================"
+		pkg_ui_log ""
 
-	# We made it to the end.  We can delete the log file.
-	close $logfd
-	set logfd ""
-	file delete ${logpath}/${name}.log
-}
+		if {!$valid} {
+			foreach error $lint_errors {
+				ui_error $error
+			}
+		}
 
+		ui_msg "packaging ${category}/${portname}-${portversion}"
+
+		# Install binary dependencies if we can, to speed things up.
+		#set depends {}
+		#if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
+		#if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+		#if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
+		#foreach depspec $depends {
+		#	set dep [lindex [split $depspec :] end]
+			#install_binary_if_available $dep $pkgbase
+		#}
+		set dependencies [get_dependencies $portname 1]
+		set dependencies [lsort -unique $dependencies]
+		foreach dep $dependencies {
+			install_binary_if_available $dep $pkgbase
+		}
+
+		set options(package.type) pkg
+		set options(package.destpath) ${pkgbase}/${category}/
+
+		# Turn on verbose output for the build
+		set ui_options(ports_verbose) yes
+		set options(subport) $name
+		if {[catch {set workername [mportopen $porturl [array get options] [array get variations] yes]} result] ||
+			$result == 1} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Internal error: unable to open port: $result"
+			continue
+		}
+		if {[catch {set result [mportexec $workername pkg]} result] ||
+			$result == 1} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "port package failed: $result"
+			mportclose $workername
+			continue
+		}
+		set ui_options(ports_verbose) no
+		# Turn verbose output off after the build
+
+		mportclose $workername
+
+		# We made it to the end.  We can delete the log file.
+		close $logfd
+		set logfd ""
+		file delete ${logpath}/${name}.log
+	}
 }
 # end foreach pname

Modified: trunk/base/portmgr/packaging/rpmall.tcl
===================================================================
--- trunk/base/portmgr/packaging/rpmall.tcl	2014-01-27 15:31:02 UTC (rev 116517)
+++ trunk/base/portmgr/packaging/rpmall.tcl	2014-01-27 15:39:11 UTC (rev 116518)
@@ -12,14 +12,14 @@
 # modification, are permitted provided that the following conditions
 # are met:
 # 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
+#	 notice, this list of conditions and the following disclaimer.
 # 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.
+#	 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. nor the names of its contributors
-#    may be used to endorse or promote products derived from this software
-#    without specific prior written permission.
-# 
+#	 may be used to endorse or promote products derived from this software
+#	 without specific prior written permission.
+#
 # 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
@@ -45,84 +45,84 @@
 
 # ui_options accessor
 proc ui_isset {val} {
-    global ui_options
-    if {[info exists ui_options($val)]} {
-	if {$ui_options($val) eq "yes"} {
-	    return 1
+	global ui_options
+	if {[info exists ui_options($val)]} {
+		if {$ui_options($val) eq "yes"} {
+			return 1
+		}
 	}
-    }
-    return 0
+	return 0
 }
 
 set options(package.destpath) "/darwinports/rpms"
 
-# UI Callback 
+# UI Callback
 
 proc ui_prefix {priority} {
-    switch $priority {
-        debug {
-        	return "DEBUG: "
-        }
-        error {
-        	return "Error: "
-        }
-        warn {
-        	return "Warning: "
-        }
-        default {
-        	return ""
-        }
-    }
+	switch $priority {
+		debug {
+			return "DEBUG: "
+		}
+		error {
+			return "Error: "
+		}
+		warn {
+			return "Warning: "
+		}
+		default {
+			return ""
+		}
+	}
 }
 
 proc ui_channels {priority} {
-    global logfd
-    switch $priority {
-        debug {
-            if {[ui_isset ports_debug]} {
-            	return {stdout}
-            } else {
-            	return {}
-            }
-        }
-        info {
+	global logfd
+	switch $priority {
+		debug {
+			if {[ui_isset ports_debug]} {
+				return {stdout}
+			} else {
+				return {}
+			}
+		}
+		info {
 			# put verbose stuff only to the log file
-            if {[ui_isset ports_verbose]} {
-                return {$logfd}
-            } else {
-                return {}
+			if {[ui_isset ports_verbose]} {
+				return {$logfd}
+			} else {
+				return {}
 			}
 		}
-        msg {
-            if {[ui_isset ports_quiet]} {
-                return {}
+		msg {
+			if {[ui_isset ports_quiet]} {
+				return {}
 			} else {
 				return {stdout}
 			}
 		}
-        default {
-        	return {stdout}
-        }
-    }
+		default {
+			return {stdout}
+		}
+	}
 }
-	
+
 proc pkg_ui_log {message} {
-    global logfd
-    if {$logfd ne ""} {
-	log_message $logfd $message
-    }
+	global logfd
+	if {$logfd ne ""} {
+		log_message $logfd $message
+	}
 }
 
 proc log_message {channel message} {
-    seek $channel 0 end
-    puts $channel $message
-    flush $channel
+	seek $channel 0 end
+	puts $channel $message
+	flush $channel
 }
 
 # Recursive bottom-up approach of building a list of dependencies.
 proc get_dependencies {portname includeBuildDeps} {
 	set result {}
-	
+
 	if {[catch {set search [mportsearch "^$portname\$"]} error]} {
 		global errorInfo
 		ui_debug "$errorInfo"
@@ -132,7 +132,7 @@
 	foreach {name array} $search {
 		array set portinfo $array
 		if {![info exists portinfo(name)] ||
-			![info exists portinfo(version)] || 
+			![info exists portinfo(version)] ||
 			![info exists portinfo(categories)]} {
 			ui_error "Internal error: $name missing some portinfo keys"
 			continue
@@ -140,7 +140,7 @@
 		if {![info exists portinfo(revision)]} {
 			set portinfo(revision) 0
 		}
-		
+
 		set portname $portinfo(name)
 		set portversion $portinfo(version)
 		set revision $portinfo(revision)
@@ -152,13 +152,13 @@
 		set depends {}
 		if {[info exists portinfo(depends_run)]} { eval "lappend depends $portinfo(depends_run)" }
 		if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
-		if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} { 
+		if {$includeBuildDeps ne "" && [info exists portinfo(depends_build)]} {
 			eval "lappend depends $portinfo(depends_build)"
 		}
-		if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} { 
+		if {$includeBuildDeps ne "" && [info exists portinfo(depends_fetch)]} {
 			eval "lappend depends $portinfo(depends_fetch)"
 		}
-		if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} { 
+		if {$includeBuildDeps ne "" && [info exists portinfo(depends_extract)]} {
 			eval "lappend depends $portinfo(depends_extract)"
 		}
 		foreach depspec $depends {
@@ -202,9 +202,9 @@
 # Standard procedures
 
 proc fatal args {
-    global argv0
-    puts stderr "$argv0: $args"
-    exit
+	global argv0
+	puts stderr "$argv0: $args"
+	exit
 }
 
 # Main
@@ -217,8 +217,8 @@
 }
 
 if {[catch {mportinit ui_options options variations} result]} {
-    puts "Failed to initialize ports system, $result"
-    exit 1
+	puts "Failed to initialize ports system, $result"
+	exit 1
 }
 
 package require Pextlib
@@ -229,275 +229,274 @@
 }
 
 foreach pname $argv {
+	if {[catch {set allpackages [mportsearch "^${pname}\$"]} result]} {
+		puts "port search failed: $result"
+		exit 1
+	}
 
-if {[catch {set allpackages [mportsearch "^${pname}\$"]} result]} {
-	puts "port search failed: $result"
-	exit 1
-}
+	set logpath "/darwinports/logs"
+	set logfd ""
 
-set logpath "/darwinports/logs"
-set logfd ""
+	foreach {name array} $allpackages {
+		array unset portinfo
+		array set portinfo $array
 
-foreach {name array} $allpackages {
-	array unset portinfo
-	array set portinfo $array
+		#ui_msg "foo $portinfo(porturl)"
 
-	#ui_msg "foo $portinfo(porturl)"
+		# Start with verbose output off;
+		# this will prevent the repopulation of /opt/local from getting logged.
+		set ui_options(ports_verbose) no
 
-	# Start with verbose output off;
-	# this will prevent the repopulation of /opt/local from getting logged.
-	set ui_options(ports_verbose) no
+		if {![info exists portinfo(porturl)]} {
+			puts stderr "Internal error: no porturl for $name"
+			continue
+		}
+		if {![info exists portinfo(revision)]} {
+			set portinfo(revision) 0
+		}
 
-	if {![info exists portinfo(porturl)]} {
-		puts stderr "Internal error: no porturl for $name"
-		continue
-	}
-	if {![info exists portinfo(revision)]} {
-		set portinfo(revision) 0
-	}
+		set porturl $portinfo(porturl)
 
-	set porturl $portinfo(porturl)
+		# this is used to short-circuit the RPM check and
+		# move on to the next package
 
-	# this is used to short-circuit the RPM check and
-	# move on to the next package
+		global exit_loop
+		set exit_loop false
 
-	global exit_loop
-	set exit_loop false
+		# Skip up-to-date packages
+		if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+			if {[info exists portinfo(name)] &&
+				[info exists portinfo(version)] &&
+				[info exists portinfo(revision)]} {
+				set portname $portinfo(name)
+				set portversion $portinfo(version)
+				set revision $portinfo(revision)
 
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(revision)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set revision $portinfo(revision)
-
-			foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-				foreach arch {"ppc" "i386" "fat"} {
-					set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
-					#ui_msg "trying ${rpmpath}"
-					if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
-						puts stderr "->    skipping ${portname}-${portversion}; package is up to date."
-						set exit_loop true
+				foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+					foreach arch {"ppc" "i386" "fat"} {
+						set rpmpath "${dir}/${arch}/${portname}-${portversion}-${revision}.${arch}.rpm"
+						#ui_msg "trying ${rpmpath}"
+						if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
+							puts stderr "->    skipping ${portname}-${portversion}; package is up to date."
+							set exit_loop true
+							break
+						}
+					}
+					if {${exit_loop}} {
 						break
 					}
 				}
-				if {${exit_loop}} {
-					break
+			}
+		}
+		if {${exit_loop}} {
+			continue
+		}
+
+		# Skip packages which previously failed
+		set exit_loop false
+
+		# Skip up-to-date packages
+		if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
+			if {[info exists portinfo(name)] &&
+				[info exists portinfo(version)] &&
+				[info exists portinfo(revision)]} {
+				set portname $portinfo(name)
+				set portversion $portinfo(version)
+				set revision $portinfo(revision)
+
+				set logfilepath "${logpath}/${portname}.log"
+				if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
+					puts stderr "->    skipping ${portname}-${portversion}; package failed, but has not changed."
+					set exit_loop true
 				}
 			}
 		}
-	}
-	if {${exit_loop}} {
-		continue
-	}
-	
-	# Skip packages which previously failed
-	set exit_loop false
-		
-	# Skip up-to-date packages
-	if {[regsub {^file://} $portinfo(porturl) "" portpath]} {
-		if {[info exists portinfo(name)] &&
-			[info exists portinfo(version)] &&
-			[info exists portinfo(revision)]} {
-			set portname $portinfo(name)
-			set portversion $portinfo(version)
-			set revision $portinfo(revision)
+		if {${exit_loop}} {
+			continue
+		}
 
-			set logfilepath "${logpath}/${portname}.log"
-			if {[file readable ${logfilepath}] && ([file mtime ${logfilepath}] > [file mtime ${portpath}/Portfile])} {
-				puts stderr "->    skipping ${portname}-${portversion}; package failed, but has not changed."
-				set exit_loop true
+		# Building the port:
+		# - remove /opt/local so it won't pollute the port.
+		# - re-install MacPorts.
+		# - keep distfiles outside /opt/local so we don't have to keep fetching them.
+		# - send out an email to the maintainer if any errors occurred.
+
+		set remove_files ""
+		foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
+			foreach arch {"ppc" "i386" "fat"} {
+				set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
 			}
 		}
-	}
-	if {${exit_loop}} {
-		continue
-	}
-	
-	# Building the port:
-	# - remove /opt/local so it won't pollute the port.
-	# - re-install MacPorts.
-	# - keep distfiles outside /opt/local so we don't have to keep fetching them.
-	# - send out an email to the maintainer if any errors occurred.
+		system "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
 
-	set remove_files ""
-	foreach dir {"/opt/local/src/apple/RPMS" "/usr/src/apple/RPMS" "/darwinports/rpms/RPMS"} {
-		foreach arch {"ppc" "i386" "fat"} {
-			set remove_files "${remove_files} '${dir}/${arch}/'*.rpm"
+		ui_msg "->	  Removing /opt/local"
+		#unset ui_options(ports_verbose)
+		if {[catch {system "rm -Rf /opt/local"} error]} {
+			puts stderr "Internal error: $error"
 		}
-	}
-	system "rpm -q --queryformat='%{name} ' -p ${remove_files} | xargs rpm -e || true"
+		# this is bad on pure darwin  :)
+		#if {[catch {system "rm -Rf /usr/X11R6"} error]} {
+		#	puts stderr "Internal error: $error"
+		#}
+		#if {[catch {system "rm -Rf /etc/X11"} error]} {
+		#	puts stderr "Internal error: $error"
+		#}
+		#if {[catch {system "rm -Rf /etc/fonts"} error]} {
+		#	puts stderr "Internal error: $error"
+		#}
+		ui_msg "->	  Installing MacPorts"
+		if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
+			puts stderr "Internal error: $error"
+		}
+		#set ui_options(ports_verbose) yes
 
-	ui_msg "->    Removing /opt/local"
-	#unset ui_options(ports_verbose)
-	if {[catch {system "rm -Rf /opt/local"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	# this is bad on pure darwin  :)
-	#if {[catch {system "rm -Rf /usr/X11R6"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	#if {[catch {system "rm -Rf /etc/X11"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	#if {[catch {system "rm -Rf /etc/fonts"} error]} {
-	#	puts stderr "Internal error: $error"
-	#}
-	ui_msg "->    Installing MacPorts"
-	if {[catch {system "cd $env(HOME)/darwinports && make && make install"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "rmdir /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	if {[catch {system "ln -s /darwinports/distfiles /opt/local/var/db/dports/distfiles"} error]} {
-		puts stderr "Internal error: $error"
-	}
-	#set ui_options(ports_verbose) yes
+		# If there was a log file left over from the previous pass,
+		# then the port failed with an error.  Send the log in an
+		# email to the maintainers.
+		if {$logfd ne ""} {
+			close $logfd
+			set logfd ""
+		}
+		#if {[file readable $logfilename]} {
+		#	if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
+		#		puts stderr "Internal error: $error"
+		#	}
+		#}
 
-	# If there was a log file left over from the previous pass,
-	# then the port failed with an error.  Send the log in an
-	# email to the maintainers.
-	if {$logfd ne ""} {
-		close $logfd
-		set logfd ""
-	}
-	#if {[file readable $logfilename]} {
-	#	if {[catch {system "<$logfilename /usr/sbin/sendmail -t"} error]} {
-	#		puts stderr "Internal error: $error"
-	#	}
-	#}
+		# Open the log file for writing
+		set logfd [open ${logpath}/${name}.log w]
 
-	# Open the log file for writing
-	set logfd [open ${logpath}/${name}.log w]
+		set valid 1
 
-	set valid 1
+		set lint_errors {}
+		set portname ""
+		set portversion ""
+		set description ""
+		set category ""
 
-	set lint_errors {}
-	set portname ""
-	set portversion ""
-	set description ""
-	set category ""
+		if {![info exists portinfo(name)]} {
+			lappend lint_errors "missing name key"
+			set valid 0
+		} else {
+			set portname $portinfo(name)
+		}
 
-	if {![info exists portinfo(name)]} {
-		lappend lint_errors "missing name key"
-		set valid 0
-	} else {
-		set portname $portinfo(name)
-	}
-	
-	if {![info exists portinfo(description)]} {
-		lappend lint_errors "missing description key"
-		set valid 0
-	} else {
-		set description $portinfo(description)
-	}
-	
-	if {![info exists portinfo(version)]} {
-		lappend lint_errors "missing version key"
-		set valid 0
-	} else {
-		set portversion $portinfo(version)
-	}
-	
-	if {![info exists portinfo(categories)]} {
-		lappend lint_errors "missing categories key"
-		set valid 0
-	} else {
-		set category [lindex $portinfo(categories) 0]
-	}
-	
-	if {![info exists portinfo(maintainers)]} {
-		append lint_errors "missing maintainers key"
-		set valid 0
-		set maintainers kevin at opendarwin.org
-	} else {
-		set maintainers $portinfo(maintainers)
-	}
-	
-	pkg_ui_log "To: [join $maintainers {, }]"
-	pkg_ui_log "From: donotreply at opendarwin.org"
-	pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
-	pkg_ui_log ""
-	pkg_ui_log "The following is a transcript produced by the MacPorts automated build       "
-	pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer    "
-	pkg_ui_log "of this port, which has failed the automated packaging process.  Please update  "
-	pkg_ui_log "the port as soon as possible."
-	pkg_ui_log ""
-	pkg_ui_log ""
-	pkg_ui_log "Thank you,"
-	pkg_ui_log "The MacPorts Team"
-	pkg_ui_log ""
-	pkg_ui_log "================================================================================"
-	pkg_ui_log ""
+		if {![info exists portinfo(description)]} {
+			lappend lint_errors "missing description key"
+			set valid 0
+		} else {
+			set description $portinfo(description)
+		}
 
-	if {!$valid} {
-		foreach error $lint_errors {
-			ui_error $error
+		if {![info exists portinfo(version)]} {
+			lappend lint_errors "missing version key"
+			set valid 0
+		} else {
+			set portversion $portinfo(version)
 		}
-	}
 
-	ui_msg "-->   Packaging ${category}/${portname}-${portversion}"
+		if {![info exists portinfo(categories)]} {
+			lappend lint_errors "missing categories key"
+			set valid 0
+		} else {
+			set category [lindex $portinfo(categories) 0]
+		}
 
-	foreach prebuild {"ccache" "rpm" "unzip"} {
-		if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
-			ui_msg "--->  Pre-installing ${prebuild}"
-			if {[catch {set search [mportsearch "^${prebuild}\$"]} error]} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "Internal error: port search ${prebuild} failed: $error"
+		if {![info exists portinfo(maintainers)]} {
+			append lint_errors "missing maintainers key"
+			set valid 0
+			set maintainers kevin at opendarwin.org
+		} else {
+			set maintainers $portinfo(maintainers)
+		}
+
+		pkg_ui_log "To: [join $maintainers {, }]"
+		pkg_ui_log "From: donotreply at opendarwin.org"
+		pkg_ui_log "Subject: MacPorts $portinfo(name)-$portinfo(version) build failure"
+		pkg_ui_log ""
+		pkg_ui_log "The following is a transcript produced by the MacPorts automated build		 "
+		pkg_ui_log "system.  You are receiving this email because you are listed as a maintainer	"
+		pkg_ui_log "of this port, which has failed the automated packaging process.  Please update	"
+		pkg_ui_log "the port as soon as possible."
+		pkg_ui_log ""
+		pkg_ui_log ""
+		pkg_ui_log "Thank you,"
+		pkg_ui_log "The MacPorts Team"
+		pkg_ui_log ""
+		pkg_ui_log "================================================================================"
+		pkg_ui_log ""
+
+		if {!$valid} {
+			foreach error $lint_errors {
+				ui_error $error
 			}
-			array set prebuildinfo [lindex $search 1]
-			set ui_options(ports_verbose) yes
-			set options(subport) ${prebuild}
-			if {[catch {set workername [mportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
-				$result == 1} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "Internal error: unable to install ${prebuild}... exiting"
-				exit 1
+		}
+
+		ui_msg "-->   Packaging ${category}/${portname}-${portversion}"
+
+		foreach prebuild {"ccache" "rpm" "unzip"} {
+			if {![file exists /bin/${prebuild}] && ![file exists /usr/bin/${prebuild}]} {
+				ui_msg "--->  Pre-installing ${prebuild}"
+				if {[catch {set search [mportsearch "^${prebuild}\$"]} error]} {
+					global errorInfo
+					ui_debug "$errorInfo"
+					ui_error "Internal error: port search ${prebuild} failed: $error"
+				}
+				array set prebuildinfo [lindex $search 1]
+				set ui_options(ports_verbose) yes
+				set options(subport) ${prebuild}
+				if {[catch {set workername [mportopen $prebuildinfo(porturl) [array get options] [array get variations] yes]} result] ||
+					$result == 1} {
+					global errorInfo
+					ui_debug "$errorInfo"
+					ui_error "Internal error: unable to install ${prebuild}... exiting"
+					exit 1
+				}
+				if {[catch {set result [mportexec $workername activate]} result] ||
+					$result == 1} {
+					global errorInfo
+					ui_debug "$errorInfo"
+					ui_error "installation of ${prebuild} failed: $result"
+					mportclose $workername
+					exit 1
+				}
 			}
-			if {[catch {set result [mportexec $workername activate]} result] ||
-				$result == 1} {
-				global errorInfo
-				ui_debug "$errorInfo"
-				ui_error "installation of ${prebuild} failed: $result"
-				mportclose $workername
-				exit 1
-			}
 		}
-	}
 
-	# Turn on verbose output for the build
-	set ui_options(ports_verbose) yes
-	set options(subport) $name
-	if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "Internal error: unable to open port: $result"
-	    continue
-	}
-	if {[catch {set result [mportexec $workername rpmpackage]} result] ||
-		$result == 1} {
-		global errorInfo
-		ui_debug "$errorInfo"
-	    ui_error "port package failed: $result"
+		# Turn on verbose output for the build
+		set ui_options(ports_verbose) yes
+		set options(subport) $name
+		if {[catch {set workername [mportopen $porturl [array get options] [array get variations]]} result] ||
+			$result == 1} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "Internal error: unable to open port: $result"
+			continue
+		}
+		if {[catch {set result [mportexec $workername rpmpackage]} result] ||
+			$result == 1} {
+			global errorInfo
+			ui_debug "$errorInfo"
+			ui_error "port package failed: $result"
+			mportclose $workername
+			continue
+		}
+		set ui_options(ports_verbose) no
+		# Turn verbose output off after the build
+
 		mportclose $workername
-	    continue
+
+		# We made it to the end.  We can delete the log file.
+		close $logfd
+		set logfd ""
+		file delete ${logpath}/${name}.log
 	}
-	set ui_options(ports_verbose) no
-	# Turn verbose output off after the build
 
-	mportclose $workername
-
-	# We made it to the end.  We can delete the log file.
-	close $logfd
-	set logfd ""
-	file delete ${logpath}/${name}.log
 }
-
-}
 # end foreach pname
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140127/540b6bb2/attachment-0001.html>


More information about the macports-changes mailing list