devscript: hoist $tmpdir

to make clear it is shared between functions
This commit is contained in:
Roland Walker
2014-01-31 12:33:30 -05:00
parent bffec0e719
commit 26d4f804d8
2 changed files with 5 additions and 2 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ shopt -s nocasematch # case-insensitive regular expressions
opt_lax=''
opt_pkg=''
tmpdir=''
warn () {
local message="$@"
@@ -105,7 +106,7 @@ See CONTRIBUTING.md and 'man pkgutil' for more information.
_list_apps_in_pkg () {
local tmpdir=`/usr/bin/mktemp -d -t list_apps_in_pkg`
tmpdir=`/usr/bin/mktemp -d -t list_apps_in_pkg`
trap "/bin/rm -rf '$tmpdir'" EXIT
/usr/sbin/pkgutil --expand "$opt_pkg" "$tmpdir/unpack"
+3 -1
View File
@@ -7,6 +7,8 @@ set -e # exit on any uncaught error
set +o histexpand # don't expand history expressions
shopt -s nocasematch # case-insensitive regular expressions
tmpdir=''
bundle_id_source_1 () {
/usr/bin/find "$tmpdir" -name PackageInfo -print0 | \
/usr/bin/xargs -0 /usr/bin/perl -0777 -ne \
@@ -30,7 +32,7 @@ mark_up_sources () {
_list_ids_in_pkg () {
local tmpdir=`/usr/bin/mktemp -d -t list_ids_in_pkg`
tmpdir=`/usr/bin/mktemp -d -t list_ids_in_pkg`
trap "/bin/rm -rf '$tmpdir'" EXIT
/usr/sbin/pkgutil --expand "$1" "$tmpdir/unpack"