[119691] trunk/base/src/package1.0

cal at macports.org cal at macports.org
Sat May 3 15:27:43 PDT 2014


Revision: 119691
          https://trac.macports.org/changeset/119691
Author:   cal at macports.org
Date:     2014-05-03 15:27:43 -0700 (Sat, 03 May 2014)
Log Message:
-----------
base: package1.0/port{dpkg,s?rpm}.tcl: Replace eval with {*}, unify whitespace

Modified Paths:
--------------
    trunk/base/src/package1.0/portdpkg.tcl
    trunk/base/src/package1.0/portrpm.tcl
    trunk/base/src/package1.0/portsrpm.tcl

Modified: trunk/base/src/package1.0/portdpkg.tcl
===================================================================
--- trunk/base/src/package1.0/portdpkg.tcl	2014-05-03 22:22:56 UTC (rev 119690)
+++ trunk/base/src/package1.0/portdpkg.tcl	2014-05-03 22:27:43 UTC (rev 119691)
@@ -188,10 +188,10 @@
 			# xxx: only examines the portfile component of the depspec
 			set depends {}
 			if {[info exists portinfo(depends_run)]} {
-				eval "lappend depends $portinfo(depends_run)"
+				lappend depends {*}$portinfo(depends_run)
 			}
 			if {[info exists portinfo(depends_lib)]} {
-				eval "lappend depends $portinfo(depends_lib)"
+				lappend depends {*}$portinfo(depends_lib)
 			}
 
 			foreach depspec $depends {

Modified: trunk/base/src/package1.0/portrpm.tcl
===================================================================
--- trunk/base/src/package1.0/portrpm.tcl	2014-05-03 22:22:56 UTC (rev 119690)
+++ trunk/base/src/package1.0/portrpm.tcl	2014-05-03 22:27:43 UTC (rev 119691)
@@ -92,7 +92,7 @@
     foreach dir [list "${prefix}/src/macports/RPMS" "${prefix}/src/apple/RPMS" "/usr/src/apple/RPMS" "/macports/rpms/RPMS"] {
         foreach arch [list ${configure.build_arch} ${os.arch} "fat" "noarch"] {
             set rpmpath "$dir/${arch}/${portname}-${portversion}-${portrevision}.${arch}.rpm"
-	    if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
+            if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
                 ui_debug "$rpmpath"
                 ui_msg "$UI_PREFIX [format [msgcat::mc "RPM package for %s version %s is up-to-date"] ${portname} ${portversion}]"
                 return 0
@@ -125,8 +125,8 @@
         }
     }
 
-	# depend on system (virtual packages for apple stuff)
-	lappend dependencies "org.macports.${os.platform}${os.major}"
+    # depend on system (virtual packages for apple stuff)
+    lappend dependencies "org.macports.${os.platform}${os.major}"
 
     set listpath ${workpath}/${portname}.filelist
     system "rm -f '${workpath}/${portname}.filelist' && touch '${workpath}/${portname}.filelist'"
@@ -142,8 +142,8 @@
 proc portrpm::make_dependency_list {portname} {
     set result {}
     if {[catch {set res [mport_lookup $portname]} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
+        global errorInfo
+        ui_debug "$errorInfo"
         ui_error "port lookup failed: $error"
         return 1
     }
@@ -154,14 +154,18 @@
             # get the union of depends_run and depends_lib
             # xxx: only examines the portfile component of the depspec
             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_run)]} {
+                lappend depends {*}$portinfo(depends_run)
+            }
+            if {[info exists portinfo(depends_lib)]} {
+                lappend depends {*}$portinfo(depends_lib)
+            }
 
             foreach depspec $depends {
                 set dep [lindex [split $depspec :] end]
 
                 # xxx: nasty hack
-                if {$dep != "XFree86"} {
+                if {$dep ne "XFree86"} {
                     lappend result {*}[make_dependency_list $dep]
                 }
             }
@@ -181,21 +185,21 @@
     set words [split $orig]
     set numWords [llength $words]
     for {set cnt 0} {$cnt < $numWords} {incr cnt} {
-	set w [lindex $words $cnt]
-	set wLen [string length $w]
+        set w [lindex $words $cnt]
+        set wLen [string length $w]
 
-	if {($pos+$wLen < $Length)} {
-	    # append word to current line
-	    if {$pos} {append line " "; incr pos}
-	    append line $w
-	    incr pos $wLen
-	} else {
-	    # line full => write buffer and  begin a new line
-	    if {[string length $text]} {append text "\n"}
-	    append text $line
-	    set line $w
-	    set pos $wLen
-	}
+        if {($pos+$wLen < $Length)} {
+            # append word to current line
+            if {$pos} {append line " "; incr pos}
+            append line $w
+            incr pos $wLen
+        } else {
+            # line full => write buffer and  begin a new line
+            if {[string length $text]} {append text "\n"}
+            append text $line
+            set line $w
+            set pos $wLen
+        }
     }
 
     if {[string length $text]} {append text "\n"}
@@ -228,12 +232,12 @@
 BuildRoot: ${destroot}
 AutoReq: no"
     if {$epoch != 0} {
-	    puts $specfd "Epoch: ${epoch}"
+        puts $specfd "Epoch: ${epoch}"
     }
     if {[llength ${dependencies}] != 0} {
-	foreach require ${dependencies} {
-	    puts $specfd "Requires: [regsub -all -- "\-" $require "_"]"
-	}
+        foreach require ${dependencies} {
+            puts $specfd "Requires: [regsub -all -- "\-" $require "_"]"
+        }
     }
     set wrap_description [word_wrap ${long_description} 72]
     puts $specfd "

Modified: trunk/base/src/package1.0/portsrpm.tcl
===================================================================
--- trunk/base/src/package1.0/portsrpm.tcl	2014-05-03 22:22:56 UTC (rev 119690)
+++ trunk/base/src/package1.0/portsrpm.tcl	2014-05-03 22:27:43 UTC (rev 119691)
@@ -81,7 +81,7 @@
     foreach dir [list "${prefix}/src/macports/SRPMS" "${prefix}/src/apple/SRPMS" "/usr/src/apple/SRPMS" "/macports/rpms/SRPMS"] {
         foreach arch {"src" "nosrc"} {
             set rpmpath "$dir/${portname}-${portversion}-${portrevision}.${arch}.rpm"
-	    if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
+            if {[file readable $rpmpath] && ([file mtime ${rpmpath}] >= [file mtime ${portpath}/Portfile])} {
                 ui_debug "$rpmpath"
                 ui_msg "$UI_PREFIX [format [msgcat::mc "SRPM package for %s version %s is up-to-date"] ${portname} ${portversion}]"
                 return 0
@@ -141,8 +141,8 @@
 proc portsrpm::make_dependency_list {portname} {
     set result {}
     if {[catch {set res [mport_lookup $portname]} error]} {
-		global errorInfo
-		ui_debug "$errorInfo"
+        global errorInfo
+        ui_debug "$errorInfo"
         ui_error "port lookup failed: $error"
         return 1
     }
@@ -154,10 +154,18 @@
             # get the union of depends_fetch, depends_extract, depends_build and depends_lib
             # xxx: only examines the portfile component of the depspec
             set depends {}
-            if {[info exists portinfo(depends_fetch)]} { eval "lappend depends $portinfo(depends_fetch)" }
-            if {[info exists portinfo(depends_extract)]} { eval "lappend depends $portinfo(depends_extract)" }
-            if {[info exists portinfo(depends_build)]} { eval "lappend depends $portinfo(depends_build)" }
-            if {[info exists portinfo(depends_lib)]} { eval "lappend depends $portinfo(depends_lib)" }
+            if {[info exists portinfo(depends_fetch)]} {
+                lappend depends {*}$portinfo(depends_fetch)
+            }
+            if {[info exists portinfo(depends_extract)]} {
+                lappend depends {*}$portinfo(depends_extract)
+            }
+            if {[info exists portinfo(depends_build)]} {
+                lappend depends {*}$portinfo(depends_build)
+            }
+            if {[info exists portinfo(depends_lib)]} {
+                lappend depends {*}$portinfo(depends_lib)
+            }
 
             foreach depspec $depends {
                 set dep [lindex [split $depspec :] end]
@@ -183,21 +191,21 @@
     set words [split $orig]
     set numWords [llength $words]
     for {set cnt 0} {$cnt < $numWords} {incr cnt} {
-	set w [lindex $words $cnt]
-	set wLen [string length $w]
+        set w [lindex $words $cnt]
+        set wLen [string length $w]
 
-	if {($pos+$wLen < $Length)} {
-	    # append word to current line
-	    if {$pos} {append line " "; incr pos}
-	    append line $w
-	    incr pos $wLen
-	} else {
-	    # line full => write buffer and  begin a new line
-	    if {[string length $text]} {append text "\n"}
-	    append text $line
-	    set line $w
-	    set pos $wLen
-	}
+        if {($pos+$wLen < $Length)} {
+            # append word to current line
+            if {$pos} {append line " "; incr pos}
+            append line $w
+            incr pos $wLen
+        } else {
+            # line full => write buffer and  begin a new line
+            if {[string length $text]} {append text "\n"}
+            append text $line
+            set line $w
+            set pos $wLen
+        }
     }
 
     if {[string length $text]} {append text "\n"}
@@ -228,7 +236,7 @@
         puts $specfd "Source1: $zip"
     }
     if {$epoch != 0} {
-	    puts $specfd "Epoch: ${epoch}"
+        puts $specfd "Epoch: ${epoch}"
     }
     set first 2
     set count $first
@@ -254,9 +262,9 @@
     }
     puts $specfd "AutoReq: no"
     if {[llength ${dependencies}] != 0} {
-	foreach require ${dependencies} {
-	    puts $specfd "BuildRequires: [regsub -all -- "\-" $require "_"]"
-	}
+        foreach require ${dependencies} {
+            puts $specfd "BuildRequires: [regsub -all -- "\-" $require "_"]"
+        }
     }
     set wrap_description [word_wrap ${long_description} 72]
     if {$zip ne ""} {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140503/7df37278/attachment-0001.html>


More information about the macports-changes mailing list