On 07.04.2013 04:08, Sébastien Luttringer wrote:
To avoid unwanted files to stay in the PKGBUILD directory after calling makepkg -g, we use a temporary build directory.
This also prevent modifications of the current user work.
Signed-off-by: Sébastien Luttringer <seblu@seblu.net> --- contrib/updpkgsums.sh.in | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-)
diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index ffea96b..401b8de 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in [..] @@ -71,12 +72,26 @@ if [[ ! -w . ]]; then exit 1 fi
+# Generate the new sums +# Use a temporary build directory to avoid unintented/unwanted side effects on +# the current user work. +# Ensure we clean the BUILDDIR before continue +export BUILDDIR=$(mktemp --directory $myname.XXXXX) +newsums=$(makepkg -g -p "$buildfile") +ret=$? +rm -r -f "$BUILDDIR"
Please trap relevant signals here so this doesn't leave stale files if the user presses ^C.