Refreshing 1.9 build

B

Bil Kleb

Hi,

Is there a simpler way to refresh my Ruby 1.9 build?
Here's what I'm currently using on my OS X box:

#!/bin/sh
#
# To refresh Ruby 1.9 build after an initial
#
# svn co http://svn.ruby-lang.org/repos/ruby/trunk ruby

svn up

VERSION=`grep 'RUBY_VERSION ' version.h | awk '{print $3}' | sed -e's/"//g'`
SUFFIX=`grep RUBY_RELEASE_CODE version.h | awk '{print $3}'`

echo "Building ${VERSION}-${SUFFIX}" \
&& mkdir ${VERSION}-${SUFFIX} \
&& cd ${VERSION}-${SUFFIX} \
&& ../configure --prefix=/usr/local --program-suffix=19 \
&& make \
&& sudo make install

Later,
 
N

Nobuyoshi Nakada

Hi,

At Tue, 4 Sep 2007 23:20:08 +0900,
Bil Kleb wrote in [ruby-talk:267535]:
echo "Building ${VERSION}-${SUFFIX}" \
&& mkdir ${VERSION}-${SUFFIX} \

You can use set -e.
 
B

Bil Kleb

Nobuyoshi said:
Hi,
Hi.

Bil Kleb wrote in [ruby-talk:267535]:
echo "Building ${VERSION}-${SUFFIX}" \
&& mkdir ${VERSION}-${SUFFIX} \

You can use set -e.

I'm a bit slow... can you explain further how
I might use 'set -e'?

Thanks,
 
N

Nobuyoshi Nakada

Hi,

At Wed, 5 Sep 2007 00:40:04 +0900,
Bil Kleb wrote in [ruby-talk:267545]:
I'm a bit slow... can you explain further how
I might use 'set -e'?

Setting -e option in a shell script causes the shell to exit
immediately if a command exits with a non-zero status.

So you can write many commands without && and \s.

set -e
echo "Building ${VERSION}-${SUFFIX}"
mkdir ${VERSION}-${SUFFIX}
cd ${VERSION}-${SUFFIX}
../configure --prefix=/usr/local --program-suffix=19
make
sudo make install

A difference is that it exits with a non-zero status by -e.
 
B

Bil Kleb

Nobuyoshi said:
Setting -e option in a shell script causes the shell to exit
immediately if a command exits with a non-zero status.

Ah, yes.

Thank you,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,138
Latest member
NevilleLam
Top