<div dir="ltr">Hi<div><br></div><div>"<span style="font-size:12.8px">The PortIndex file itself is generated with the 'portindex' command,</span></div><span style="font-size:12.8px">which only updates the data for Portfiles that have a modification time</span><br style="font-size:12.8px"><span style="font-size:12.8px">that is newer than the existing PortIndex file."</span><div><br></div><div>So where can i see that code that checks the modification time?</div><div>So suppose </div><div>Our ports tree contains three ports A, B, C last modified time : 1:00 UTC</div><div>present port index:</div><div>[ A</div><div>  B</div><div>  C</div><div>] @ 1:00 UTC</div><div><br></div><div>There was a edit in Port A @ 1:30 UTC</div><div>so something will check all the port files modification time and if relatively newer it will update the port index.</div><div><br></div><div>so new  port index:</div><div>[ A</div><div>  B</div><div>  C</div><div>] @ 1:30 UTC</div><div><br style="font-size:12.8px"><br style="font-size:12.8px"><span style="font-size:12.8px">"The portindex2postgres.sql script merely converts the PortIndex file</span><br style="font-size:12.8px"><span style="font-size:12.8px">from the custom format based on Tcl lists to SQL. The output will always</span><br style="font-size:12.8px"><div><span style="font-size:12.8px">contain SQL statements with the full data for every port.</span>"</div></div><div><br></div><div>Then after the port index is updated this script runs and flushes the db then fills it with new portindex data?</div><div>or just updates the db with the modified port data?</div><div><br></div><div>Which one occurs?</div><div><br></div><div>Trying to understand the present mechanism.</div><div><br></div><div><br></div><div>So after every commit the entire 15mb portindex being processed and data being uploaded to the db.</div><div>I think this is very inefficient.</div><div>rather it would be best if after every commit the buildbot/ webhook updates the database itself.</div><div><br></div><div><br></div><div>Thanks</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 12 May 2018 at 17:47, Rainer Müller <span dir="ltr"><<a href="mailto:raimue@macports.org" target="_blank">raimue@macports.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 2018-05-12 10:34, Vishnu wrote:<br>
> I am not saying that my db and the exiting Db would be interdependent.<br>
> Rather i am saying just once in forever I can copy the content to my<br>
> database.<br>
> Then do the code to keep on updating it whenever something is added or<br>
> deleted or modified.<br>
> <br>
> Like for exaple maintainers.<br>
> You already have a table of mainatainers and their ports.So i can copy<br>
> the data to my database.<br>
> Then i will make a similar to PortIndex2PGSQL.tcl script to keep on<br>
> updating my database independent of the existing database.<br>
<br>
</span>Our database contains exactly what the portindex2postgres.tcl script<br>
produces (note the different naming). You can just generate the data<br>
locally by running it against PortIndex.<br>
<br>
You need to have the ports tree in a directory named "ports", then run<br>
the following command from the parent directory:<br>
<br>
  port-tclsh /path/to/macports-infra/jobs/<wbr>portindex2postgres.tcl<br>
<br>
This will create a PortIndex.sql in the current directory. Ignore or<br>
remove the macports.conf and sources.conf files that are also created.<br>
<span class=""><br>
> Again and again processing the 15mb json file would be bothersome.<br>
> We definitely need some way of getting a differential json.<br>
> To update only the changes happened because of commit to the port file.<br>
> <br>
> Or maybe we could make some changes in buildbot that.Whenever there is<br>
> some change in portfile it could update my port table as well with the<br>
> changes.<br>
> Not sure how to do this.But just an idea as of now.<br>
<br>
</span>Yes, the idea would be that macports-webapp is updated after every commit.<br>
<br>
To achieve that, you could use a job in buildbot, but then the result<br>
needs to be transferred to the macports-webapp. Alternatively, you could<br>
deliver a WebHook from GitHub to do this within macports-webapp. It<br>
largely depends on what kind of data you want to gather and how.<br>
<span class="">> And regarding working on a seperate branch.Rainer suggested not<br>
> to.Because daily pull requests have to merged by the mentor.<br>
<br>
</span>I did not argue against working on a separate branch. I just wanted to<br>
point out that pull request reviews on GitHub might pose a problem as<br>
they cannot depend on each other. It is up to you and your mentors to<br>
work out the details.<br>
<span class=""><br>
> One doubt I still have is that whether  portindex2postgres.<wbr>tcl again and<br>
> again runs the entire MacPorts port tree on the database ?<br>
> Or just the port that has been changed ?<br>
<br>
</span>The PortIndex file itself is generated with the 'portindex' command,<br>
which only updates the data for Portfiles that have a modification time<br>
that is newer than the existing PortIndex file.<br>
<br>
The portindex2postgres.sql script merely converts the PortIndex file<br>
from the custom format based on Tcl lists to SQL. The output will always<br>
contain SQL statements with the full data for every port.<br>
<span class="HOEnZb"><font color="#888888"><br>
Rainer<br>
</font></span></blockquote></div><br></div>