From 3c611f6993fd7ac716dc99860df9af7abafde616 Mon Sep 17 00:00:00 2001 From: Aaron Ball Date: Fri, 23 Jun 2017 10:14:50 -0600 Subject: libpkg:Added skipping of already downloaded sources Previously sources were downloaded every run, even if they already existed. Now we skip them if they already exist in the port's directory. --- lib/pkg.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pkg.sh b/lib/pkg.sh index 86278b3..2a5047a 100644 --- a/lib/pkg.sh +++ b/lib/pkg.sh @@ -32,12 +32,16 @@ function pkg_download_src { # Download from Pkgfile src spec for file in ${_src[@]}; do - # If the source file exists locally, just copy from here if [[ -f ${file} ]]; then + # If the source file exists locally, just copy from here cp -p ${file} ${_pkgsrc} else - linfo "Downloading ${file}" - download_src ${file} ${_port} + if [ -f $(basename ${file}) ]; then + linfo "Source '${file}' already downloaded" + else + linfo "Downloading ${file}" + download_src ${file} ${_port} + fi linfo "Extracting $(basename ${file}) to ${_pkgsrc}" archive_extract ${_port}/$(basename ${file}) ${_pkgsrc} fi -- cgit v1.2.3