2013-12-25 10:43:36 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
RUBYDIR=/home/ftp/pub/ruby
|
2014-05-08 23:58:09 -04:00
|
|
|
EXTS='.tar.gz .tar.bz2 .zip'
|
2013-12-25 10:43:36 -05:00
|
|
|
|
|
|
|
releases=`ls ruby-*|grep -o 'ruby-[0-9]\.[0-9]\.[0-9]\(-\(preview\|rc\|p\)[0-9]\{1,4\}\)\?'|uniq`
|
|
|
|
|
|
|
|
# check files
|
|
|
|
for r in $releases
|
|
|
|
do
|
|
|
|
echo "checking files for $r..."
|
2013-12-25 11:10:21 -05:00
|
|
|
for ext in $EXTS
|
|
|
|
do
|
|
|
|
if ! [ -f $r$ext ];then
|
|
|
|
echo "ERROR: $r$ext not found"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
echo "files are ok"
|
2013-12-25 10:43:36 -05:00
|
|
|
done
|
|
|
|
|
|
|
|
# version directory
|
|
|
|
for r in $releases
|
|
|
|
do
|
|
|
|
xy=`echo $r|grep -o '[0-9]\.[0-9]'`
|
2014-05-08 23:58:09 -04:00
|
|
|
preview=`echo $r|grep -o -- '-\(preview\|rc\)'`
|
2013-12-25 10:43:36 -05:00
|
|
|
dir="${RUBYDIR}/$xy"
|
|
|
|
echo "$dir"
|
|
|
|
mkdir -p $dir
|
2013-12-25 11:24:53 -05:00
|
|
|
for ext in $EXTS
|
2013-12-25 11:10:21 -05:00
|
|
|
do
|
|
|
|
cp $r$ext $dir/$r$ext
|
2014-05-16 11:35:50 -04:00
|
|
|
ln -sf $xy/$r$ext ${RUBYDIR}/$r$ext
|
2013-12-25 11:24:53 -05:00
|
|
|
if [ x$preview = x ];then
|
2014-05-16 11:35:50 -04:00
|
|
|
ln -sf $xy/$r$ext ${RUBYDIR}/ruby-$xy-stable$ext
|
2013-12-25 11:24:53 -05:00
|
|
|
fi
|
2013-12-25 11:10:21 -05:00
|
|
|
done
|
2013-12-25 10:43:36 -05:00
|
|
|
done
|