summaryrefslogtreecommitdiff
path: root/scripts/saveSample.sh
diff options
context:
space:
mode:
authorYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-05-07 15:57:02 (GMT)
committerYann E. MORIN" <yann.morin.1998@anciens.enib.fr>2007-05-07 15:57:02 (GMT)
commit64d804c4f65b4257b1507491cdc9a103c38999d4 (patch)
tree8856e2712d13682baec119c2e4f148ad92db06ea /scripts/saveSample.sh
parent58b4c6d0a44d57b15d7857ecb27711a2224949e9 (diff)
Fix glibc and uClibc downloading and extracting.
Although we no longer need the kernel config file, we now need to specify the kernel source directory when installing headers. Re-order components downloading to match build order. Fix the saveSample.sh script in case the referenced files are the same as the destination files.
Diffstat (limited to 'scripts/saveSample.sh')
-rwxr-xr-xscripts/saveSample.sh24
1 files changed, 20 insertions, 4 deletions
diff --git a/scripts/saveSample.sh b/scripts/saveSample.sh
index 1d01c66..14d27d1 100755
--- a/scripts/saveSample.sh
+++ b/scripts/saveSample.sh
@@ -27,17 +27,34 @@ CT_LOG_LEVEL_MAX="INFO"
# Target triplet: CT_TARGET needs a little love:
CT_DoBuildTargetTriplet
+# Kludge: if any of the config options needs either CT_TARGET or CT_TOP_DIR,
+# re-parse them:
+. "${CT_TOP_DIR}/.config"
+
# Create the sample directory
[ -d "${CT_TOP_DIR}/samples/${CT_TARGET}" ] || svn mkdir "${CT_TOP_DIR}/samples/${CT_TARGET}" >/dev/null 2>&1
# Save the crosstool-NG config file
cp "${CT_TOP_DIR}/.config" "${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config"
+# Function to copy a file to the sample directory
+# Needed in case the file is already there (think of a previously available sample)
+# Usage: CT_DoAddFileToSample <source> <dest>
+CT_DoAddFileToSample() {
+ source="$1"
+ dest="$2"
+ inode_s=`ls -i "${source}"`
+ inode_d=`ls -i "${dest}"`
+ if [ "${inode_s}" != "${inode_d}" ]; then
+ cp "${source}" "${dest}"
+ fi
+ svn add "${dest}" >/dev/null 2>&1
+}
+
# Save the kernel .config file
if [ -n "${CT_KERNEL_LINUX_CONFIG_FILE}" ]; then
# We save the file, and then point the saved sample to this file
- cp "${CT_KERNEL_LINUX_CONFIG_FILE}" "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_KERNEL}-${CT_KERNEL_VERSION}.config"
- svn add "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_KERNEL}-${CT_KERNEL_VERSION}.config" >/dev/null 2>&1
+ CT_DoAddFileToSample "${CT_KERNEL_LINUX_CONFIG_FILE}" "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_KERNEL}-${CT_KERNEL_VERSION}.config"
sed -r -i -e 's|^(CT_KERNEL_LINUX_CONFIG_FILE=).+$|\1"${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_KERNEL}-${CT_KERNEL_VERSION}.config"|;' \
"${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config"
else
@@ -50,8 +67,7 @@ fi
# Save the uClibc .config file
if [ -n "${CT_LIBC_UCLIBC_CONFIG_FILE}" ]; then
# We save the file, and then point the saved sample to this file
- cp "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
- svn add "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config" >/dev/null 2>&1
+ CT_DoAddFileToSample "${CT_LIBC_UCLIBC_CONFIG_FILE}" "${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"
sed -r -i -e 's|^(CT_LIBC_UCLIBC_CONFIG_FILE=).+$|\1"${CT_TOP_DIR}/samples/${CT_TARGET}/${CT_LIBC}-${CT_LIBC_VERSION}.config"|;' \
"${CT_TOP_DIR}/samples/${CT_TARGET}/crosstool.config"
else