[60075] branches/gsoc09-logging/base

blb at macports.org blb at macports.org
Sat Oct 31 23:35:23 PDT 2009


Revision: 60075
          http://trac.macports.org/changeset/60075
Author:   blb at macports.org
Date:     2009-10-31 23:35:21 -0700 (Sat, 31 Oct 2009)
Log Message:
-----------
Merge from trunk

Modified Paths:
--------------
    branches/gsoc09-logging/base/doc/port.1
    branches/gsoc09-logging/base/src/package1.0/portarchive.tcl
    branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl
    branches/gsoc09-logging/base/src/port/port.tcl
    branches/gsoc09-logging/base/src/port1.0/portutil.tcl

Property Changed:
----------------
    branches/gsoc09-logging/base/


Property changes on: branches/gsoc09-logging/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:51231-59836
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:51231-60074
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/gsoc09-logging/base/doc/port.1
===================================================================
--- branches/gsoc09-logging/base/doc/port.1	2009-10-31 19:54:00 UTC (rev 60074)
+++ branches/gsoc09-logging/base/doc/port.1	2009-11-01 06:35:21 UTC (rev 60075)
@@ -209,7 +209,7 @@
 .It Fl q
 quiet mode (suppress messages)
 .It Fl n
-don't follow dependencies in upgrade (only for upgrading)
+don't upgrade dependencies (affects upgrade and install)
 .It Fl R
 also upgrade dependents (only for upgrading)
 .It Fl u

Modified: branches/gsoc09-logging/base/src/package1.0/portarchive.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portarchive.tcl	2009-10-31 19:54:00 UTC (rev 60074)
+++ branches/gsoc09-logging/base/src/package1.0/portarchive.tcl	2009-11-01 06:35:21 UTC (rev 60075)
@@ -1,4 +1,4 @@
-# vim:ts=4 sw=4 fo=croq
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
 # portarchive.tcl
 # $Id$
 #
@@ -64,359 +64,377 @@
 set_ui_prefix
 
 proc portarchive::archive_init {args} {
-	global UI_PREFIX target_state_fd
-	global variations package.destpath workpath
-	global ports_force ports_source_only ports_binary_only
-	global name version revision portvariants
-	global archive.destpath archive.type archive.meta
-	global archive.file archive.path archive.fulldestpath
-    global configure.build_arch
+    global UI_PREFIX target_state_fd
+    global variations package.destpath workpath
+    global ports_force ports_source_only ports_binary_only
+    global name version revision portvariants
+    global archive.destpath archive.type archive.meta
+    global archive.file archive.path archive.fulldestpath
+    global configure.build_arch configure.universal_archs
 
-	# Check mode in case archive called directly by user
-	if {[option portarchivemode] != "yes"} {
-		return -code error "Archive mode is not enabled!"
-	}
+    # Check mode in case archive called directly by user
+    if {[option portarchivemode] != "yes"} {
+        return -code error "Archive mode is not enabled!"
+    }
 
-	# Define port variants if not already defined
-	if { ![info exists portvariants] } {
-		set portvariants ""
-		set vlist [lsort -ascii [array names variations]]
-		# Put together variants in the form +foo+bar for the archive name
-		foreach v $vlist {
-			if { ![string equal $v [option os.platform]] && ![string equal $v [option os.arch]] } {
-				set portvariants "${portvariants}+${v}"
-			}
-		}
-	}
+    # Define port variants if not already defined
+    if { ![info exists portvariants] } {
+        set portvariants ""
+        set vlist [lsort -ascii [array names variations]]
+        # Put together variants in the form +foo+bar for the archive name
+        foreach v $vlist {
+            if {$variations($v) == "+"} {
+                append portvariants "+${v}"
+            }
+        }
+    }
 
-	# Define archive destination directory and target filename
-	if {![string equal ${archive.destpath} ${workpath}] && ![string equal ${archive.destpath} ""]} {
-		set archive.fulldestpath [file join ${archive.destpath} [option os.platform] ${configure.build_arch}]
-	} else {
-	    set archive.fulldestpath ${archive.destpath}
-	}
+    # Define archive destination directory and target filename
+    if {![string equal ${archive.destpath} ${workpath}] && ![string equal ${archive.destpath} ""]} {
+        if {[variant_exists universal] && [variant_isset universal]} {
+            set archive.fulldestpath [file join ${archive.destpath} [option os.platform] "universal"]
+        } else {
+            set archive.fulldestpath [file join ${archive.destpath} [option os.platform] ${configure.build_arch}]
+        }
+    } else {
+        set archive.fulldestpath ${archive.destpath}
+    }
 
-	# Determine if archive should be skipped
-	set skipped 0
-	if {[check_statefile target org.macports.archive $target_state_fd]} {
-		return 0
-	} elseif {[check_statefile target org.macports.unarchive $target_state_fd] && ([info exists ports_binary_only] && $ports_binary_only == "yes")} {
-		ui_debug "Skipping archive ($name) since binary-only is set"
-		set skipped 1
-	} elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
-		ui_debug "Skipping archive ($name) since source-only is set"
-		set skipped 1
-	} else {
-		set unsupported 0
-		set any_missing no
-		foreach archive.type [option portarchivetype] {
-			if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
-				set archive.file "${name}-${version}_${revision}${portvariants}.${configure.build_arch}.${archive.type}"
-				set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
-				if {![file exists ${archive.path}]} {
-				    set any_missing yes
-				}
-			} else {
-				ui_debug "Skipping [string toupper ${archive.type}] archive: $errmsg"
-				set unsupported [expr $unsupported + 1]
-			}
-		}
-		if {!$any_missing} {
-			# might be nice to allow forcing, but let's fix #16061 first
-			ui_debug "Skipping archive ($name) since archive(s) already exist"
-			set skipped 1
-		}
-		if {${archive.type} == "xpkg"} {
-			set archive.meta true
-		}
-		if {[llength [option portarchivetype]] == $unsupported} {
-			ui_debug "Skipping archive ($name) since specified archive types not supported"
-			set skipped 1
-		}
-	}
-	# Skip archive target by setting state
-	if {$skipped == 1} {
-		write_statefile target "org.macports.archive" $target_state_fd
-	}
+    # Determine if archive should be skipped
+    set skipped 0
+    if {[check_statefile target org.macports.archive $target_state_fd]} {
+        return 0
+    } elseif {[check_statefile target org.macports.unarchive $target_state_fd] && ([info exists ports_binary_only] && $ports_binary_only == "yes")} {
+        ui_debug "Skipping archive ($name) since binary-only is set"
+        set skipped 1
+    } elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
+        ui_debug "Skipping archive ($name) since source-only is set"
+        set skipped 1
+    } else {
+        set unsupported 0
+        set any_missing no
+        foreach archive.type [option portarchivetype] {
+            if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
+                if {[variant_exists universal] && [variant_isset universal]} {
+                    set archstring [join [lsort -ascii ${configure.universal_archs}] -]
+                } else {
+                    set archstring ${configure.build_arch}
+                }
+                set archive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${archive.type}"
+                set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
+                if {![file exists ${archive.path}]} {
+                    set any_missing yes
+                }
+            } else {
+                ui_debug "Skipping [string toupper ${archive.type}] archive: $errmsg"
+                set unsupported [expr $unsupported + 1]
+            }
+        }
+        if {!$any_missing} {
+            # might be nice to allow forcing, but let's fix #16061 first
+            ui_debug "Skipping archive ($name) since archive(s) already exist"
+            set skipped 1
+        }
+        if {${archive.type} == "xpkg"} {
+            set archive.meta true
+        }
+        if {[llength [option portarchivetype]] == $unsupported} {
+            ui_debug "Skipping archive ($name) since specified archive types not supported"
+            set skipped 1
+        }
+    }
+    # Skip archive target by setting state
+    if {$skipped == 1} {
+        write_statefile target "org.macports.archive" $target_state_fd
+    }
 
-	return 0
+    return 0
 }
 
 proc portarchive::archive_start {args} {
-	global UI_PREFIX
-	global name version revision portvariants
+    global UI_PREFIX
+    global name version revision portvariants
 
-	if {[llength [option portarchivetype]] > 1} {
-		ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $name $version $revision $portvariants]"
-	} else {
-		ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $name $version $revision $portvariants]"
-	}
+    if {[llength [option portarchivetype]] > 1} {
+        ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [join [option portarchivetype] {, }] archives for %s %s_%s%s"] $name $version $revision $portvariants]"
+    } else {
+        ui_msg "$UI_PREFIX [format [msgcat::mc "Packaging [option portarchivetype] archive for %s %s_%s%s"] $name $version $revision $portvariants]"
+    }
 
-	return 0
+    return 0
 }
 
 proc portarchive::archive_command_setup {args} {
-	global archive.env archive.cmd
-	global archive.pre_args archive.args archive.post_args
-	global archive.type archive.path
-	global archive.metaname archive.metapath
-	global os.platform os.version
+    global archive.env archive.cmd
+    global archive.pre_args archive.args archive.post_args
+    global archive.type archive.path
+    global archive.metaname archive.metapath
+    global os.platform os.version
 
-	# Define appropriate archive command and options
-	set archive.env {}
-	set archive.cmd {}
-	set archive.pre_args {}
-	set archive.args {}
-	set archive.post_args {}
-	switch -regex ${archive.type} {
-		cp(io|gz) {
-			set pax "pax"
-			if {[catch {set pax [findBinary $pax ${portutil::autoconf::pax_path}]} errmsg] == 0} {
-				ui_debug "Using $pax"
-				set archive.cmd "$pax"
-				set archive.pre_args {-w -v -x cpio}
-				if {[regexp {z$} ${archive.type}]} {
-					set gzip "gzip"
-					if {[catch {set gzip [findBinary $gzip ${portutil::autoconf::gzip_path}]} errmsg] == 0} {
-						ui_debug "Using $gzip"
-						set archive.args {.}
-						set archive.post_args "| $gzip -c9 > ${archive.path}"
-					} else {
-						ui_debug $errmsg
-						return -code error "No '$gzip' was found on this system!"
-					}
-				} else {
-					set archive.args "-f ${archive.path} ."
-				}
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$pax' was found on this system!"
-			}
-		}
-		t(ar|bz|lz|xz|gz) {
-			set tar "tar"
-			if {[catch {set tar [findBinary $tar ${portutil::autoconf::tar_path}]} errmsg] == 0} {
-				ui_debug "Using $tar"
-				set archive.cmd "$tar"
-				set archive.pre_args {-cvf}
-				if {[regexp {z2?$} ${archive.type}]} {
-					if {[regexp {bz2?$} ${archive.type}]} {
-						set gzip "bzip2"
-						set level 9
-					} elseif {[regexp {lz$} ${archive.type}]} {
-						set gzip "lzma"
-						set level 7
-					} elseif {[regexp {xz$} ${archive.type}]} {
-						set gzip "xz"
-						set level 6
-					} else {
-						set gzip "gzip"
-						set level 9
-					}
-					if {[info exists portutil::autoconf::${gzip}_path]} {
-					    set hint [set portutil::autoconf::${gzip}_path]
-					} else {
-					    set hint ""
-					}
-					if {[catch {set gzip [findBinary $gzip $hint]} errmsg] == 0} {
-						ui_debug "Using $gzip"
-						set archive.args {- .}
-						set archive.post_args "| $gzip -c$level > ${archive.path}"
-					} else {
-						ui_debug $errmsg
-						return -code error "No '$gzip' was found on this system!"
-					}
-				} else {
-					set archive.args "${archive.path} ."
-				}
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$tar' was found on this system!"
-			}
-		}
-		xar {
-			set xar "xar"
-			if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
-				ui_debug "Using $xar"
-				set archive.cmd "$xar"
-				set archive.pre_args {-cvf}
-				set archive.args "${archive.path} ."
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$xar' was found on this system!"
-			}
-		}
-		xpkg {
-			set xar "xar"
-			set compression "bzip2"
-			if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
-				ui_debug "Using $xar"
-				set archive.cmd "$xar"
-				set archive.pre_args "-cv --exclude='\./\+.*' --compression=${compression} -n ${archive.metaname} -s ${archive.metapath} -f"
-				set archive.args "${archive.path} ."
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$xar' was found on this system!"
-			}
-		}
-		zip {
-			set zip "zip"
-			if {[catch {set zip [findBinary $zip ${portutil::autoconf::zip_path}]} errmsg] == 0} {
-				ui_debug "Using $zip"
-				set archive.cmd "$zip"
-				set archive.pre_args {-ry9}
-				set archive.args "${archive.path} ."
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$zip' was found on this system!"
-			}
-		}
-		default {
-			return -code error "Invalid port archive type '${archive.type}' specified!"
-		}
-	}
+    # Define appropriate archive command and options
+    set archive.env {}
+    set archive.cmd {}
+    set archive.pre_args {}
+    set archive.args {}
+    set archive.post_args {}
+    switch -regex ${archive.type} {
+        cp(io|gz) {
+            set pax "pax"
+            if {[catch {set pax [findBinary $pax ${portutil::autoconf::pax_path}]} errmsg] == 0} {
+                ui_debug "Using $pax"
+                set archive.cmd "$pax"
+                set archive.pre_args {-w -v -x cpio}
+                if {[regexp {z$} ${archive.type}]} {
+                    set gzip "gzip"
+                    if {[catch {set gzip [findBinary $gzip ${portutil::autoconf::gzip_path}]} errmsg] == 0} {
+                        ui_debug "Using $gzip"
+                        set archive.args {.}
+                        set archive.post_args "| $gzip -c9 > ${archive.path}"
+                    } else {
+                        ui_debug $errmsg
+                        return -code error "No '$gzip' was found on this system!"
+                    }
+                } else {
+                    set archive.args "-f ${archive.path} ."
+                }
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$pax' was found on this system!"
+            }
+        }
+        t(ar|bz|lz|xz|gz) {
+            set tar "tar"
+            if {[catch {set tar [findBinary $tar ${portutil::autoconf::tar_path}]} errmsg] == 0} {
+                ui_debug "Using $tar"
+                set archive.cmd "$tar"
+                set archive.pre_args {-cvf}
+                if {[regexp {z2?$} ${archive.type}]} {
+                    if {[regexp {bz2?$} ${archive.type}]} {
+                        set gzip "bzip2"
+                        set level 9
+                    } elseif {[regexp {lz$} ${archive.type}]} {
+                        set gzip "lzma"
+                        set level 7
+                    } elseif {[regexp {xz$} ${archive.type}]} {
+                        set gzip "xz"
+                        set level 6
+                    } else {
+                        set gzip "gzip"
+                        set level 9
+                    }
+                    if {[info exists portutil::autoconf::${gzip}_path]} {
+                        set hint [set portutil::autoconf::${gzip}_path]
+                    } else {
+                        set hint ""
+                    }
+                    if {[catch {set gzip [findBinary $gzip $hint]} errmsg] == 0} {
+                        ui_debug "Using $gzip"
+                        set archive.args {- .}
+                        set archive.post_args "| $gzip -c$level > ${archive.path}"
+                    } else {
+                        ui_debug $errmsg
+                        return -code error "No '$gzip' was found on this system!"
+                    }
+                } else {
+                    set archive.args "${archive.path} ."
+                }
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$tar' was found on this system!"
+            }
+        }
+        xar {
+            set xar "xar"
+            if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
+                ui_debug "Using $xar"
+                set archive.cmd "$xar"
+                set archive.pre_args {-cvf}
+                set archive.args "${archive.path} ."
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$xar' was found on this system!"
+            }
+        }
+        xpkg {
+            set xar "xar"
+            set compression "bzip2"
+            if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
+                ui_debug "Using $xar"
+                set archive.cmd "$xar"
+                set archive.pre_args "-cv --exclude='\./\+.*' --compression=${compression} -n ${archive.metaname} -s ${archive.metapath} -f"
+                set archive.args "${archive.path} ."
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$xar' was found on this system!"
+            }
+        }
+        zip {
+            set zip "zip"
+            if {[catch {set zip [findBinary $zip ${portutil::autoconf::zip_path}]} errmsg] == 0} {
+                ui_debug "Using $zip"
+                set archive.cmd "$zip"
+                set archive.pre_args {-ry9}
+                set archive.args "${archive.path} ."
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$zip' was found on this system!"
+            }
+        }
+        default {
+            return -code error "Invalid port archive type '${archive.type}' specified!"
+        }
+    }
 
-	return 0
+    return 0
 }
 
 proc portarchive::putel { fd el data } {
-	# Quote xml data
-	set quoted [string map  { & &amp; < &lt; > &gt; } $data]
-	# Write the element
-	puts $fd "<${el}>${quoted}</${el}>"
+    # Quote xml data
+    set quoted [string map  { & &amp; < &lt; > &gt; } $data]
+    # Write the element
+    puts $fd "<${el}>${quoted}</${el}>"
 }
 
 proc portarchive::putlist { fd listel itemel list } {
-	puts $fd "<$listel>"
-	foreach item $list {
-		putel $fd $itemel $item
-	}
-	puts $fd "</$listel>"
+    puts $fd "<$listel>"
+    foreach item $list {
+        putel $fd $itemel $item
+    }
+    puts $fd "</$listel>"
 }
 
 proc portarchive::archive_main {args} {
-	global UI_PREFIX variations
-	global workpath destpath portpath ports_force
-	global name epoch version revision portvariants
-	global archive.fulldestpath archive.type archive.file archive.path
-	global archive.meta archive.metaname archive.metapath
-	global os.platform os.arch configure.build_arch
+    global UI_PREFIX variations
+    global workpath destpath portpath ports_force
+    global name epoch version revision portvariants
+    global archive.fulldestpath archive.type archive.file archive.path
+    global archive.meta archive.metaname archive.metapath
+    global os.platform configure.build_arch configure.universal_archs
 
-	# Create archive destination path (if needed)
-	if {![file isdirectory ${archive.fulldestpath}]} {
-		system "mkdir -p ${archive.fulldestpath}"
-	}
+    # Create archive destination path (if needed)
+    if {![file isdirectory ${archive.fulldestpath}]} {
+        system "mkdir -p ${archive.fulldestpath}"
+    }
 
-	# Create (if no files) destroot for archiving
-	if {![file isdirectory ${destpath}]} {
-		system "mkdir -p ${destpath}"
-	}
+    # Create (if no files) destroot for archiving
+    if {![file isdirectory ${destpath}]} {
+        system "mkdir -p ${destpath}"
+    }
 
-	# Copy state file into destroot for archiving
-	# +STATE contains a copy of the MacPorts state information
+    # Copy state file into destroot for archiving
+    # +STATE contains a copy of the MacPorts state information
     set statefile [file join $workpath .macports.${name}.state]
-	file copy -force $statefile [file join $destpath "+STATE"]
+    file copy -force $statefile [file join $destpath "+STATE"]
 
-	# Copy Portfile into destroot for archiving
-	# +PORTFILE contains a copy of the MacPorts Portfile
+    # Copy Portfile into destroot for archiving
+    # +PORTFILE contains a copy of the MacPorts Portfile
     set portfile [file join $portpath Portfile]
-	file copy -force $portfile [file join $destpath "+PORTFILE"]
+    file copy -force $portfile [file join $destpath "+PORTFILE"]
 
-	# Create some informational files that we don't really use just yet,
-	# but we may in the future in order to allow port installation from
-	# archives without a full "ports" tree of Portfiles.
-	#
-	# Note: These have been modeled after FreeBSD type package files to
-	# start. We can change them however we want for actual future use if
-	# needed.
-	#
-	# +COMMENT contains the port description
-	set fd [open [file join $destpath "+COMMENT"] w]
+    # Create some informational files that we don't really use just yet,
+    # but we may in the future in order to allow port installation from
+    # archives without a full "ports" tree of Portfiles.
+    #
+    # Note: These have been modeled after FreeBSD type package files to
+    # start. We can change them however we want for actual future use if
+    # needed.
+    #
+    # +COMMENT contains the port description
+    set fd [open [file join $destpath "+COMMENT"] w]
     if {[exists description]} {
-		puts $fd "[option description]"
-	}
-	close $fd
-	# +DESC contains the port long_description and homepage
-	set fd [open [file join $destpath "+DESC"] w]
-	if {[exists long_description]} {
-		puts $fd "[option long_description]"
-	}
-	if {[exists homepage]} {
-		puts $fd "\nWWW: [option homepage]"
-	}
-	close $fd
-	# +CONTENTS contains the port version/name info and all installed
-	# files and checksums
-	set control [list]
-	set fd [open [file join $destpath "+CONTENTS"] w]
-	puts $fd "@name ${name}-${version}_${revision}${portvariants}"
-	puts $fd "@portname ${name}"
-	puts $fd "@portepoch ${epoch}"
-	puts $fd "@portversion ${version}"
-	puts $fd "@portrevision ${revision}"
-	set vlist [lsort -ascii [array names variations]]
-	foreach v $vlist {
-		if {![string equal $v [option os.platform]] && ![string equal $v [option os.arch]]} {
-			puts $fd "@portvariant +${v}"
-		}
-	}
-	fs-traverse fullpath $destpath {
-	    if {[file isdirectory $fullpath]} {
-	        continue
-	    }
-		set relpath [strsed $fullpath "s|^$destpath/||"]
-		if {![regexp {^[+]} $relpath]} {
-			puts $fd "$relpath"
-			if {[file isfile $fullpath]} {
-				ui_debug "checksum file: $fullpath"
-				set checksum [md5 file $fullpath]
-				puts $fd "@comment MD5:$checksum"
-			}
-		} else {
-			lappend control $relpath
-		}
-	}
-	foreach relpath $control {
-		puts $fd "@ignore"
-		puts $fd "$relpath"
-	}
-	close $fd
+        puts $fd "[option description]"
+    }
+    close $fd
+    # +DESC contains the port long_description and homepage
+    set fd [open [file join $destpath "+DESC"] w]
+    if {[exists long_description]} {
+        puts $fd "[option long_description]"
+    }
+    if {[exists homepage]} {
+        puts $fd "\nWWW: [option homepage]"
+    }
+    close $fd
+    # +CONTENTS contains the port version/name info and all installed
+    # files and checksums
+    set control [list]
+    set fd [open [file join $destpath "+CONTENTS"] w]
+    puts $fd "@name ${name}-${version}_${revision}${portvariants}"
+    puts $fd "@portname ${name}"
+    puts $fd "@portepoch ${epoch}"
+    puts $fd "@portversion ${version}"
+    puts $fd "@portrevision ${revision}"
+    if {[variant_exists universal] && [variant_isset universal]} {
+        puts $fd "@archs ${configure.universal_archs}"
+    } else {
+        puts $fd "@archs ${configure.build_arch}"
+    }
+    set vlist [lsort -ascii [array names variations]]
+    foreach v $vlist {
+        if {$variations($v) == "+"} {
+            puts $fd "@portvariant +${v}"
+        }
+    }
+    fs-traverse -depth fullpath $destpath {
+        if {[file isdirectory $fullpath]} {
+            continue
+        }
+        set relpath [strsed $fullpath "s|^$destpath/||"]
+        if {![regexp {^[+]} $relpath]} {
+            puts $fd "$relpath"
+            if {[file isfile $fullpath]} {
+                ui_debug "checksum file: $fullpath"
+                set checksum [md5 file $fullpath]
+                puts $fd "@comment MD5:$checksum"
+            }
+        } else {
+            lappend control $relpath
+        }
+    }
+    foreach relpath $control {
+        puts $fd "@ignore"
+        puts $fd "$relpath"
+    }
+    close $fd
 
-	# the XML package metadata, for XAR package
-	# (doesn't contain any file list/checksums)
-	if {${archive.meta}} {
-		set archive.metaname "xpkg"
-		set archive.metapath [file join $workpath "${archive.metaname}.xml"]
-		set sd [open ${archive.metapath} w]
-		puts $sd "<xpkg version='0.2'>"
-		# TODO: split contents into <buildinfo> (new) and <package> (current)
-		#       see existing <portpkg> for the matching source package layout
+    # the XML package metadata, for XAR package
+    # (doesn't contain any file list/checksums)
+    if {${archive.meta}} {
+        set archive.metaname "xpkg"
+        set archive.metapath [file join $workpath "${archive.metaname}.xml"]
+        set sd [open ${archive.metapath} w]
+        puts $sd "<xpkg version='0.2'>"
+        # TODO: split contents into <buildinfo> (new) and <package> (current)
+        #       see existing <portpkg> for the matching source package layout
 
-		putel $sd name ${name}
-		putel $sd epoch ${epoch}
-		putel $sd version ${version}
-		putel $sd revision ${revision}
-		putel $sd major 0
-		putel $sd minor 0
+        putel $sd name ${name}
+        putel $sd epoch ${epoch}
+        putel $sd version ${version}
+        putel $sd revision ${revision}
+        putel $sd major 0
+        putel $sd minor 0
 
-		putel $sd platform ${os.platform}
-		putel $sd arch ${os.arch}
-		set vlist [lsort -ascii [array names variations]]
-		putlist $sd variants variant $vlist
+        putel $sd platform ${os.platform}
+        if {[variant_exists universal] && [variant_isset universal]} {
+            putlist $sd archs arch [lsort -ascii ${configure.universal_archs}]
+        } else {
+            putel $sd arch ${configure.build_arch}
+        }
+        set vlist [lsort -ascii [array names variations]]
+        putlist $sd variants variant $vlist
 
-		if {[exists categories]} {
-			set primary [lindex [split [option categories] " "] 0]
-			putel $sd category $primary
-		}
-		if {[exists description]} {
-			putel $sd comment "[option description]"
-		}
-		if {[exists long_description]} {
-			putel $sd desc "[option long_description]"
-		}
-		if {[exists homepage]} {
-			putel $sd homepage "[option homepage]"
-		}
+        if {[exists categories]} {
+            set primary [lindex [split [option categories] " "] 0]
+            putel $sd category $primary
+        }
+        if {[exists description]} {
+            putel $sd comment "[option description]"
+        }
+        if {[exists long_description]} {
+            putel $sd desc "[option long_description]"
+        }
+        if {[exists homepage]} {
+            putel $sd homepage "[option homepage]"
+        }
 
             # Emit dependencies provided by this package
             puts $sd "<provides>"
@@ -455,53 +473,57 @@
             puts $sd "</requires>"
     }
 
-		puts $sd "</xpkg>"
-		close $sd
-	}
+        puts $sd "</xpkg>"
+        close $sd
+    }
 
-	# Now create the archive(s)
-	# Loop through archive types
-	foreach archive.type [option portarchivetype] {
-		if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
-			# Define archive file/path
-			set archive.file "${name}-${version}_${revision}${portvariants}.${configure.build_arch}.${archive.type}"
-			set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
+    if {[variant_exists universal] && [variant_isset universal]} {
+        set archstring [join [lsort -ascii ${configure.universal_archs}] -]
+    } else {
+        set archstring ${configure.build_arch}
+    }
+    # Now create the archive(s)
+    # Loop through archive types
+    foreach archive.type [option portarchivetype] {
+        if {[catch {archiveTypeIsSupported ${archive.type}} errmsg] == 0} {
+            # Define archive file/path
+            set archive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${archive.type}"
+            set archive.path "[file join ${archive.fulldestpath} ${archive.file}]"
 
-			# Setup archive command
-			archive_command_setup
+            # Setup archive command
+            archive_command_setup
 
-			# Remove existing archive
-			if {[file exists ${archive.path}]} {
-				ui_info "$UI_PREFIX [format [msgcat::mc "Deleting previous %s"] ${archive.file}]"
-				file delete -force ${archive.path}
-			}
+            # Remove existing archive
+            if {[file exists ${archive.path}]} {
+                ui_info "$UI_PREFIX [format [msgcat::mc "Deleting previous %s"] ${archive.file}]"
+                file delete -force ${archive.path}
+            }
 
-			ui_info "$UI_PREFIX [format [msgcat::mc "Creating %s"] ${archive.file}]"
-			command_exec archive
-			ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s packaged"] ${archive.file}]"
-		}
-	}
+            ui_info "$UI_PREFIX [format [msgcat::mc "Creating %s"] ${archive.file}]"
+            command_exec archive
+            ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s packaged"] ${archive.file}]"
+        }
+    }
 
     return 0
 }
 
 proc portarchive::archive_finish {args} {
-	global UI_PREFIX
-	global name version revision portvariants
-	global destpath
+    global UI_PREFIX
+    global name version revision portvariants
+    global destpath
 
-	# Cleanup all control files when finished
-	set control_files [glob -nocomplain -types f [file join $destpath +*]]
-	foreach file $control_files {
-		ui_debug "removing file: $file"
-		file delete -force $file
-	}
+    # Cleanup all control files when finished
+    set control_files [glob -nocomplain -types f [file join $destpath +*]]
+    foreach file $control_files {
+        ui_debug "removing file: $file"
+        file delete -force $file
+    }
 
-	if {[llength [option portarchivetype]] > 1} {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
-	} else {
-		ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
-	}
-	return 0
+    if {[llength [option portarchivetype]] > 1} {
+        ui_info "$UI_PREFIX [format [msgcat::mc "Archives for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
+    } else {
+        ui_info "$UI_PREFIX [format [msgcat::mc "Archive for %s %s_%s%s packaged"] $name $version $revision $portvariants]"
+    }
+    return 0
 }
-

Modified: branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl
===================================================================
--- branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl	2009-10-31 19:54:00 UTC (rev 60074)
+++ branches/gsoc09-logging/base/src/package1.0/portunarchive.tcl	2009-11-01 06:35:21 UTC (rev 60075)
@@ -1,4 +1,4 @@
-# vim:ts=4 sw=4 fo=croq
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
 # portunarchive.tcl
 # $Id$
 #
@@ -61,246 +61,255 @@
 set_ui_prefix
 
 proc portunarchive::unarchive_init {args} {
-	global UI_PREFIX target_state_fd variations workpath
-	global ports_force ports_source_only ports_binary_only
-	global name version revision portvariants portpath
-	global unarchive.srcpath unarchive.type unarchive.file unarchive.path unarchive.fullsrcpath
-    global configure.build_arch
+    global UI_PREFIX target_state_fd variations workpath
+    global ports_force ports_source_only ports_binary_only
+    global name version revision portvariants portpath
+    global unarchive.srcpath unarchive.type unarchive.file unarchive.path unarchive.fullsrcpath
+    global configure.build_arch configure.universal_archs
 
-	# Check mode in case archive called directly by user
-	if {[option portarchivemode] != "yes"} {
-		return -code error "Archive mode is not enabled!"
-	}
+    # Check mode in case archive called directly by user
+    if {[option portarchivemode] != "yes"} {
+        return -code error "Archive mode is not enabled!"
+    }
 
-	# Define port variants if not already defined
-	if { ![info exists portvariants] } {
-		set portvariants ""
-		set vlist [lsort -ascii [array names variations]]
-		# Put together variants in the form +foo+bar for the archive name
-		foreach v $vlist {
-			if { ![string equal $v [option os.platform]] && ![string equal $v [option os.arch]] } {
-				set portvariants "${portvariants}+${v}"
-			}
-		}
-	}
+    # Define port variants if not already defined
+    if { ![info exists portvariants] } {
+        set portvariants ""
+        set vlist [lsort -ascii [array names variations]]
+        # Put together variants in the form +foo+bar for the archive name
+        foreach v $vlist {
+            if {$variations($v) == "+"} {
+                append portvariants "+${v}"
+            }
+        }
+    }
 
-	# Define archive directory, file, and path
-	if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
-		set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] ${configure.build_arch}]
-	} else {
-	    set unarchive.fullsrcpath ${unarchive.srcpath}
-	}
+    # Define archive directory, file, and path
+    if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
+        if {[variant_exists universal] && [variant_isset universal]} {
+            set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] "universal"]
+        } else {
+            set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] ${configure.build_arch}]
+        }
+    } else {
+        set unarchive.fullsrcpath ${unarchive.srcpath}
+    }
 
-	# Determine if unarchive should be skipped
-	set skipped 0
-	if {[check_statefile target org.macports.unarchive $target_state_fd]} {
-		return 0
-	} elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
-		ui_debug "Skipping unarchive ($name) since source-only is set"
-		set skipped 1
-	} elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
-		ui_debug "Skipping unarchive ($name) since destroot completed"
-		set skipped 1
-	} elseif {[info exists ports_force] && $ports_force == "yes"} {
-		ui_debug "Skipping unarchive ($name) since force is set"
-		set skipped 1
-	} else {
-		set found 0
-		set unsupported 0
-		foreach unarchive.type [option portarchivetype] {
-			if {[catch {archiveTypeIsSupported ${unarchive.type}} errmsg] == 0} {
-				set unarchive.file "${name}-${version}_${revision}${portvariants}.${configure.build_arch}.${unarchive.type}"
-				set unarchive.path "[file join ${unarchive.fullsrcpath} ${unarchive.file}]"
-				if {[file exist ${unarchive.path}]} {
-					set found 1
-					break
-				} else {
-					ui_debug "No [string toupper ${unarchive.type}] archive: ${unarchive.path}"
-				}
-			} else {
-				ui_debug "Skipping [string toupper ${unarchive.type}] archive: $errmsg"
-				set unsupported [expr $unsupported + 1]
-			}
-		}
-		if {$found == 1} {
-			ui_debug "Found [string toupper ${unarchive.type}] archive: ${unarchive.path}"
-		} else {
-			if {[info exists ports_binary_only] && $ports_binary_only == "yes"} {
-				return -code error "Archive for ${name} ${version}_${revision}${portvariants} not found, required when binary-only is set!"
-			} else {
-				if {[llength [option portarchivetype]] == $unsupported} {
-					ui_debug "Skipping unarchive ($name) since specified archive types not supported"
-				} else {
-					ui_debug "Skipping unarchive ($name) since no archive found"
-				}
-				set skipped 1
-			}
-		}
-	}
-	# Skip unarchive target by setting state
-	if {$skipped == 1} {
-		write_statefile target "org.macports.unarchive" $target_state_fd
-	}
+    # Determine if unarchive should be skipped
+    set skipped 0
+    if {[check_statefile target org.macports.unarchive $target_state_fd]} {
+        return 0
+    } elseif {[info exists ports_source_only] && $ports_source_only == "yes"} {
+        ui_debug "Skipping unarchive ($name) since source-only is set"
+        set skipped 1
+    } elseif {[check_statefile target org.macports.destroot $target_state_fd]} {
+        ui_debug "Skipping unarchive ($name) since destroot completed"
+        set skipped 1
+    } elseif {[info exists ports_force] && $ports_force == "yes"} {
+        ui_debug "Skipping unarchive ($name) since force is set"
+        set skipped 1
+    } else {
+        set found 0
+        set unsupported 0
+        foreach unarchive.type [option portarchivetype] {
+            if {[catch {archiveTypeIsSupported ${unarchive.type}} errmsg] == 0} {
+                if {[variant_exists universal] && [variant_isset universal]} {
+                    set archstring [join [lsort -ascii ${configure.universal_archs}] -]
+                } else {
+                    set archstring ${configure.build_arch}
+                }
+                set unarchive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${unarchive.type}"
+                set unarchive.path "[file join ${unarchive.fullsrcpath} ${unarchive.file}]"
+                if {[file exist ${unarchive.path}]} {
+                    set found 1
+                    break
+                } else {
+                    ui_debug "No [string toupper ${unarchive.type}] archive: ${unarchive.path}"
+                }
+            } else {
+                ui_debug "Skipping [string toupper ${unarchive.type}] archive: $errmsg"
+                set unsupported [expr $unsupported + 1]
+            }
+        }
+        if {$found == 1} {
+            ui_debug "Found [string toupper ${unarchive.type}] archive: ${unarchive.path}"
+        } else {
+            if {[info exists ports_binary_only] && $ports_binary_only == "yes"} {
+                return -code error "Archive for ${name} ${version}_${revision}${portvariants} not found, required when binary-only is set!"
+            } else {
+                if {[llength [option portarchivetype]] == $unsupported} {
+                    ui_debug "Skipping unarchive ($name) since specified archive types not supported"
+                } else {
+                    ui_debug "Skipping unarchive ($name) since no archive found"
+                }
+                set skipped 1
+            }
+        }
+    }
+    # Skip unarchive target by setting state
+    if {$skipped == 1} {
+        write_statefile target "org.macports.unarchive" $target_state_fd
+    }
 
-	return 0
+    return 0
 }
 
 proc portunarchive::unarchive_start {args} {
-	global UI_PREFIX name version revision portvariants
-	global unarchive.type
+    global UI_PREFIX name version revision portvariants
+    global unarchive.type
 
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Unpacking ${unarchive.type} archive for %s %s_%s%s"] $name $version $revision $portvariants]"
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Unpacking ${unarchive.type} archive for %s %s_%s%s"] $name $version $revision $portvariants]"
 
-	return 0
+    return 0
 }
 
 proc portunarchive::unarchive_command_setup {args} {
-	global unarchive.env unarchive.cmd
-	global unarchive.pre_args unarchive.args unarchive.post_args
-	global unarchive.type unarchive.path
-	global unarchive.pipe_cmd
-	global os.platform os.version env
+    global unarchive.env unarchive.cmd
+    global unarchive.pre_args unarchive.args unarchive.post_args
+    global unarchive.type unarchive.path
+    global unarchive.pipe_cmd
+    global os.platform os.version env
 
-	# Define appropriate unarchive command and options
-	set unarchive.env {}
-	set unarchive.cmd {}
-	set unarchive.pre_args {}
-	set unarchive.args {}
-	set unarchive.post_args {}
-	set unarchive.pipe_cmd ""
-	switch -regex ${unarchive.type} {
-		cp(io|gz) {
-			set pax "pax"
-			if {[catch {set pax [findBinary $pax ${portutil::autoconf::pax_path}]} errmsg] == 0} {
-				ui_debug "Using $pax"
-				set unarchive.cmd "$pax"
-				if {[info exists env(USER)] && $env(USER) == "root"} {
-					set unarchive.pre_args {-r -v -p e}
-				} else {
-					set unarchive.pre_args {-r -v -p p}
-				}
-				if {[regexp {z$} ${unarchive.type}]} {
-					set unarchive.args {.}
-					set gzip "gzip"
-					if {[catch {set gzip [findBinary $gzip ${portutil::autoconf::gzip_path}]} errmsg] == 0} {
-						ui_debug "Using $gzip"
-						set unarchive.pipe_cmd "$gzip -d -c ${unarchive.path} |"
-					} else {
-						ui_debug $errmsg
-						return -code error "No '$gzip' was found on this system!"
-					}
-				} else {
-					set unarchive.args "-f ${unarchive.path} ."
-				}
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$pax' was found on this system!"
-			}
-		}
-		t(ar|bz|lz|xz|gz) {
-			set tar "tar"
-			if {[catch {set tar [findBinary $tar ${portutil::autoconf::tar_path}]} errmsg] == 0} {
-				ui_debug "Using $tar"
-				set unarchive.cmd "$tar"
-				set unarchive.pre_args {-xvpf}
-				if {[regexp {z2?$} ${unarchive.type}]} {
-					set unarchive.args {-}
-					if {[regexp {bz2?$} ${unarchive.type}]} {
-						set gzip "bzip2"
-					} elseif {[regexp {lz$} ${unarchive.type}]} {
-						set gzip "lzma"
-					} elseif {[regexp {xz$} ${unarchive.type}]} {
-						set gzip "xz"
-					} else {
-						set gzip "gzip"
-					}
-					if {[info exists portutil::autoconf::${gzip}_path]} {
-					    set hint [set portutil::autoconf::${gzip}_path]
-					} else {
-					    set hint ""
-					}
-					if {[catch {set gzip [findBinary $gzip $hint]} errmsg] == 0} {
-						ui_debug "Using $gzip"
-						set unarchive.pipe_cmd "$gzip -d -c ${unarchive.path} |"
-					} else {
-						ui_debug $errmsg
-						return -code error "No '$gzip' was found on this system!"
-					}
-				} else {
-					set unarchive.args "${unarchive.path}"
-				}
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$tar' was found on this system!"
-			}
-		}
-		xar {
-			set xar "xar"
-			if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
-				ui_debug "Using $xar"
-				set unarchive.cmd "$xar"
-				set unarchive.pre_args {-xvpf}
-				set unarchive.args "${unarchive.path}"
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$xar' was found on this system!"
-			}
-		}
-		zip {
-			set unzip "unzip"
-			if {[catch {set unzip [findBinary $unzip ${portutil::autoconf::unzip_path}]} errmsg] == 0} {
-				ui_debug "Using $unzip"
-				set unarchive.cmd "$unzip"
-				if {[info exists env(USER)] && $env(USER) == "root"} {
-					set unarchive.pre_args {-oX}
-				} else {
-					set unarchive.pre_args {-o}
-				}
-				set unarchive.args "${unarchive.path} -d ."
-			} else {
-				ui_debug $errmsg
-				return -code error "No '$unzip' was found on this system!"
-			}
-		}
-		default {
-			return -code error "Invalid port archive type '${unarchive.type}' specified!"
-		}
-	}
+    # Define appropriate unarchive command and options
+    set unarchive.env {}
+    set unarchive.cmd {}
+    set unarchive.pre_args {}
+    set unarchive.args {}
+    set unarchive.post_args {}
+    set unarchive.pipe_cmd ""
+    switch -regex ${unarchive.type} {
+        cp(io|gz) {
+            set pax "pax"
+            if {[catch {set pax [findBinary $pax ${portutil::autoconf::pax_path}]} errmsg] == 0} {
+                ui_debug "Using $pax"
+                set unarchive.cmd "$pax"
+                if {[info exists env(USER)] && $env(USER) == "root"} {
+                    set unarchive.pre_args {-r -v -p e}
+                } else {
+                    set unarchive.pre_args {-r -v -p p}
+                }
+                if {[regexp {z$} ${unarchive.type}]} {
+                    set unarchive.args {.}
+                    set gzip "gzip"
+                    if {[catch {set gzip [findBinary $gzip ${portutil::autoconf::gzip_path}]} errmsg] == 0} {
+                        ui_debug "Using $gzip"
+                        set unarchive.pipe_cmd "$gzip -d -c ${unarchive.path} |"
+                    } else {
+                        ui_debug $errmsg
+                        return -code error "No '$gzip' was found on this system!"
+                    }
+                } else {
+                    set unarchive.args "-f ${unarchive.path} ."
+                }
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$pax' was found on this system!"
+            }
+        }
+        t(ar|bz|lz|xz|gz) {
+            set tar "tar"
+            if {[catch {set tar [findBinary $tar ${portutil::autoconf::tar_path}]} errmsg] == 0} {
+                ui_debug "Using $tar"
+                set unarchive.cmd "$tar"
+                set unarchive.pre_args {-xvpf}
+                if {[regexp {z2?$} ${unarchive.type}]} {
+                    set unarchive.args {-}
+                    if {[regexp {bz2?$} ${unarchive.type}]} {
+                        set gzip "bzip2"
+                    } elseif {[regexp {lz$} ${unarchive.type}]} {
+                        set gzip "lzma"
+                    } elseif {[regexp {xz$} ${unarchive.type}]} {
+                        set gzip "xz"
+                    } else {
+                        set gzip "gzip"
+                    }
+                    if {[info exists portutil::autoconf::${gzip}_path]} {
+                        set hint [set portutil::autoconf::${gzip}_path]
+                    } else {
+                        set hint ""
+                    }
+                    if {[catch {set gzip [findBinary $gzip $hint]} errmsg] == 0} {
+                        ui_debug "Using $gzip"
+                        set unarchive.pipe_cmd "$gzip -d -c ${unarchive.path} |"
+                    } else {
+                        ui_debug $errmsg
+                        return -code error "No '$gzip' was found on this system!"
+                    }
+                } else {
+                    set unarchive.args "${unarchive.path}"
+                }
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$tar' was found on this system!"
+            }
+        }
+        xar {
+            set xar "xar"
+            if {[catch {set xar [findBinary $xar ${portutil::autoconf::xar_path}]} errmsg] == 0} {
+                ui_debug "Using $xar"
+                set unarchive.cmd "$xar"
+                set unarchive.pre_args {-xvpf}
+                set unarchive.args "${unarchive.path}"
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$xar' was found on this system!"
+            }
+        }
+        zip {
+            set unzip "unzip"
+            if {[catch {set unzip [findBinary $unzip ${portutil::autoconf::unzip_path}]} errmsg] == 0} {
+                ui_debug "Using $unzip"
+                set unarchive.cmd "$unzip"
+                if {[info exists env(USER)] && $env(USER) == "root"} {
+                    set unarchive.pre_args {-oX}
+                } else {
+                    set unarchive.pre_args {-o}
+                }
+                set unarchive.args "${unarchive.path} -d ."
+            } else {
+                ui_debug $errmsg
+                return -code error "No '$unzip' was found on this system!"
+            }
+        }
+        default {
+            return -code error "Invalid port archive type '${unarchive.type}' specified!"
+        }
+    }
 
-	return 0
+    return 0
 }
 
 proc portunarchive::unarchive_main {args} {
-	global UI_PREFIX
-	global name version revision portvariants
-	global unarchive.dir unarchive.file unarchive.pipe_cmd
+    global UI_PREFIX
+    global name version revision portvariants
+    global unarchive.dir unarchive.file unarchive.pipe_cmd
 
-	# Setup unarchive command
-	unarchive_command_setup
+    # Setup unarchive command
+    unarchive_command_setup
 
-	# Create destination directory for unpacking
-	if {![file isdirectory ${unarchive.dir}]} {
-		file mkdir ${unarchive.dir}
-	}
+    # Create destination directory for unpacking
+    if {![file isdirectory ${unarchive.dir}]} {
+        file mkdir ${unarchive.dir}
+    }
 
-	# Unpack the archive
-	ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] ${unarchive.file}]"
-	if {${unarchive.pipe_cmd} == ""} {
-		command_exec unarchive
-	} else {
-		command_exec unarchive "${unarchive.pipe_cmd} (" ")"
-	}
+    # Unpack the archive
+    ui_info "$UI_PREFIX [format [msgcat::mc "Extracting %s"] ${unarchive.file}]"
+    if {${unarchive.pipe_cmd} == ""} {
+        command_exec unarchive
+    } else {
+        command_exec unarchive "${unarchive.pipe_cmd} (" ")"
+    }
 
-	return 0
+    return 0
 }
 
 proc portunarchive::unarchive_finish {args} {
-	global UI_PREFIX target_state_fd unarchive.file name workpath destpath
+    global UI_PREFIX target_state_fd unarchive.file name workpath destpath
 
-	# Reset state file with archive version
+    # Reset state file with archive version
     set statefile [file join $workpath .macports.${name}.state]
-	file copy -force [file join $destpath "+STATE"] $statefile
-	file mtime $statefile [clock seconds]
+    file copy -force [file join $destpath "+STATE"] $statefile
+    file mtime $statefile [clock seconds]
 
 # Hack to temporarily move com.apple.* strings in statefiles extracted from old archives
 # to the org.macports.* namespace. "temporarily" because old archives will still have a
@@ -308,7 +317,7 @@
     set fd_new_sf [open $statefile r]
     set fd_tmp [open ${statefile}.tmp w+]
     while {[gets $fd_new_sf line] >= 0} {
-	puts $fd_tmp "[regsub com.apple $line org.macports]"
+    puts $fd_tmp "[regsub com.apple $line org.macports]"
     }
     close $fd_new_sf
     close $fd_tmp
@@ -317,14 +326,13 @@
     # Update the state from unpacked archive version
     set target_state_fd [open_statefile]
     
-	# Cleanup all control files when finished
-	set control_files [glob -nocomplain -types f [file join $destpath +*]]
-	foreach file $control_files {
-		ui_debug "Removing $file"
-		file delete -force $file
-	}
+    # Cleanup all control files when finished
+    set control_files [glob -nocomplain -types f [file join $destpath +*]]
+    foreach file $control_files {
+        ui_debug "Removing $file"
+        file delete -force $file
+    }
 
-	ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s unpacked"] ${unarchive.file}]"
-	return 0
+    ui_info "$UI_PREFIX [format [msgcat::mc "Archive %s unpacked"] ${unarchive.file}]"
+    return 0
 }
-

Modified: branches/gsoc09-logging/base/src/port/port.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port/port.tcl	2009-10-31 19:54:00 UTC (rev 60074)
+++ branches/gsoc09-logging/base/src/port/port.tcl	2009-11-01 06:35:21 UTC (rev 60075)
@@ -434,11 +434,11 @@
         if {[isatty stdout]} {
             set size [term_get_size stdout]
 
-            if {![info exists env(LINES)]} {
+            if {![info exists env(LINES)] && [lindex $size 0] > 0} {
                 set env(LINES) [lindex $size 0]
             }
 
-            if {![info exists env(COLUMNS)]} {
+            if {![info exists env(COLUMNS)] && [lindex $size 1] > 0} {
                 set env(COLUMNS) [lindex $size 1]
             }
         }

Modified: branches/gsoc09-logging/base/src/port1.0/portutil.tcl
===================================================================
--- branches/gsoc09-logging/base/src/port1.0/portutil.tcl	2009-10-31 19:54:00 UTC (rev 60074)
+++ branches/gsoc09-logging/base/src/port1.0/portutil.tcl	2009-11-01 06:35:21 UTC (rev 60075)
@@ -358,6 +358,8 @@
     if {[option macosx_deployment_target] ne ""} {
         set ${command}.env_array(MACOSX_DEPLOYMENT_TARGET) [option macosx_deployment_target]
     }
+    set ${command}.env_array(CC_PRINT_OPTIONS) "YES"
+    set ${command}.env_array(CC_PRINT_OPTIONS_FILE) [file join [option workpath] ".CC_PRINT_OPTIONS"]
     if {[option compiler.cpath] ne ""} {
         set ${command}.env_array(CPATH) [join [option compiler.cpath] :]
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091031/e512cb31/attachment-0001.html>


More information about the macports-changes mailing list