Permalink
Browse files

Whitespace fixes.

  • Loading branch information...
dak180 committed Sep 10, 2013
1 parent 47e9ca6 commit 7db9ad7f9616f1bf5b25da6a7a49975e1a6b923e
Showing with 91 additions and 91 deletions.
  1. +43 −43 macosx/configs/FetchPrebuilt.sh
  2. +48 −48 macosx/configs/FetchSource.sh
@@ -12,88 +12,88 @@ BackupDLP="http://wz2100.net/~dak180/BuildTools/Mac/"
# Make sure we are in the right place
cd "${SRCROOT}"
if [ ! -d "external" ]; then
- mkdir external
+ mkdir external
fi
if [ ! -d "prebuilt" ]; then
- mkdir prebuilt
+ mkdir prebuilt
fi
# Checks
if [ "${ACTION}" = "clean" ]; then
- # Force cleaning when directed
- rm -fRv "prebuilt/${DirectorY}" "external/${OutDir}"
- MD5SumLoc="$(md5 -q "prebuilt/${FileName}")"
- if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
- rm -fRv "prebuilt/${FileName}"
- fi
- exit 0
+ # Force cleaning when directed
+ rm -fRv "prebuilt/${DirectorY}" "external/${OutDir}"
+ MD5SumLoc="$(md5 -q "prebuilt/${FileName}")"
+ if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
+ rm -fRv "prebuilt/${FileName}"
+ fi
+ exit 0
elif [ -d "prebuilt/${DirectorY}" ]; then
- # Clean if dirty
- echo "error: ${DirectorY} exists, probably from an earlier failed run" >&2
-# rm -frv "prebuilt/${DirectorY}"
- exit 1
+ # Clean if dirty
+ echo "error: ${DirectorY} exists, probably from an earlier failed run" >&2
+# rm -frv "prebuilt/${DirectorY}"
+ exit 1
elif [[ -d "external/${OutDir}" ]] && [[ ! -f "prebuilt/${FileName}" ]]; then
- # Clean up when updating versions
- echo "warning: Cached file is outdated or incomplete, removing" >&2
- rm -fR "prebuilt/${DirectorY}" "external/${OutDir}"
+ # Clean up when updating versions
+ echo "warning: Cached file is outdated or incomplete, removing" >&2
+ rm -fR "prebuilt/${DirectorY}" "external/${OutDir}"
elif [[ -d "external/${OutDir}" ]] && [[ -f "prebuilt/${FileName}" ]]; then
- # Check to make sure we have the right file
- MD5SumLoc="$(cat "external/${OutDir}/.MD5SumLoc" 2>/dev/null || echo "")"
- if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
- echo "warning: Cached file is outdated or incorrect, removing" >&2
- rm -fR "prebuilt/${DirectorY}" "external/${OutDir}"
+ # Check to make sure we have the right file
+ MD5SumLoc="$(cat "external/${OutDir}/.MD5SumLoc" 2>/dev/null || echo "")"
+ if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
+ echo "warning: Cached file is outdated or incorrect, removing" >&2
+ rm -fR "prebuilt/${DirectorY}" "external/${OutDir}"
MD5SumFle=`md5 -q "prebuilt/${FileName}"`
if [ "${MD5SumFle}" != "${MD5Sum}" ]; then
rm -fR "prebuilt/${FileName}"
fi
- else
- # Do not do more work then we have to
- echo "${OutDir} already exists, skipping" >&2
- exit 0
- fi
+ else
+ # Do not do more work then we have to
+ echo "${OutDir} already exists, skipping" >&2
+ exit 0
+ fi
fi
# Fetch
cd prebuilt
if [ ! -f "${FileName}" ]; then
- echo "Fetching ${FileName}"
- if ! curl -LfO --connect-timeout "30" "${BuiltDLP}"; then
- if ! curl -LfOC - --connect-timeout "30" "${BackupDLP}${FileName}"; then
+ echo "Fetching ${FileName}"
+ if ! curl -LfO --connect-timeout "30" "${BuiltDLP}"; then
+ if ! curl -LfOC - --connect-timeout "30" "${BackupDLP}${FileName}"; then
echo "error: Unable to fetch ${SourceDLP}" >&2
exit 1
- fi
- fi
+ fi
+ fi
else
- echo "${FileName} already exists, skipping" >&2
+ echo "${FileName} already exists, skipping" >&2
fi
# MD5 check
MD5SumLoc="$(md5 -q "${FileName}")"
if [ -z "${MD5SumLoc}" ]; then
- echo "error: Unable to compute md5 for ${FileName}" >&2
- exit 1
+ echo "error: Unable to compute md5 for ${FileName}" >&2
+ exit 1
elif [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
- echo "error: MD5 does not match for ${FileName}" >&2
- exit 1
+ echo "error: MD5 does not match for ${FileName}" >&2
+ exit 1
fi
# Unpack
if ! tar -xzf "${FileName}"; then
- echo "error: Unpacking $FileName failed" >&2
- exit 1
+ echo "error: Unpacking $FileName failed" >&2
+ exit 1
fi
# Save the sum
echo "${MD5SumLoc}" > "${DirectorY}/.MD5SumLoc"
# Move
if [ ! -d "${DirectorY}" ]; then
- echo "error: Can't find $DirectorY to rename" >&2
- exit 1
+ echo "error: Can't find $DirectorY to rename" >&2
+ exit 1
else
- cd ..
- mv "prebuilt/${DirectorY}" "external/${OutDir}"
- touch external/${OutDir}/*
+ cd ..
+ mv "prebuilt/${DirectorY}" "external/${OutDir}"
+ touch external/${OutDir}/*
fi
exit 0
@@ -12,94 +12,94 @@ BackupDLP="http://wz2100.net/~dak180/BuildTools/external/"
# Make sure we are in the right place
cd "${SRCROOT}"
if [ ! -d "external" ]; then
- mkdir external
+ mkdir external
fi
cd external
# Checks
if [ "${ACTION}" = "clean" ]; then
- # Force cleaning when directed
- rm -fRv "${DirectorY}" "${OutDir}"
- MD5SumLoc="$(md5 -q "${FileName}")"
- if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
- rm -fRv "${FileName}"
- fi
- exit 0
+ # Force cleaning when directed
+ rm -fRv "${DirectorY}" "${OutDir}"
+ MD5SumLoc="$(md5 -q "${FileName}")"
+ if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
+ rm -fRv "${FileName}"
+ fi
+ exit 0
elif [ -d "${DirectorY}" ]; then
- # Clean if dirty
- echo "error: ${DirectorY} exists, probably from an earlier failed run" >&2
-# rm -fRv "${DirectorY}"
- exit 1
+ # Clean if dirty
+ echo "error: ${DirectorY} exists, probably from an earlier failed run" >&2
+# rm -fRv "${DirectorY}"
+ exit 1
elif [[ -d "${OutDir}" ]] && [[ ! -f "${FileName}" ]]; then
- # Clean up when updating versions
- echo "warning: Cached file is outdated or incomplete, removing" >&2
- rm -fR "${DirectorY}" "${OutDir}"
+ # Clean up when updating versions
+ echo "warning: Cached file is outdated or incomplete, removing" >&2
+ rm -fR "${DirectorY}" "${OutDir}"
elif [[ -d "${OutDir}" ]] && [[ -f "${FileName}" ]]; then
- # Check to make sure we have the right file
- MD5SumLoc="$(cat "${OutDir}/.MD5SumLoc" 2>/dev/null || echo "")"
- if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
- echo "warning: Cached file is outdated or incorrect, removing" >&2
- rm -fR "${DirectorY}" "${OutDir}"
+ # Check to make sure we have the right file
+ MD5SumLoc="$(cat "${OutDir}/.MD5SumLoc" 2>/dev/null || echo "")"
+ if [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
+ echo "warning: Cached file is outdated or incorrect, removing" >&2
+ rm -fR "${DirectorY}" "${OutDir}"
MD5SumFle="$(md5 -q "${FileName}")"
if [ "${MD5SumFle}" != "${MD5Sum}" ]; then
rm -fR "${FileName}"
fi
- else
- # Do not do more work then we have to
- echo "${OutDir} already exists, skipping" >&2
- exit 0
- fi
+ else
+ # Do not do more work then we have to
+ echo "${OutDir} already exists, skipping" >&2
+ exit 0
+ fi
fi
# Fetch
if [ ! -r "${FileName}" ]; then
- echo "Fetching ${SourceDLP}"
- if ! curl -Lfo "${FileName}" --connect-timeout "30" "${SourceDLP}"; then
- if ! curl -LfOC - --connect-timeout "30" "${BackupDLP}${FileName}"; then
+ echo "Fetching ${SourceDLP}"
+ if ! curl -Lfo "${FileName}" --connect-timeout "30" "${SourceDLP}"; then
+ if ! curl -LfOC - --connect-timeout "30" "${BackupDLP}${FileName}"; then
echo "error: Unable to fetch ${SourceDLP}" >&2
exit 1
- fi
- fi
+ fi
+ fi
else
- echo "${FileName} already exists, skipping" >&2
+ echo "${FileName} already exists, skipping" >&2
fi
# Check our sums
MD5SumLoc="$(md5 -q "${FileName}")"
if [ -z "${MD5SumLoc}" ]; then
- echo "error: Unable to compute md5 for ${FileName}" >&2
- exit 1
+ echo "error: Unable to compute md5 for ${FileName}" >&2
+ exit 1
elif [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
- echo "error: MD5 does not match for ${FileName}" >&2
- exit 1
+ echo "error: MD5 does not match for ${FileName}" >&2
+ exit 1
fi
# Unpack
ExtensioN="$(echo "${FileName}" | sed -e 's:^.*\.\([^.]*\):\1:')"
if [[ "${ExtensioN}" = "gz" ]] || [[ "${ExtensioN}" = "tgz" ]]; then
- if ! tar -zxf "${FileName}"; then
- echo "error: Unpacking ${FileName} failed" >&2
- exit 1
- fi
+ if ! tar -zxf "${FileName}"; then
+ echo "error: Unpacking ${FileName} failed" >&2
+ exit 1
+ fi
elif [ "${ExtensioN}" = "bz2" ]; then
- if ! tar -jxf "${FileName}"; then
- echo "error: Unpacking ${FileName} failed" >&2
- exit 1
- fi
+ if ! tar -jxf "${FileName}"; then
+ echo "error: Unpacking ${FileName} failed" >&2
+ exit 1
+ fi
else
- echo "error: Unable to unpack ${FileName}" >&2
- exit 1
+ echo "error: Unable to unpack ${FileName}" >&2
+ exit 1
fi
# Save the sum
echo "${MD5SumLoc}" > "${DirectorY}/.MD5SumLoc"
# Move
if [ ! -d "${DirectorY}" ]; then
- echo "error: Can't find ${DirectorY} to rename" >&2
- exit 1
+ echo "error: Can't find ${DirectorY} to rename" >&2
+ exit 1
else
- mv "${DirectorY}" "${OutDir}"
+ mv "${DirectorY}" "${OutDir}"
fi
exit 0

0 comments on commit 7db9ad7

Please sign in to comment.