summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Ball <nullspoon@oper.io>2017-06-23 08:45:46 -0600
committerAaron Ball <nullspoon@oper.io>2017-06-23 08:45:46 -0600
commit186b88bac21b0001da2e7a5717dff1736027d69a (patch)
tree03034f0fe2a10bf4e6606b75ea66a64ad6655ed6
parent533cff3fadcf3b4bf2e18fe011459620a2e3b757 (diff)
downloadportimg-186b88bac21b0001da2e7a5717dff1736027d69a.tar.gz
portimg-186b88bac21b0001da2e7a5717dff1736027d69a.tar.xz
libpkg:Changed dowload path of pkg resources
Was downloading to the temp directory, but this was temporary and required re-downloading of the resources on every build. Now we download the package sources into the packages port directory, which is [probably] perisistent. These sources are then copied to the temporary build location.
-rw-r--r--lib/pkg.sh17
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/pkg.sh b/lib/pkg.sh
index 9c1a5df..4b17b27 100644
--- a/lib/pkg.sh
+++ b/lib/pkg.sh
@@ -25,20 +25,21 @@ export PORTSDIR=${PORTSDIR:-/usr/ports} # Path to port store
export PORTTMP='' # Path to the port temp dir
function pkg_download_src {
- local pkgsrc=${1}
- shift
- local src=${@}
+ local _port=${1:-}
+ local _pkgsrc=${2:-}
+ shift && shift
+ local _src=${@}
# Download from Pkgfile src spec
- for file in ${src[@]}; do
+ for file in ${_src[@]}; do
# If the source file exists locally, just copy from here
if [[ -f ${file} ]]; then
- cp -p ${file} ${pkgsrc}
+ cp -p ${file} ${_pkgsrc}
else
linfo "Downloading ${file}"
- download_src ${file} ${pkgsrc}
- linfo "Extracting $(basename ${file}) to ${pkgsrc}"
- archive_extract ${pkgsrc}/$(basename ${file}) ${pkgsrc}
+ download_src ${file} ${_port}
+ linfo "Extracting $(basename ${file}) to ${_pkgsrc}"
+ archive_extract ${_port}/$(basename ${file}) ${_pkgsrc}
fi
done
}

Generated by cgit