[PC-BSD Dev] pcbsd system source idea and question

Joe Maloney jpm820 at gmail.com
Thu Dec 19 07:49:36 PST 2013


On Thu, 2013-12-19 at 09:24 -0500, Ken Moore wrote:
> On 12/19/13 09:16, Kris Moore wrote:
> 
> > On 12/19/2013 03:12, Joe Maloney wrote:
> > 
> > > Here is what I've been able to come up with now for a more simple
> > > version.
> > > 
> > > 
> > > http://pastebin.com/7PHASL4S
> > > 
> > > 
> > > I've been testing and it works but it takes about 25 minutes to
> > > fetch all the source.  
> > > 
> > > 
> > > I had to use something like this to make up for not being able to
> > > run to instances of prog, args in startPorts to run two git
> > > commands on after another.:
> > > 
> > > 
> > > system("git --git-dir=/usr/ports/.git fetch" ); 
> > > 
> > > 
> > > Otherwise they would run at the same time which would be bad.  I'm
> > > not sure of a better way to do it at this point but my gut tells
> > > me using system() might not be a great idea.
> > > 
> > > 
> > > I haven't commited this yet as it's really slow and I figured I
> > > would see what your thoughts were first.
> > > 
> > > 
> > > Joe Maloney
> > > 
> > > 
> > > 
> > > 
> > So, to speed it up, I would add --depth=1, which will greatly speed
> > up the initial checkout. 
> > 
> > # git clone --depth=1 https://github.com/pcbsd/freebsd-ports.git
> > 
> > I do that on my builders here and it took the checkout from 20
> > minutes down to about 45 seconds :)
> > 
> > As for using "system" it may be better to use QProcess::execute()
> > instead. 
> -snip-
> 
> Since you are already using QProcesses, you can also have it run
> QCoreApplication::processEvents() in regular intervals while the
> command is running to prevent the GUI from hanging like this:
> --------------------------
> proc->start("command")
> while(!proc->waitForFinished(500)){ //0.5 sec wait
>   QCoreApplication::processEvents();
> }
> if( proc->exitCode() != 0){ qDebug() << "Error"; }
> else{
>   proc->start("command 2")
> }
> ---------------------------
> and repeat as necessary to run other commands in sequence.
> You might want to look at the QProcess.setWorkingDirectory() function
> as well, so you might not need to run special flags for running in an
> alternate directory if you just make the process "change" into the
> directory you want to run from.

Thanks Ken.  It looks like the above might work to fix the freeze up,
etc.  I will test this over the next couple of days as well.  

> -- 
> ~~ Ken Moore ~~
> PC-BSD/iXsystems
> _______________________________________________
> Dev mailing list
> Dev at lists.pcbsd.org
> http://lists.pcbsd.org/mailman/listinfo/dev




More information about the Dev mailing list