Commit 129c0b42 authored by Vitaly Lipatov's avatar Vitaly Lipatov

replace RPMDIR using with RPMTOPDIR which can be overrided

parent 8001c441
......@@ -18,7 +18,7 @@ load_mod rpm
# Start as helper
if [ "$1" = "--helper" ]; then
shift
cd $RPMDIR/SPECS && rpmbb "$@"
cd $RPMTOPDIR/SPECS && rpmbb "$@"
exit $?
fi
......@@ -69,7 +69,7 @@ mygetopts $LISTARGS
mkdir -p "$LOGDIR"
mkdir -p "$RPMDIR/RPMS"
mkdir -p "$RPMTOPDIR/RPMS"
test -z "$LISTNAMES" && fatal "Please run with spec(s) name"
test -n "$LISTRPMARGS" && echog "Run $RPMBUILD with options: '$LISTRPMARGS'"
......
......@@ -110,7 +110,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echog "==== Copying to build server ====="
#echog "It is recommended to rename old version at server for save traffic during rsync"
rsync -vay --partial --progress --checksum \
-e ssh $LISTBUILT $BUILDSERVER:/$RPMDIR/SRPMS/ || exit 1
-e ssh $LISTBUILT $BUILDSERVER:/$RPMTOPDIR/SRPMS/ || exit 1
$REMCOM rpmbs --helper $MENVARG $LISTRPMARGS $LISTBUILT
exit 0
fi
......@@ -141,7 +141,7 @@ set_incoming $MENV
if [ -n "${DELETENOW}" ]; then
echog "Removing from '$RSYNCINCOMING/$INCOMING/'"
check_key
cd $RPMDIR/SRPMS
cd $RPMTOPDIR/SRPMS
for i in $LISTBUILT ; do
> $i
done
......@@ -174,7 +174,7 @@ check_gear_and_tag()
if [ -n "$SIGN" ]; then
release_check $LISTBUILT
cd $RPMDIR/SRPMS
cd $RPMTOPDIR/SRPMS
if [ -r "$LISTBUILT" ] ; then
echo if one spec, check gear
check_gear_and_tag $SPECDIR
......
......@@ -86,7 +86,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echo
echog "==== Copying to build server ====="
#echog "It is recommended to rename old version at server for save traffic during rsync"
cd $RPMDIR/SRPMS && rsync -vay --partial --progress --checksum \
cd $RPMTOPDIR/SRPMS && rsync -vay --partial --progress --checksum \
-e ssh $LISTBUILT $BUILDSERVER:$REMOTERPMDIR/SRPMS/ || fatal "Error with rsync"
ssh -t $BUILDSERVER "cd $REMOTERPMDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTBUILT"
RESULT=$?
......@@ -94,7 +94,7 @@ if [ -n "$REMOTEBUILD" ] ; then
echo "-------------------------------"
test "$RESULT" = "0" && echog "It was remote build at $BUILDSERVER" || echog "There is error during remote build at $BUILDSERVER"
else
cd $RPMDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTBUILT
cd $RPMTOPDIR/SRPMS && time myhsh $MENVARG $LISTRPMARGS $LISTBUILT
RESULT=$?
date
echo "-------------------------------"
......
......@@ -224,7 +224,7 @@ if [ -n "$INSTALLBINARY" ] ; then
parse_cmd_pre "$@"
pack_src_rpm $LISTRPMARGS
echog "Running apt-get for install needed packages for $LISTBUILT"
cd $RPMDIR/SRPMS
cd $RPMTOPDIR/SRPMS
# FIXME: ALT Specific
$SUDO apt-get build-dep $LISTBUILT
cd -
......@@ -309,7 +309,7 @@ fi
test -z "$SRCRPM" && fatal "Cannon find package for $1"
echog "Try to download $SRCRPM"
test -z ${TRYINST} || { mkdir -p $RPMDIR/SRPMS && cd $RPMDIR/SRPMS ; }
test -z ${TRYINST} || { mkdir -p $RPMTOPDIR/SRPMS && cd $RPMTOPDIR/SRPMS ; }
echog "Downloading in $(pwd)"
for i in $REPOSITORY
......
......@@ -22,6 +22,8 @@ NICE="nice"
RPMBUILD=rpmbuild
RPMDIR="$HOME/RPM"
# Can be overrided in the scripts
[ -n "$RPMTOPDIR" ] || RPMTOPDIR="$RPMDIR"
[ -n "$APTCONFBASE" ] || APTCONFBASE=$ETERBUILDETC/apt/apt.conf
......
......@@ -37,6 +37,7 @@ uni_rpmbuild()
if [ "$MENV" = "SS" ] ; then
$NICE $GEAR --commit --rpmbuild -- $RPMBUILD "$ONEPARAM" "$TWOPARAM" $@ || RET=$?
else
fatal "Unsupported now"
# build src.rpm via hasher (on ALT)
# $NICE gear-hsh --build-args="-bs" --rpmbuild -- $COMMAND "$ONEPARAM" $@
$NICE $GEAR --hasher -- myhsh --build-prog=$ETERBUILDDIR/functions/rebuild $@ || RET=$?
......@@ -76,6 +77,7 @@ uni_rpminstall()
#if is_gear $SPECDIR ; then
# $NICE $GEARBUILDREQ --commit -- $@ || RET=$?
#else
echo -n "Install package "
rpm -iv "$TWOPARAM" $@ || RET=$?
#fi
return $RET
......@@ -125,7 +127,6 @@ build_rpms_name()
NAMERPMIN=$BASENAME-$VERSION-$RELEASE.$PKGARCH.rpm
NAMESRPMIN=$BASENAME-$VERSION-$RELEASE.src.rpm
#RPMSOURCEDIR=$RPMDIR/SOURCES
RPMSOURCEDIR=`rpm --eval %_sourcedir | subst_namever`
[ -n "$RPMSOURCEDIR" ] || fatal "Can't detect RPM/SOURCES dir"
......@@ -173,10 +174,12 @@ do
uni_rpmbuild $i -bs $ARGS $NODEPS --target $DEFAULTARCH || fatal "Error with rpmbuild"
fi
fi
if [ -f $RPMDIR/SRPMS/$NAMESRPMIN ] ; then
# Check the package really built
if [ -f $RPMTOPDIR/SRPMS/$NAMESRPMIN ] ; then
LISTBUILT="$LISTBUILT $NAMESRPMIN"
else
fatal "Can't find '$NAMESRPMIN' in '$RPMDIR/SRPMS'"
fatal "Can't find '$NAMESRPMIN' in '$RPMTOPDIR/SRPMS'"
fi
done
# remove extra space before list
......
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