Remove tmpdir when finished

svn path=/trunk/; revision=566
This commit is contained in:
Andrew Gaffney 2008-09-04 02:07:52 +00:00
parent 611f864053
commit 3061d4f53c
3 changed files with 14 additions and 3 deletions

View file

@ -40,6 +40,7 @@ run_cmd() {
# ${cmd} 2>&1 | tee ${logfile}
else
# ${cmd} &> ${logfile}
a=1
fi
}
@ -125,12 +126,12 @@ for i in $(find -name '*.spec'); do
sed -i 's|^version_stamp:.*$|version_stamp: '${DATESTAMP}'|' ${i}
sed -i 's|^snapshot:.*$|snapshot: '${DATESTAMP}'|' ${i}
if [ "${old_version_stamp}" = "${old_source_subpath}" ]; then
sed -i 's|^source_subpath: (.\+-).\+$|source_subpath: \1'${DATESTAMP}'|'
sed -i 's|^source_subpath: \(.\+-\).\+$|source_subpath: \1'${DATESTAMP}'|' ${i}
fi
done
# Create snapshot
if ! run_cmd "catalyst -c ${CATALYST_CONFIG} -s ${DATESTAMP}" ${TMPDIR}/log/snapshot-${DATESTAMP}.log"; then
if ! run_cmd "catalyst -c ${CATALYST_CONFIG} -s ${DATESTAMP}" "${TMPDIR}/log/snapshot-${DATESTAMP}.log"; then
send_email "Catalyst build error - snapshot" "$(tail -n 200 ${TMPDIR}/log/snapshot-${DATESTAMP}.log)"
fi
@ -144,3 +145,8 @@ for i in $(ls -1 ${SPECS}); do
done
send_email "Catalyst build success" "Everything finished successfully."
if ! rm -rf "${TMPDIR}"; then
echo "Could not remove tmpdir ${TMPDIR}!"
exit 1
fi