SOLR-5085: the point of the subdir is so the files wouldn't have 'rc' in their name, and could be copied as is ... fix script to split X.Y-RCZ to build final file names, and vet that args look correct

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1526271 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Chris M. Hostetter 2013-09-25 19:20:12 +00:00
parent 521967c117
commit 13111f8435
1 changed files with 22 additions and 9 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
@ -36,10 +36,28 @@ if [ $# -lt 2 ] || [ 3 -lt $# ] ; then
exit 1;
fi
PREFIX="apache-solr-ref-guide"
SRC_FILE=$1
DIR="$PREFIX-$2"
PDF="$DIR/$PREFIX-$2.pdf"
VER_RC=$2
GPG_ID_ARG=""
if [ ! -z "$3" ] ; then
GPG_ID_ARG="-u $3"
fi
VER_RC_PARTS=( ${VER_RC//-/ } )
if [ 2 -ne ${#VER_RC_PARTS[@]} ] ; then
echo "! ! ! Can't proceed, Version+RC suffix must have one '-' (ie: X.Y-RCZ) : $VER_RC"
exit 1;
fi
VER=${VER_RC_PARTS[0]}
VER_PARTS=( ${VER//./ } )
if [ 2 -ne ${#VER_PARTS[@]} ] ; then
echo "! ! ! Can't proceed, Version must have one '.' (ie: X.Y) : $VER"
exit 1;
fi
PREFIX="apache-solr-ref-guide"
DIR="$PREFIX-$VER_RC"
PDF="$DIR/$PREFIX-$VER.pdf"
SHA="$PDF.sha1"
GPG="$PDF.asc"
@ -53,11 +71,6 @@ if [ -d $DIR ] ; then
exit 1;
fi
GPG_ID_ARG=""
if [ ! -z "$3" ] ; then
GPG_ID_ARG="-u $3"
fi
# from here on, use set -x to echo progress and rely on decent error messages
# from shell commands that might fail.