summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lamb <chris@chris-lamb.co.uk>2008-08-07 20:08:04 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 19:03:37 +0100
commit6538fac66feaa5cb7957013a29da704a09256e3f (patch)
treed8cc94e5900c40665f7e5fd8776216c198ce39cf
parentb07f1ccc01ff033baf6fb2ccef48778957b3f89e (diff)
downloadvyos-live-build-6538fac66feaa5cb7957013a29da704a09256e3f.tar.gz
vyos-live-build-6538fac66feaa5cb7957013a29da704a09256e3f.zip
Test whether to use hard-links when caching d-i downloads.
-rwxr-xr-xhelpers/lh_binary_debian-installer7
1 files changed, 6 insertions, 1 deletions
diff --git a/helpers/lh_binary_debian-installer b/helpers/lh_binary_debian-installer
index c0bb74c7f..e579eec28 100755
--- a/helpers/lh_binary_debian-installer
+++ b/helpers/lh_binary_debian-installer
@@ -216,7 +216,12 @@ Download_file () {
fi
fi
- cp -fl "${_LH_CACHE_FILE}" "${_LH_TARGET}"
+ if [ "$(stat --printf %d "${_LH_CACHE_DIR}")" = "$(stat --printf %d ./)" ]
+ then
+ CP_OPTIONS="-l"
+ fi
+
+ cp -f ${CP_OPTIONS} -- "${_LH_CACHE_FILE}" "${_LH_TARGET}"
}
VMLINUZ_DI="vmlinuz"