From cdc456c8b7c6e3eb4b11d668fb9c6e9bdec7230e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Thu, 20 Apr 2017 23:05:01 -0400 Subject: Don't use subshells in local/export/declare commands. Only make this change in places where it shouldn't make a difference, and something weird has to be going on for the subshell to fail. This is on par with checking the return value of malloc. We don't need tests for each of these failure cases. --- src/xbs-abs/helper-abs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/xbs-abs') diff --git a/src/xbs-abs/helper-abs b/src/xbs-abs/helper-abs index 85a7fca..e8f41de 100755 --- a/src/xbs-abs/helper-abs +++ b/src/xbs-abs/helper-abs @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright (C) 2013-2014 Luke Shumaker +# Copyright (C) 2013-2014, 2017 Luke Shumaker # # For code from db-functions (arch_svn): # Copyright (C) 2012 Pierre Schmitz @@ -98,7 +98,7 @@ release-client() { local arch=$2 # Hack to use arch_svn as 'svn' in external scripts - local tmpdir="$(mktemp -dt "xbs-abs-release.XXXXXXXXXX")" + local tmpdir; tmpdir="$(mktemp -dt "xbs-abs-release.XXXXXXXXXX")" trap "$(printf 'rm -rf -- %q' "$tmpdir")" EXIT printf '%s\n' \ '#!/bin/bash' \ @@ -126,7 +126,8 @@ unrelease() { local tag="$repo-$arch" load_config - local svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" + local svndir + svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" arch_svn up -q "$svndir" # This is based off code from dbscripts:db-remove @@ -140,7 +141,8 @@ move() { local pkgbase=$3 load_config - local svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" + local svndir + svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" arch_svn up -q "$svndir" local tag_list="" @@ -181,9 +183,10 @@ releasepath() { local arch=$3 load_config - local svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" + local svndir releasepath + svndir="${SVNDIR}/$(pac2svn "$repo")/${pkgbase}" arch_svn up -q "${svndir}" - local releasepath="${svndir}/repos/${repo}-${arch}" + releasepath="${svndir}/repos/${repo}-${arch}" if [[ -f "${releasepath}/PKGBUILD" ]]; then printf '%s\n' "$releasepath" return 0 -- cgit v1.2.2