[137688] branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv. tcl

ijackson at macports.org ijackson at macports.org
Wed Jun 17 08:24:46 PDT 2015


Revision: 137688
          https://trac.macports.org/changeset/137688
Author:   ijackson at macports.org
Date:     2015-06-17 08:24:45 -0700 (Wed, 17 Jun 2015)
Log Message:
-----------
Add more information to solvables.
Add epoch, version and revision to each solvable using
$portinfo array. Update to-do and done list in comment header.
Add debug options for printing the information of solvables.

Modified Paths:
--------------
    branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl

Modified: branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl
===================================================================
--- branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl	2015-06-17 14:36:58 UTC (rev 137687)
+++ branches/gsoc15-dependency/base/src/macports1.0/macports_libsolv.tcl	2015-06-17 15:24:45 UTC (rev 137688)
@@ -59,7 +59,9 @@
     ## Procedure to create the libsolv pool. This is similar to PortIndex. \
     #  Read the PortIndex contents and write into libsolv readable solv's.
     #  To Do:
-    #  Add additional information regarding version, description, dependency, etc to solv.
+    #  Add additional information regarding arch, vendor, description, dependency, etc to solv.
+    #  Done:
+    #  Add epoch, version and revision to each solv.
     proc create_pool {} {
         variable pool
         variable portindexinfo
@@ -83,14 +85,19 @@
                         while {[gets $fd line] >= 0} {
                             # Create a solvable for each port processed.
                             set solvable [$repo add_solvable]
-                            
+
+                            ## Clear the portinfo contents to prevent attribute leak from previous iterations
                             array unset portinfo
                             set name [lindex $line 0]
                             set len  [lindex $line 1]
                             set line [read $fd $len]
                             
-                            $solvable configure -name $name
+                            array set portinfo $line
 
+                            $solvable configure -name $name \
+                            -evr "$portinfo(epoch)@$portinfo(version)-$portinfo(revision)" \
+                            -arch "i386"
+
                             ## Set portinfo of each solv object. Map it to correct solvid.
                             set portindexinfo([$solvable cget -id]) $line
                         }
@@ -153,6 +160,9 @@
 
         ## This prints all the solvable's information that matched the pattern.
         foreach s [$sel solvables] {
+            ## Print information about mathed solvable on debug option.
+            ui_debug "solvable = [$s __str__]"
+
             lappend matches [$s cget -name]
             lappend matches $portindexinfo([$s cget -id])
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150617/c778874b/attachment-0001.html>


More information about the macports-changes mailing list