Commit 7fa93782 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rpmpub: rewrite check for target default, use BUILDFARMDIR from Korinf

parent 0cd50823
...@@ -11,6 +11,12 @@ ...@@ -11,6 +11,12 @@
load_mod spec rpm etersoft load_mod spec rpm etersoft
# fast load Korinf config for BUILDFARMDIR
test -f /etc/eterbuild/korinf && . /etc/eterbuild/korinf
test -f $KORINFETC/korinf && . $KORINFETC/korinf
test -f ~/.config/korinf && . ~/.config/korinf
if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then if [ "$1" = "-h" ] || [ "$1" = "--help" ]; then
echog "rpmpub - Etersoft specific script for publish gear repo to target ftp dir as src.rpm" echog "rpmpub - Etersoft specific script for publish gear repo to target ftp dir as src.rpm"
echog "Usage: rpmpub [-f] [-r PROJECTVERSION ] [SPEC] [TARGETDIR]" echog "Usage: rpmpub [-f] [-r PROJECTVERSION ] [SPEC] [TARGETDIR]"
...@@ -57,20 +63,26 @@ if [ ! -r "$SPECNAME" ] ; then ...@@ -57,20 +63,26 @@ if [ ! -r "$SPECNAME" ] ; then
fi fi
#Example: ETERDESTSRPM=/var/ftp/pub/Etersoft/CIFS@Etersoft/$VERSION/sources #Example: ETERDESTSRPM=/var/ftp/pub/Etersoft/CIFS@Etersoft/$VERSION/sources
[ -n "$ETERDESTSRPM" ] || ETERDESTSRPM="$1" # config value by default
ETERDESTSRPM=$BUILDFARMDIR
# try override from value from spec
tfs=$(get_etersoft_srpm_path $SPECNAME "$ALPHA")
if [ -n "$tfs" ] ; then
ETERDESTSRPM="$tfs"
fi
# [ -n "$ETERDESTSRPM" ] || fatal "Can't detect target dir from spec (Url in Source: field). Run rpmpub with TARGETDIR param"
# override with command arg
[ -n "$1" ] && ETERDESTSRPM="$1"
# add sources if not yet # add sources if not yet
if [ -n "$ETERDESTSRPM" ] && ! rhas "$ETERDESTSRPM" "/sources" ; then if [ -n "$ETERDESTSRPM" ] && ! rhas "$ETERDESTSRPM" "/sources" ; then
ETERDESTSRPM=$ETERDESTSRPM/sources ETERDESTSRPM=$ETERDESTSRPM/sources
fi fi
if [ -z "$ETERDESTSRPM" ] ; then [ -d "$ETERDESTSRPM" ] || fatal "You need run with exists dir to publish src.rpm project (I have checked $ETERDESTSRPM, it does not exist)"
ETERDESTSRPM=$(get_etersoft_srpm_path $SPECNAME "$ALPHA") echo "Prepare src.rpm to $ETERDESTSRPM"
[ -n "$ETERDESTSRPM" ] || fatal "Can't detect target dir from spec (Url in Source: field). Run rpmpub with TARGETDIR param"
echo "Prepare src.rpm to $ETERDESTSRPM"
else
test -d "$ETERDESTSRPM" || fatal "You need run with exists dir to publish src.rpm project (I have checked $ETERDESTSRPM, it does not exist)"
fi
export ETERDESTSRPM export ETERDESTSRPM
PREVPATH=$(readlink -m "$ETERDESTSRPM/../../last") PREVPATH=$(readlink -m "$ETERDESTSRPM/../../last")
......
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