Commit 95f68b25 authored by Vitaly Lipatov's avatar Vitaly Lipatov

remove all temp generated src.rpm, sources, specs

parent 14b9d9cb
...@@ -18,6 +18,7 @@ DISTRVERSION=`$DISTRVENDOR -v` ...@@ -18,6 +18,7 @@ DISTRVERSION=`$DISTRVENDOR -v`
altspec_to_local() altspec_to_local()
{ {
local i
local TXTRELEASE local TXTRELEASE
local SPECNAME local SPECNAME
SPECNAME=$1 SPECNAME=$1
...@@ -396,7 +397,7 @@ fi ...@@ -396,7 +397,7 @@ fi
unset MENV MENVARG unset MENV MENVARG
# handle src.rpm and spec both, LISTBUILT - result with full pathes to src.rpms # handle src.rpm and spec both, LISTBUILT - result with full paths to src.rpms
pack_src_rpm $LISTNAMES pack_src_rpm $LISTNAMES
export RPMTOPDIR=$RPMDIR/BP export RPMTOPDIR=$RPMDIR/BP
...@@ -407,11 +408,14 @@ export IGNOREGEAR=1 ...@@ -407,11 +408,14 @@ export IGNOREGEAR=1
for i in $LISTBUILT ; do for i in $LISTBUILT ; do
uni_rpminstall $i uni_rpminstall $i
# remove primary src.rpm only if src.rpm was not primary
echo $LISTNAMES | grep -q $i || rm -f $i
SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i) SPECNAME=$RPMTOPDIR/SPECS/$(spec_by_srpm $i)
test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found" test -f "$SPECNAME" || fatal "Spec $SPECNAME is not found"
# FIXME: do not remove if not repacked
#rm -f $SPKG
altspec_to_local $SPECNAME altspec_to_local $SPECNAME
$BUILDCOMMAND $LISTRPMARGS $UPLOADARG $REMOTEBUILD $DISTRARG $SPECNAME || fatal "Can't build" $BUILDCOMMAND $LISTRPMARGS $UPLOADARG $REMOTEBUILD $DISTRARG $SPECNAME || fatal "Can't build"
uni_rpmrm $SPECNAME || true
done done
...@@ -101,6 +101,10 @@ if [ -n "$REMOTEBUILD" ] ; then ...@@ -101,6 +101,10 @@ if [ -n "$REMOTEBUILD" ] ; then
else else
time $ETERBUILDBIN/myhsh $MENVARG $LISTRPMARGS $LISTBUILT time $ETERBUILDBIN/myhsh $MENVARG $LISTRPMARGS $LISTBUILT
RESULT=$? RESULT=$?
# remove generated src.rpm
for i in $LISTBUILT ; do
echo $LISTNAMES | grep -q $i || rm -f $i
done
date date
echo "-------------------------------" echo "-------------------------------"
......
...@@ -116,6 +116,18 @@ uni_rpminstall() ...@@ -116,6 +116,18 @@ uni_rpminstall()
return $RET return $RET
} }
# remove source and spec
uni_rpmrm()
{
local TWOPARAM="-v"
if [ -n "$RPMTOPDIR" ] ; then
TWOPARAM="--define=_topdir $RPMTOPDIR"
fi
$RPMBUILD "$TWOPARAM" --rmsource --rmspec $@
}
# LISTNAMES, options in arg # LISTNAMES, options in arg
# build LISTBUILT list with src.rpm full path # build LISTBUILT list with src.rpm full path
......
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