2013-12-25 19:43:36 +04:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
RUBYDIR=/home/ftp/pub/ruby
|
2014-09-18 05:30:09 +04:00
|
|
|
EXTS='.tar.gz .tar.bz2 .tar.xz .zip'
|
2013-12-25 19:43:36 +04:00
|
|
|
|
2016-04-01 06:27:17 +03:00
|
|
|
releases=`ls ruby-*|grep -o 'ruby-[0-9]\{1,\}\.[0-9]\{1,\}\.[0-9]\{1,\}\(-\(preview\|rc\|p\)[0-9]\{1,4\}\)\?'|uniq`
|
2013-12-25 19:43:36 +04:00
|
|
|
|
|
|
|
# check files
|
|
|
|
for r in $releases
|
|
|
|
do
|
|
|
|
echo "checking files for $r..."
|
2013-12-25 20:10:21 +04: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 19:43:36 +04:00
|
|
|
done
|
|
|
|
|
|
|
|
# version directory
|
|
|
|
for r in $releases
|
|
|
|
do
|
|
|
|
xy=`echo $r|grep -o '[0-9]\.[0-9]'`
|
2014-05-09 07:58:09 +04:00
|
|
|
preview=`echo $r|grep -o -- '-\(preview\|rc\)'`
|
2013-12-25 19:43:36 +04:00
|
|
|
dir="${RUBYDIR}/$xy"
|
|
|
|
echo "$dir"
|
|
|
|
mkdir -p $dir
|
2013-12-25 20:24:53 +04:00
|
|
|
for ext in $EXTS
|
2013-12-25 20:10:21 +04:00
|
|
|
do
|
|
|
|
cp $r$ext $dir/$r$ext
|
2014-05-16 19:35:50 +04:00
|
|
|
ln -sf $xy/$r$ext ${RUBYDIR}/$r$ext
|
2013-12-25 20:24:53 +04:00
|
|
|
if [ x$preview = x ];then
|
2014-05-16 19:35:50 +04:00
|
|
|
ln -sf $xy/$r$ext ${RUBYDIR}/ruby-$xy-stable$ext
|
2013-12-25 20:24:53 +04:00
|
|
|
fi
|
2013-12-25 20:10:21 +04:00
|
|
|
done
|
2013-12-25 19:43:36 +04:00
|
|
|
done
|