diff options
author | Aaron Ball <nullspoon@oper.io> | 2017-06-23 08:45:46 -0600 |
---|---|---|
committer | Aaron Ball <nullspoon@oper.io> | 2017-06-23 08:45:46 -0600 |
commit | 186b88bac21b0001da2e7a5717dff1736027d69a (patch) | |
tree | 03034f0fe2a10bf4e6606b75ea66a64ad6655ed6 | |
parent | 533cff3fadcf3b4bf2e18fe011459620a2e3b757 (diff) | |
download | portimg-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.sh | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -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 } |