Hi Bradley, I'm having a bit difficulty in implementing the body of snapshot procedure. Basically what I need to do now is (as I have written in my notes, so you can tell me if I'm on right track in my thoughts as well):
"get the list of installed ports, their-installed-variants and if-requested, then add one port at a time to the 2nd table, its variants to the 3rd table, after all this, add an entry in the snapshot table for the entire snapshot, that's it." I can get this info from `port -v installed` and `port -v installed requested` command, that is, calling *action_installed* [1] which in turn, calls *registry::installed* [2] for each port from *snapshot_main*. Is this best way to go? Further, can you point me to some port action where it deals with retrieving and populating tables as a hint? The *action_target* used for most of the port commands like *install*, *clean*, *fetch* doesn't really hint on how to deal with it. I hunted down till I reached *macports::registry.format* --> *receipt_{flat/sqlite}.tcl *files which have a bunch of functions using *registry::entry* which I think is the most "basic" operation and then, also *receipt_sqlite::* *create_entry_l* function. Do I need to write for inserting into tables? If yes, write direct SQL queries or Tcl procedures ( a better way, I think)? Any help would be appreciated. Regards, Umesh [1]: https://github.com/macports/macports-base/blob/master/src/port/port.tcl#L3266 [2]: https://github.com/macports/macports-base/blob/master/src/registry2.0/registry.tcl#L136