diff --git a/build_template_rpm b/build_template_rpm index d9b5bd3..82c4cce 100755 --- a/build_template_rpm +++ b/build_template_rpm @@ -1,6 +1,8 @@ #!/bin/sh NAME=$1 +set -e + if [ x$NAME = x ] ; then echo "usage $0 " exit 1 @@ -15,6 +17,7 @@ if [ -d qubeized_images/$NAME/untrusted_appmenus ]; then for f in whitelisted-appmenus.list vm-whitelisted-appmenus.list netvm-whitelisted-appmenus.list; do grep '^[a-zA-Z0-9.()_-]\+.desktop$' $srcdir/$f > appmenus/$f done + trap "rm -rf appmenus-$$ appmenus" EXIT fi rpmbuild --target noarch \ @@ -23,7 +26,3 @@ rpmbuild --target noarch \ --define "_topdir $PWD/rpmbuild" \ --define "_tmppath $PWD/rpmbuild/tmp" \ -bb templates.spec - -if [ -d appmenus-$$ ]; then - rm -rf appmenus-$$ appmenus -fi