File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -80,10 +80,22 @@ python-framework-fetch-pkg() {
8080python-framework-extract-pkg () {
8181 local targetdir=${1:? }
8282 local pkgpath=${2:? }
83+ local pkgfilename
84+ pkgfilename=$( basename " ${pkgpath} " )
8385 mkdir -p " ${targetdir} " /Python.framework
8486 verbose 1 " Extracting framework at ${targetdir} /Python.framework"
85- tar -O -xf " ${pkgpath} " Python_Framework.pkg/Payload | \
86- tar -x -C " ${targetdir} " /Python.framework
87+ (
88+ tmpdir=$( mktemp -d -t python-framework-extract-pkg)
89+ cleanup-on-exit () {
90+ if [ -d " ${tmpdir:? } " ] ; then
91+ rm -rf " ${tmpdir:? } "
92+ fi
93+ }
94+ trap cleanup-on-exit EXIT
95+ pkgutil --expand " ${pkgpath} " " ${tmpdir:? } /${pkgfilename} " || exit 1
96+ tar -C " ${targetdir} " /Python.framework \
97+ -xf " ${tmpdir} /${pkgfilename} /Python_Framework.pkg/Payload" || exit 1
98+ )
8799}
88100
89101
You can’t perform that action at this time.
0 commit comments