On 2017-6-23 11:29 , Bradley Giesbrecht wrote:
On Jun 21, 2017, at 7:25 PM, Umesh Singla <umeshksin...@macports.org> wrote:

Hi

     Taking a step back for a moment, why is an SQL database the best way
     to store this data? What sorts of queries are you going to want to
     run on it? Would a text (Tcl array) representation similar to the
     PortIndex be a better fit?


We need to store all the information about the existing state of the ports 
first, then uninstall all the ports and re-install on the updated OS after 
self-updating using the info we have in the database. So, we can't have a 
temporary kind of Tcl array representation.

A Tcl array representation doesn't have to be temporary. It can easily be 
written to a file.

If the only operations are going to be storing the list of ports and then 
reinstalling all the ports in the list, that says to me that SQL is much more 
complexity than you need.

I'll check with my mentor. I may not have been clear in explaining the need for 
SQL or Tcl array representation could be an easy way go.

I assumed we would allow multiple snapshots and be able to chose from a list of 
snapshots by date-sequence.

Sure.

For the migration functionality wouldn’t we only install “requested” ports? 
Dependencies could be different with a platform change.

Also, if the installed variants for a given port are the default variants would 
we want to ignore variants?

These two points are related. A requested flag for variants is needed to be able to do the right thing.

We don't want to ignore variants exactly; we want to apply only the requested variants (positive and negative) when reinstalling ports.

There is a bit of a dilemma when a non-requested port has requested variants. In some cases (like quartz vs x11) the variants of dependencies must match, so you do want to restore that port as it was. And even when it's not strictly required in that way, the user may still have wanted that variant in the dependency for whatever reason. But in other cases, as you mentioned, the dependencies may have changed so the port is no longer needed.

I think the only safe approach is to (attempt to) restore all the ports that were installed and let the user trim leaves afterwards. (A message could even suggest that they do so.) Some may fail on the new platform, but that's always a possibility even with requested ports. The system needs to handle that as gracefully as possible.

I'll leave for now the question of whether you should pass requested variants down to new dependencies...

- Josh

Reply via email to