Skip to content

Commit

Permalink
Merge branch 'topic/setup'
Browse files Browse the repository at this point in the history
* topic/setup:
  Update xquartz to 2.8.3.
  Do not require valid certs when downloading.
  • Loading branch information
dak180 committed Dec 12, 2022
2 parents fc62de1 + 0d855ae commit 63ca0e6
Showing 1 changed file with 19 additions and 11 deletions.
30 changes: 19 additions & 11 deletions srcinstaller/Install Fink.tool
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,17 @@ DarwinVersion="$(uname -r | cut -d. -f1)"
XcodeURL="macappstore://itunes.apple.com/us/app/xcode/id497799835?mt=12"

# Starting with 10.15 we do not use /sw due to SIP.
if [ "${DarwinVersion}" -le "18" ]; then
if [ "${DarwinVersion}" -le "18" ]; then
FinkPrefix="/sw"
else
FinkPrefix="/opt/sw"
fi

# Check if we may have a problem with certs
if [ "${DarwinVersion}" -le "17" ]; then
OldCerts="true"
fi

# Java site: https://jdk.java.net/
Jvers="1.6"
JavaVersion="15.0.2"
Expand All @@ -34,10 +39,10 @@ FinkDirectorY="${FinkOutDir}-${FinkVersion}"
FinkFileName="${FinkDirectorY}.tar.gz"
FinkSourceDLP="https://downloads.sourceforge.net/project/fink/fink/${FinkVersion}/${FinkFileName}"

XQuartzVersion="2.8.2"
XQuartzMD5Sum="4282e404cf1a59ffda2fcbfbfcfde7f0"
XQuartzPKGPath="XQuartz.pkg"
XQuartzFileName="XQuartz-${XQuartzVersion}.dmg"
XQuartzVersion="2.8.3"
XQuartzMD5Sum="e46f28b5cbb85a41a56f0e8d82f1fdfb"
XQuartzFileName="XQuartz-${XQuartzVersion}.pkg"
XQuartzPKGPath="${XQuartzFileName}"
XQuartzSourceDLP="https://github.com/XQuartz/XQuartz/releases/download/XQuartz-${XQuartzVersion}/${XQuartzFileName}"


Expand All @@ -48,6 +53,12 @@ function fetchBin {
local FileName="$3"
local DirectorY="$4"
local OutDir="$5"
local CurlOpt="$6"

if [ "${OldCerts}" = "true" ]; then
CurlOpt="-k"
fi


# Checks
if [[ -d "${OutDir}" ]] && [[ -f "${FileName}" ]]; then
Expand Down Expand Up @@ -75,7 +86,7 @@ function fetchBin {
# Fetch
if [ ! -r "${FileName}" ]; then
echo "Fetching ${SourceDLP}"
if ! curl -Lfo "${FileName}" --connect-timeout "30" -H 'referer:' -A "fink/${FinkVersion}" "${SourceDLP}"; then
if ! curl -Lfo "${FileName}" ${CurlOpt} --connect-timeout "30" -H 'referer:' -A "fink/${FinkVersion}" "${SourceDLP}"; then
echo "error: Unable to fetch ${SourceDLP}" >&2
exit 1
fi
Expand Down Expand Up @@ -105,7 +116,7 @@ function fetchBin {
echo "error: Unpacking ${FileName} failed" >&2
exit 1
fi
elif [ "${ExtensioN}" = "dmg" ]; then
elif [ "${ExtensioN}" = "dmg" ] || [ "${ExtensioN}" = "pkg" ]; then
return
else
echo "error: Unable to unpack ${FileName}" >&2
Expand Down Expand Up @@ -225,11 +236,8 @@ echo "Checking for XQuartz..." >&2
if ! pkgutil --pkg-info=org.xquartz.X11; then
echo "XQuartz is not installed, fetching..." >&2
fetchBin "${XQuartzMD5Sum}" "${XQuartzSourceDLP}" "${XQuartzFileName}" "-" "-"
echo "Mounting the XQuartz disk..." >&2
hdiutilOut="$(hdiutil mount "${XQuartzFileName}" 2>/dev/null | tr -d "\t" | grep -F '/dev/disk' | grep -Fv 'GUID_partition_scheme')"
XQuartzVolPath="$(echo "${hdiutilOut}" | sed -E 's:(/dev/disk[0-9])(s[0-9])?( +)?(Apple_HFS)?( +)::')"
echo "Starting the XQuartz install; please rerun this script when it finishes." >&2
open "${XQuartzVolPath}/${XQuartzPKGPath}"
open "${XQuartzPKGPath}"
exit 0
fi

Expand Down

0 comments on commit 63ca0e6

Please sign in to comment.