<div dir="ltr"><font color="#000000">Hi Bradley,</font><div><font color="#000000"><br></font></div><div><font color="#000000">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):</font></div><div><font color="#000000"><br></font></div><div><font color="#000000">"<span style="font-family:"Helvetica Neue"">get the list of installed ports, their-installed-variants and if-requested, </span></font></div><div><span style="color:rgb(0,0,0)">then add one port at a time to the 2nd table, its variants to the 3rd table, </span></div><div><span style="color:rgb(0,0,0)">after all this, add an entry in the snapshot table for the entire snapshot, </span></div><div><span style="color:rgb(0,0,0)">that's it."</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">I can get this info from `port -v installed` and `port -v installed requested` command, that is, calling </span><font color="#000000"><i>action_installed</i> [1] which in turn, calls </font><span style="color:rgb(0,0,0)"><i class="gmail-">registry::installed</i> [2] for each port from <i>snapshot_main</i>. Is this best way to go?</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><font color="#000000">Further, can you point me to some port action where it deals with retrieving and populating tables as a hint? The <i>action_target</i> used for most of the port commands like <i>install</i>, <i>clean</i>, <i>fetch</i> doesn't really hint on how to deal with it. </font></div><div><font color="#000000"><br></font></div><div><font color="#000000">I hunted down till I reached </font><span style="color:rgb(0,0,0)"><i class="gmail-">macports::registry.format</i>  -->  <i>receipt_{flat/sqlite}.tcl </i>files<i> </i>which have a bunch of functions using <i>registry::entry</i> which I think is the most "basic" operation and then, also </span><i style="color:rgb(0,0,0)">receipt_sqlite::</i><i style="color:rgb(0,0,0)">create_entry_l</i><span style="color:rgb(0,0,0)"> function. </span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><span style="color:rgb(0,0,0)">Do I need to write for inserting into tables? If yes, write direct SQL queries or Tcl procedures ( a better way, I think)?</span></div><div><span style="color:rgb(0,0,0)"><br></span></div><div><font color="#000000">Any help would be appreciated. </font></div><div><font color="#000000"><br></font></div><div><div><span style="color:rgb(0,0,0)">Regards,</span></div><div><span style="color:rgb(0,0,0)">Umesh</span></div></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div><span style="color:rgb(0,0,0)">[1]: </span><font color="#000000"><a href="https://github.com/macports/macports-base/blob/master/src/port/port.tcl#L3266">https://github.com/macports/macports-base/blob/master/src/port/port.tcl#L3266</a></font></div><div><span style="color:rgb(0,0,0)">[2]: </span><font color="#000000"><a href="https://github.com/macports/macports-base/blob/master/src/registry2.0/registry.tcl#L136">https://github.com/macports/macports-base/blob/master/src/registry2.0/registry.tcl#L136</a> </font></div></div></div>