[pacman-dev] [PATCH] updpkgsums: Compute new checksum in temp directory

Florian Pritz bluewind at xinu.at
Sun Apr 7 05:02:51 EDT 2013


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 at 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.archlinux.org/pipermail/pacman-dev/attachments/20130407/26a25ecb/attachment-0001.asc>


More information about the pacman-dev mailing list