[MacPorts] PortfileRecipes modified

MacPorts noreply at macports.org
Tue Mar 5 16:29:38 PST 2013


Page "PortfileRecipes" was changed by cal at macports.org
Diff URL: <https://trac.macports.org/wiki/PortfileRecipes?action=diff&version=50>
Revision 50
Comment: save WIP
Changes:
-------8<------8<------8<------8<------8<------8<------8<------8<--------
Index: PortfileRecipes
=========================================================================
--- PortfileRecipes (version: 49)
+++ PortfileRecipes (version: 50)
@@ -464,3 +464,11 @@
     }
 }
 }}}
+
+ - `registry_active` takes a port name as argument and returns a list of matching active ports. It is defined in code:trunk/base/src/macports1.0/macports.tcl as an alias of `registry::active`. While it might seem odd that it returns a list, it makes sense if you know that it will return a list of all active ports when called with an empty argument.
+ - `registry::active` is defined in code:trunk/base/src/registry2.0/registry.tcl. The only relevant case (since we're all using the SQLite registry by now) forwards the call to `receipt_sqlite::active` (in code:trunk/base/src/registry2.0/receipt_sqlite.tcl), where it queries all matching ports using `registry::entry installed $name` (which is defined as `entry_installed` in code:trunk/base/src/registry2.0/entry.c, if you want to dig in). It then converts the returned list of registry entry objects to a Tcl list using the following line of code (which is the reason why we've been digging through the code):
+{{{
+foreach port $ports {
+    lappend rlist [list [$port name] [$port version] [$port revision] [$port variants] [string equal [$port state] "installed"] [$port epoch]]
+}
+}}}
-------8<------8<------8<------8<------8<------8<------8<------8<--------

--
Page URL: <https://trac.macports.org/wiki/PortfileRecipes>
MacPorts <http://www.macports.org/>
Ports system for OS X

This is an automated message. Someone added your email address to be
notified of changes on 'PortfileRecipes' page.
If it was not you, please report to .


More information about the macports-changes mailing list