Commit e7a8c5f8 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmpub / get_etersoft_srcrpm behaviour

parent 956fb7f9
......@@ -23,7 +23,7 @@ fi
# publish to unstable by default
ALPHA=unstable
ALPHA=
if [ "$1" = "-r" ] ; then
ALPHA=$2
shift 2
......@@ -44,7 +44,8 @@ fi
#ETERDESTSRPM=/var/ftp/pub/Etersoft/CIFS@Etersoft/$VERSION/sources
ETERDESTSRPM=$1
if [ -z "$ETERDESTSRPM" ] ; then
ETERDESTSRPM=$(get_etersoft_srpm_path $SPECNAME $ALPHA)
ETERDESTSRPM=$(get_etersoft_srpm_path $SPECNAME "$ALPHA")
echo "Prepare src.rpm to $ETERDESTSRPM"
else
test -d "$ETERDESTSRPM" || fatal "You need run with exists dir to publish src.rpm project (I checked $ETERDESTSRPM, it is nonexist)"
fi
......
......@@ -33,11 +33,17 @@ get_etersoft_srpm_path()
# translate ftp to local path
SOURCE=$(echo "$SOURCEFTP" | sed -e "s|.*://.*$COMPANYFTP|$TARGETFTPBASE|g")
# rewrite V.E.R./sources with $ALPHA/sources
# rewrite V.E.R./sources with $ALPHA/sources if $ALPHA exist
if [ -n "$ALPHA" ] ; then
BSOURCE=$(dirname $SOURCE)
BNSOURCE=$(basename $BSOURCE)
if [ "$BNSOURCE" = "last" ] || [ "$BNSOURCE" = "unstable" ] ; then
SOURCE=$(dirname $BSOURCE)/$ALPHA/sources
else
# if run with default arg
ALPHA=unstable
BSOURCE=$(dirname $SOURCE)
BNSOURCE=$(basename $BSOURCE)
if [ "$BNSOURCE" = "last" ] ; then
SOURCE=$(dirname $BSOURCE)/$ALPHA/sources
fi
fi
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment