[SCM] debian-live branch, master, updated. 1.0_a48-1-6-gdb756ce

Chris Lamb chris at chris-lamb.co.uk
Thu Jul 24 04:57:34 UTC 2008


The following commit has been merged in the master branch:
commit db756ce6c615864326b1a00ac0baa9b733fa6f23
Author: Chris Lamb <chris at chris-lamb.co.uk>
Date:   Thu Jul 24 05:48:47 2008 +0100

    Cache d-i kernel, initrd and mini.iso downloads (Closes: #492085)
    
    Signed-off-by: Chris Lamb <chris at chris-lamb.co.uk>

diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer
index 85d88e3..d285f33 100755
--- a/helpers/lh_binary_debian-installer
+++ b/helpers/lh_binary_debian-installer
@@ -191,6 +191,10 @@ Install_file() {
 	cp "${FILE}" "${TARGET}"/"${LETTER}"/"${SOURCE}"
 }
 
+# Set absolute directory for caching; we require it when we call Download_file
+# from a non-standard cwd.
+_LH_CACHE_DIR="$(pwd)/cache/binary_debian-installer"
+
 Download_file () {
 	local _LH_TARGET
 	_LH_TARGET="${1}"
@@ -198,7 +202,15 @@ Download_file () {
 	local _LH_URL
 	_LH_URL="${2}"
 
-	wget ${WGET_OPTIONS} -O "${_LH_TARGET}" "${_LH_URL}"
+	_LH_CACHE_FILE="${_LH_CACHE_DIR}/$(echo "${_LH_URL}" | sed 's|/|_|g')"
+
+	if [ ! -f "${_LH_CACHE_FILE}" ]
+	then
+		mkdir -p ${_LH_CACHE_DIR}
+		wget ${WGET_OPTIONS} -O "${_LH_CACHE_FILE}" "${_LH_URL}"
+	fi
+
+	cp -fl "${_LH_CACHE_FILE}" "${_LH_TARGET}"
 }
 
 VMLINUZ_DI="vmlinuz"

-- 
debian-live



More information about the debian-live-changes mailing list