LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   fluxbox.SlackBuild in -current typo? (https://www.linuxquestions.org/questions/slackware-14/fluxbox-slackbuild-in-current-typo-682972/)

wadsworth 11-12-2008 04:03 PM

fluxbox.SlackBuild in -current typo?(solved_no typo)
 
On line #65 of the fluxbox.SlackBuild from -current I'm seeing:
Code:

make -j6 || make || exit 1
make install DESTDIR=$PKG || exit 1

If I understand the "||" in a bash script, it seems that "make" would be
executed twice. Am I wrong or is this a typo?
If it is, whom should I tell? :)

From the bash man page:
Code:

command1 || command2

      command2  is  executed  if and only if command1 returns a non-zero exit
      status.  The return status of AND and OR lists is the  exit  status  of
      the last command executed in the list.

Thanks!

keefaz 11-12-2008 04:14 PM

make will be executed if 'make -j6' fails, else the command stops and goes to next command line (make install...)

wadsworth 11-12-2008 04:24 PM

Quote:

Originally Posted by keefaz (Post 3339887)
make will be executed if 'make -j6' fails, else the command stops and goes to next command line (make install...)

OK. I think I understand. If 'make -j6' succeeds, neither the
subsequent 'make' nor the 'exit 1' will be executed. right?
This is the first time I've seen this in a SlackBuild.
:newbie:

keefaz 11-12-2008 04:27 PM

Yes, that's it :)
I would think if 'make -j6' fails, the following make has great chance to fail too, but I don't know for sure

andrew.46 11-12-2008 05:34 PM

Seems to be feature of PV's newer slackbuilds. If you look at one I stole for 12.1:

http://slackware.osuosl.org/slackwar...lrn.SlackBuild

this has been added in as a variable: NUMJOBS=${NUMJOBS:--j6}. I have added this setting to my personal slackbuilds and I have seen amazing speed differences in compiling times, particularly in such software as the svn MPlayer.

Andrew

grissiom 11-12-2008 06:04 PM

I think if "make -j6" fail, it means that the project may has some problem with parallel making. So trying a single make may solve the problem. But if "make" failed eventually, there must be something wrong here, so it will exit.

rworkman 11-12-2008 10:39 PM

Quote:

Originally Posted by grissiom (Post 3339971)
I think if "make -j6" fail, it means that the project may has some problem with parallel making. So trying a single make may solve the problem. But if "make" failed eventually, there must be something wrong here, so it will exit.

We have a winner. :-)

andrew.46 11-12-2008 11:33 PM

Hi Rob:

Quote:

Originally Posted by rworkman (Post 3340130)
We have a winner. :-)

And perhaps this syntax has a place in the slackbuilds.org template?

Andrew

Edit: Apologies if I am coming close to thread hijacking?

rworkman 11-13-2008 08:04 AM

Quote:

Originally Posted by andrew.46 (Post 3340171)
And perhaps this syntax has a place in the slackbuilds.org template?

Nah, we decided not to put that in our builds. If someone wants parallel make jobs with our stuff, they can set MAKEFLAGS in the shell environment.

astrogeek 11-13-2008 01:59 PM

What does -j do? Good article here...
 
For others like myself who might not be up to speed on distributed compile options, here is a place to get started...

http://www.ibm.com/developerworks/ai...2ProgramDelite


All times are GMT -5. The time now is 02:23 AM.