Skip to content
Browse files

Clean up some of the mac scripts.

  • Loading branch information...
1 parent 8b38d3a commit 47e9ca607bf9c7a91a10b3ff6658bad7a6803f62 @dak180 dak180 committed Sep 10, 2013
Showing with 14 additions and 14 deletions.
  1. +6 −6 macosx/configs/FetchPrebuilt.sh
  2. +8 −8 macosx/configs/FetchSource.sh
View
12 macosx/configs/FetchPrebuilt.sh
@@ -22,23 +22,23 @@ fi
if [ "${ACTION}" = "clean" ]; then
# Force cleaning when directed
rm -fRv "prebuilt/${DirectorY}" "external/${OutDir}"
- MD5SumLoc=`md5 -q "prebuilt/${FileName}"`
+ 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}"
+# 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}"
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 ""`
+ 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}"
@@ -48,7 +48,7 @@ elif [[ -d "external/${OutDir}" ]] && [[ -f "prebuilt/${FileName}" ]]; then
fi
else
# Do not do more work then we have to
- echo "${OutDir} already exists, skipping"
+ echo "${OutDir} already exists, skipping" >&2
exit 0
fi
fi
@@ -64,11 +64,11 @@ if [ ! -f "${FileName}" ]; then
fi
fi
else
- echo "${FileName} already exists, skipping"
+ echo "${FileName} already exists, skipping" >&2
fi
# MD5 check
-MD5SumLoc=`md5 -q "${FileName}"`
+MD5SumLoc="$(md5 -q "${FileName}")"
if [ -z "${MD5SumLoc}" ]; then
echo "error: Unable to compute md5 for ${FileName}" >&2
exit 1
View
16 macosx/configs/FetchSource.sh
@@ -20,33 +20,33 @@ cd external
if [ "${ACTION}" = "clean" ]; then
# Force cleaning when directed
rm -fRv "${DirectorY}" "${OutDir}"
- MD5SumLoc=`md5 -q "${FileName}"`
+ 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}"
+# 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}"
elif [[ -d "${OutDir}" ]] && [[ -f "${FileName}" ]]; then
# Check to make sure we have the right file
- MD5SumLoc=`cat "${OutDir}/.MD5SumLoc" 2>/dev/null || echo ""`
+ 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}"`
+ 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"
+ echo "${OutDir} already exists, skipping" >&2
exit 0
fi
fi
@@ -61,11 +61,11 @@ if [ ! -r "${FileName}" ]; then
fi
fi
else
- echo "${FileName} already exists, skipping"
+ echo "${FileName} already exists, skipping" >&2
fi
# Check our sums
-MD5SumLoc=`md5 -q "${FileName}"`
+MD5SumLoc="$(md5 -q "${FileName}")"
if [ -z "${MD5SumLoc}" ]; then
echo "error: Unable to compute md5 for ${FileName}" >&2
exit 1
@@ -75,7 +75,7 @@ elif [ "${MD5SumLoc}" != "${MD5Sum}" ]; then
fi
# Unpack
-ExtensioN=`echo ${FileName} | sed -e 's:^.*\.\([^.]*\):\1:'`
+ExtensioN="$(echo "${FileName}" | sed -e 's:^.*\.\([^.]*\):\1:')"
if [[ "${ExtensioN}" = "gz" ]] || [[ "${ExtensioN}" = "tgz" ]]; then
if ! tar -zxf "${FileName}"; then
echo "error: Unpacking ${FileName} failed" >&2

0 comments on commit 47e9ca6

Please sign in to comment.
Something went wrong with that request. Please try again.