提交 2709b350 编写于 作者: J Joerg Jaspert

Rewrite so that it uses mktemp. also let a trap for the cleanup function...

Rewrite so that it uses mktemp. also let a trap for the cleanup function handle the rm of the tempfile, we save on the whole if then
Signed-off-by: NJoerg Jaspert <joerg@debian.org>
上级 0728f1b5
...@@ -9,14 +9,17 @@ export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars ...@@ -9,14 +9,17 @@ export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
################################################################################ ################################################################################
TMPFILE=$( mktemp -p ${TMPDIR} )
function cleanup {
ERRVAL=$?
rm -f ${TMPFILE}
exit ${ERRVAL}
}
trap cleanup SIGHUP SIGINT SIGPIPE SIGTERM EXIT ERR
# get the latest list of wnpp bugs and their source packages # get the latest list of wnpp bugs and their source packages
if $( wget -q -O/srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm.tmp http://qa.debian.org/data/bts/wnpp_rm ) ; then wget -q -O${TMPFILE} http://qa.debian.org/data/bts/wnpp_rm
mv /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm.tmp /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm mv ${TMPFILE} /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm
else
if [ -f /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm.tmp ] ; then
rm /srv/ftp-master.debian.org/scripts/masterfiles/wnpp_rm.tmp
fi
fi
################################################################################ ################################################################################
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册