[50381] branches/images-and-archives/base

blb at macports.org blb at macports.org
Wed Apr 29 17:17:47 PDT 2009


Revision: 50381
          http://trac.macports.org/changeset/50381
Author:   blb at macports.org
Date:     2009-04-29 17:17:47 -0700 (Wed, 29 Apr 2009)
Log Message:
-----------
Merge updates from trunk

Modified Paths:
--------------
    branches/images-and-archives/base/portmgr/bots/trac.rb
    branches/images-and-archives/base/src/port/port.tcl
    branches/images-and-archives/base/src/port1.0/portinstall.tcl
    branches/images-and-archives/base/src/port1.0/portlint.tcl

Removed Paths:
-------------
    branches/images-and-archives/base/doc/TODO.txt

Property Changed:
----------------
    branches/images-and-archives/base/


Property changes on: branches/images-and-archives/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:50249-50379
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Deleted: branches/images-and-archives/base/doc/TODO.txt
===================================================================
--- branches/images-and-archives/base/doc/TODO.txt	2009-04-30 00:11:27 UTC (rev 50380)
+++ branches/images-and-archives/base/doc/TODO.txt	2009-04-30 00:17:47 UTC (rev 50381)
@@ -1,11 +0,0 @@
-#
-# $Id$
-#
-# MacPorts TODO List
-#
-# This is a partial list of items to be completed, or considered, for future
-# revisions.
-#
-
-Outstanding ToDos:
-

Modified: branches/images-and-archives/base/portmgr/bots/trac.rb
===================================================================
--- branches/images-and-archives/base/portmgr/bots/trac.rb	2009-04-30 00:11:27 UTC (rev 50380)
+++ branches/images-and-archives/base/portmgr/bots/trac.rb	2009-04-30 00:17:47 UTC (rev 50381)
@@ -17,8 +17,12 @@
 		case topic
 		  when "ticket"
 			return "ticket <ticket no.> => show http link for ticket # <ticket no.>"
+		  when "faq"
+			return "faq => show FAQs' URL"
+		  when "guide"
+			return "guide [chunked] => show The Guide's URL. Don't Panic."		 
 		  else
-			return "trac commands: ticket"
+			return "trac module provides: !ticket, !faq, !guide"
 		end
 	end
 
@@ -31,8 +35,22 @@
 			m.reply "Use either #1234 or 1234 for ticket number"
 		end
 	end
+
+	def faq(m, params)
+		m.reply "FAQs are at: http://trac.macports.org/wiki/FAQ"
+	end
+
+	def guide(m, params)
+		if ( params[:parm] == "chunked" )
+			m.reply "http://guide.macports.org/chunked/index.html"
+		else
+			m.reply "http://guide.macports.org/"
+		end
+	end
 	
 end
 
 plugin = TracPlugin.new
 plugin.map 'ticket :number', :action => 'ticket'
+plugin.map 'faq :parm', :action => 'faq'
+plugin.map 'guide :parm', :action => 'guide'
\ No newline at end of file

Modified: branches/images-and-archives/base/src/port/port.tcl
===================================================================
--- branches/images-and-archives/base/src/port/port.tcl	2009-04-30 00:11:27 UTC (rev 50380)
+++ branches/images-and-archives/base/src/port/port.tcl	2009-04-30 00:17:47 UTC (rev 50381)
@@ -407,12 +407,12 @@
 }
 
 proc portlist_compareint { a b } {
-    array set a_ [list "name" [lindex $a 0] "version" [lindex $a 1] "revision" [lindex $a 2]]
-    array set b_ [list "name" [lindex $b 0] "version" [lindex $b 1] "revision" [lindex $b 2]]
+    array set a_ [list "name" [lindex $a 0] "version" "[lindex $a 1]_[lindex $a 2]"]
+    array set b_ [list "name" [lindex $b 0] "version" "[lindex $b 1]_[lindex $b 2]"]
     return [portlist_compare [array get a_] [array get b_]]
 }
 
-# Same as portlist_sort, but with numeric indexes
+# Same as portlist_sort, but with numeric indexes {name version revision}
 proc portlist_sortint { list } {
     return [lsort -command portlist_compareint $list]
 }

Modified: branches/images-and-archives/base/src/port1.0/portinstall.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portinstall.tcl	2009-04-30 00:11:27 UTC (rev 50380)
+++ branches/images-and-archives/base/src/port1.0/portinstall.tcl	2009-04-30 00:17:47 UTC (rev 50381)
@@ -51,43 +51,42 @@
 set_ui_prefix
 
 proc portinstall::install_start {args} {
-	global UI_PREFIX portname portversion portrevision variations portvariants
-	global install.asroot prefix
-	ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
-	
-	# start gsoc08-privileges
-	if { [tbool install.asroot] } {
-		# if port is marked as needing root	
-		elevateToRoot "install"
-	} elseif { ![file writable $prefix] } {
-		# if install location is not writable, need root privileges to install
-		elevateToRoot "install"
-	}
-	# end gsoc08-privileges
-	
+    global UI_PREFIX portname portversion portrevision variations portvariants
+    global install.asroot prefix
+    ui_msg "$UI_PREFIX [format [msgcat::mc "Installing %s @%s_%s%s"] $portname $portversion $portrevision $portvariants]"
+    
+    # start gsoc08-privileges
+    if { [tbool install.asroot] } {
+        # if port is marked as needing root
+        elevateToRoot "install"
+    } elseif { ![file writable $prefix] } {
+        # if install location is not writable, need root privileges to install
+        elevateToRoot "install"
+    }
+    # end gsoc08-privileges
 }
 
 proc portinstall::install_element {src_element dst_element} {
     # don't recursively copy directories
     if {[file isdirectory $src_element] && [file type $src_element] != "link"} {
-	file mkdir $dst_element
+        file mkdir $dst_element
     } else {
-	file copy -force $src_element $dst_element
+        file copy -force $src_element $dst_element
     }
     
     # if the file is a symlink, do not try to set file attributes
     # if the destination file is an existing directory,
     # do not overwrite its file attributes
     if {[file type $src_element] != "link" || [file isdirectory $dst_element]} {
-	set attributes [file attributes $src_element]	
-	for {set i 0} {$i < [llength $attributes]} {incr i} {
-	    set opt [lindex $attributes $i]
-	    incr i
-	    set arg [lindex $attributes $i]
-	    file attributes $dst_element $opt $arg
-	    # set mtime on installed element
-	    exec touch -r $src_element $dst_element
-	}
+        set attributes [file attributes $src_element]
+        for {set i 0} {$i < [llength $attributes]} {incr i} {
+            set opt [lindex $attributes $i]
+            incr i
+            set arg [lindex $attributes $i]
+            file attributes $dst_element $opt $arg
+            # set mtime on installed element
+            exec touch -r $src_element $dst_element
+        }
     }
 }
 
@@ -95,95 +94,95 @@
     global installPlist
     set pwd [pwd]
     if {[catch {_cd $workdir} err]} {
-	puts $err
-	return
+        puts $err
+        return
     }
     
     foreach name [readdir .] {
-	set element [file join $cwd $name]
-	
-	# XXX jpm's cross-platform code to find file separator
-	# replace with [file seperator] with tcl 8.4
-	if {![info exists root]} {
-	    if {[string match [file tail "/monkey"] "monkey"]} {
-		set root "/"
-	    } elseif {[string match [file tail ":monkey"] "monkey"]} {
-		set root ":" 
-	    } else {
-		set root "\\"		
-	    }
-	}
-	
-	set imagedir [registry_prop_retr $regref imagedir]
-	set root [file join $root $imagedir]
-	
-	set dst_element [file join $root $element]
-	set src_element [file join $rootdir $element]
-	# overwrites files but not directories
-	if {![file exists $dst_element] || ![file isdirectory $dst_element]} {
-		if {[file type $src_element] == "link"} {
-			ui_debug "installing link: $dst_element"
-		} elseif {[file isdirectory $src_element]} {
-			ui_debug "installing directory: $dst_element"
-		} else {
-			ui_debug "installing file: $dst_element"
-		}
-	    install_element $src_element $dst_element
-		# only track files/links for registry, not directories
-		if {[file type $dst_element] != "directory"} {
-			lappend installPlist $dst_element
-		}
-	}
-	if {[file isdirectory $name] && [file type $name] != "link"} {
-	    directory_dig $rootdir $name $regref [file join $cwd $name]
-	}
+        set element [file join $cwd $name]
+
+        # XXX jpm's cross-platform code to find file separator
+        # replace with [file seperator] with tcl 8.4
+        if {![info exists root]} {
+            if {[string match [file tail "/monkey"] "monkey"]} {
+                set root "/"
+            } elseif {[string match [file tail ":monkey"] "monkey"]} {
+                set root ":" 
+            } else {
+                set root "\\"
+            }
+        }
+
+        set imagedir [registry_prop_retr $regref imagedir]
+        set root [file join $root $imagedir]
+
+        set dst_element [file join $root $element]
+        set src_element [file join $rootdir $element]
+        # overwrites files but not directories
+        if {![file exists $dst_element] || ![file isdirectory $dst_element]} {
+            if {[file type $src_element] == "link"} {
+                ui_debug "installing link: $dst_element"
+            } elseif {[file isdirectory $src_element]} {
+                ui_debug "installing directory: $dst_element"
+            } else {
+                ui_debug "installing file: $dst_element"
+            }
+            install_element $src_element $dst_element
+            # only track files/links for registry, not directories
+            if {[file type $dst_element] != "directory"} {
+                lappend installPlist $dst_element
+            }
+        }
+        if {[file isdirectory $name] && [file type $name] != "link"} {
+            directory_dig $rootdir $name $regref [file join $cwd $name]
+        }
     }
     _cd $pwd
 }
 
 proc portinstall::install_main {args} {
-	global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
-
-	# Begin the registry entry
-   	set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
+    global portname portversion portpath categories description long_description homepage depends_run installPlist package-install uninstall workdir worksrcdir pregrefix UI_PREFIX destroot portrevision maintainers ports_force portvariants targets depends_lib PortInfo epoch
     
-  	# Install the files	
-	directory_dig ${destroot} ${destroot} ${regref}
+    # Begin the registry entry
+    set regref [registry_new $portname $portversion $portrevision $portvariants $epoch]
     
-	registry_prop_store $regref categories $categories
+    # Install the files
+    directory_dig ${destroot} ${destroot} ${regref}
     
+    registry_prop_store $regref categories $categories
+    
     if {[info exists description]} {
-		registry_prop_store $regref description $description
+        registry_prop_store $regref description $description
     }
     if {[info exists long_description]} {
-		registry_prop_store $regref long_description ${long_description}
+        registry_prop_store $regref long_description ${long_description}
     }
     if {[info exists homepage]} {
-		registry_prop_store $regref homepage ${homepage}
+        registry_prop_store $regref homepage ${homepage}
     }
-	if {[info exists maintainers]} {
-		registry_prop_store $regref maintainers ${maintainers}
+    if {[info exists maintainers]} {
+        registry_prop_store $regref maintainers ${maintainers}
     }
-	if {[info exists depends_run]} {
-		registry_prop_store $regref depends_run $depends_run
-		registry_register_deps $depends_run $portname
+    if {[info exists depends_run]} {
+        registry_prop_store $regref depends_run $depends_run
+        registry_register_deps $depends_run $portname
     }
-	if {[info exists depends_lib]} {
-		registry_prop_store $regref depends_lib $depends_lib
-		registry_register_deps $depends_lib $portname
-	}
+    if {[info exists depends_lib]} {
+        registry_prop_store $regref depends_lib $depends_lib
+        registry_register_deps $depends_lib $portname
+    }
     if {[info exists installPlist]} {
-		registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
-	}
-	if {[info exists package-install]} {
-		registry_prop_store $regref package-install ${package-install}
+        registry_prop_store $regref contents [registry_fileinfo_for_index $installPlist]
     }
+    if {[info exists package-install]} {
+        registry_prop_store $regref package-install ${package-install}
+    }
     if {[info proc pkg_uninstall] == "pkg_uninstall"} {
-		registry_prop_store $regref uninstall [proc_disasm pkg_uninstall]
+        registry_prop_store $regref uninstall [proc_disasm pkg_uninstall]
     }
-	
-	registry_write $regref 
-
+    
+    registry_write $regref
+    
     return 0
 }
 
@@ -192,12 +191,12 @@
     append p $pname " \{"
     set space ""
     foreach arg [info args $pname] {
-	if {[info default $pname $arg value]} {
-	    append p "$space{" [list $arg $value] "}"
-	} else {
-	    append p $space $arg
-	}
-	set space " "
+        if {[info default $pname $arg value]} {
+            append p "$space{" [list $arg $value] "}"
+        } else {
+            append p $space $arg
+        }
+        set space " "
     }
     append p "\} \{" [info body $pname] "\}"
     return $p

Modified: branches/images-and-archives/base/src/port1.0/portlint.tcl
===================================================================
--- branches/images-and-archives/base/src/port1.0/portlint.tcl	2009-04-30 00:11:27 UTC (rev 50380)
+++ branches/images-and-archives/base/src/port1.0/portlint.tcl	2009-04-30 00:17:47 UTC (rev 50381)
@@ -122,6 +122,8 @@
     set seen_portgroup false
     set in_description false
 
+    array set portgroups {}
+
     set local_variants [list]
 
     set f [open $portfile RDONLY]
@@ -149,7 +151,7 @@
             incr errors
         }
 
-        if {[string equal "PortSystem" $require_after] && \
+        if {($require_after == "PortSystem" || $require_after == "PortGroup") && \
             [string match "PortGroup*" $line]} {
             set require_blank false
         }
@@ -200,15 +202,17 @@
             set require_after "PortSystem"
         }
         if {[string match "PortGroup*" $line]} {
-            if {$seen_portgroup} {
-                ui_error "Line $lineno repeats PortGroup information"
-                incr errors
-            }
             regexp {PortGroup\s+([a-z0-9]+)\s+([0-9.]+)} $line -> portgroup portgroupversion
             if {![info exists portgroup]} {
                 ui_error "Line $lineno has unrecognized PortGroup"
                 incr errors
             }
+            if {[info exists portgroups($portgroup)]} {
+                ui_error "Line $lineno repeats PortGroup information"
+                incr errors
+            } else {
+                set portgroups($portgroup) $portgroupversion
+            }
             set seen_portgroup true
             set require_blank true
             set require_after "PortGroup"
@@ -241,7 +245,9 @@
             incr warnings
         }
 
-        if {![regexp {^PortSystem|^PortGroup|^version|^(perl5|ruby|haskell|php5extension|php5peclextension).setup} $line]
+        # Check for hardcoded version numbers
+        if {![regexp {^PortSystem|^PortGroup|^version} $line]
+                && ![regexp {^[a-z0-9]+\.setup} $line]
                 && [string first [option version] $line] != -1} {
             ui_warn "Line $lineno seems to hardcode the version number, consider using \${version} instead"
             incr warnings
@@ -274,13 +280,17 @@
     } else {
         ui_info "OK: Found PortSystem $portsystem"
     }
-    if (!$seen_portgroup) {
-        # PortGroup is optional, so missing is OK
-    }  elseif {![file exists [getportresourcepath $porturl "port1.0/group/${portgroup}-${portgroupversion}.tcl"]]} {
-        ui_error "Unknown PortGroup: $portgroup-$portgroupversion"
-        incr errors
-    } else {
-        ui_info "OK: Found PortGroup $portgroup-$portgroupversion"
+
+    if ($seen_portgroup) {
+        # Using a PortGroup is optional
+        foreach {portgroup portgroupversion} [array get portgroups] {
+            if {![file exists [getportresourcepath $porturl "port1.0/group/${portgroup}-${portgroupversion}.tcl"]]} {
+                ui_error "Unknown PortGroup: $portgroup-$portgroupversion"
+                incr errors
+            } else {
+                ui_info "OK: Found PortGroup $portgroup-$portgroupversion"
+            }
+        }
     }
 
     foreach req_var $lint_required {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090429/8aa69ae8/attachment-0001.html>


More information about the macports-changes mailing list