<div dir="ltr"><div>Hi Mojca,</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Apr 2, 2019 at 3:14 AM Mojca Miklavec <<a href="mailto:mojca@macports.org">mojca@macports.org</a>> wrote:</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
The drawbacks may include:<br>
- some ports will be skipped on the builder, for various reasons (port<br>
is known not to build on a particular builder, it may not be<br>
distributable, ...)<br>
- the buildbot master may be down or experience problems, so data<br>
might go missing<br></blockquote><div><br></div><div>Thanks. I will consider these factors when improving upon this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
A strange observation from your source code: you synced portindex and<br>
ran the conversion, but then loaded the data from another json file?<br>
Am I missing something?<br></blockquote><div> </div><div>No, the conversion "tclsh portindex2json.tcl portindex" is writing to the file "syncedportindex.json". And I am reading from the same file. I am really sorry that I did not submit a PR and it was difficult for you to review the code.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">There are various ways to achieve the goal. Note that if you run<br>
portindex yourself, it will detect which files have been updated and<br>
only ever touch data of those ports. The portindex command could be<br>
modified to only output the file with changes (when you pass some<br>
options to it). This will still miss deletes, but it would be an<br>
efficient way with almost no dependencies.<br></blockquote><div><br></div><div>Does this imply that we will keep a clone of macports-contrib locally and run a modified 'portindex' command to generate a file with only the updated ports?</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">One way would be to generate portindex yourself and always remember<br>
what git shasum has been used, and store that shasum to the database.<br>
Next time when you update, check and store the latest shasum, then ask<br>
git which paths have changed between the two commits, and only update<br>
ports whose paths match the paths reported by git as changed.<br>
<br>
It could also help if you stored a "complete" git history to the<br>
database (shasum, which ports changed at that point, timestamp,<br>
parents). Not sure if that's really so helpful, just as an option.<br>
<br>
What might be an interesting approach would be to try to squeeze the<br>
git shasum to the PortIndex. This could also help when submitting<br>
statistics as it would be easier to determine how old the database is<br>
/ when the user last synced. (It would not work for people with their<br>
own modifications of the tree.) If you had the shasum in portindex,<br>
you could still run git independently to check for the difference.<br></blockquote><div> </div><div>These methods are not very clear to me, I haven't dealt with shasums yet. I will discuss about them, after my research.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Just some random ideas.</blockquote><div> </div><div>Thank you so much.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Regarding updates of builds: just ask the database about which build<br>
you synced last, and then sync any builds newer than that, up to the<br>
last one. You may need to check whether a build was complete when you<br>
last enquired.<br></blockquote><div> </div><div>Thanks, I am already using the same method.</div><div><br></div><div>Arjun</div></div></div>