Skip to content

Commit b7b9feb

Browse files
committed
Merge branch 'topic/setup'
* topic/setup: Fix quotes. Change default install path location to /opt/sw
2 parents ec23911 + 42891fa commit b7b9feb

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

srcinstaller/Install Fink.tool

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
OSXVersion="$(sw_vers -productVersion | cut -f -2 -d .)"
99
DarwinVersion="$(uname -r | cut -d. -f1)"
1010
XcodeURL="macappstore://itunes.apple.com/us/app/xcode/id497799835?mt=12"
11+
FinkPrefix="/opt/sw"
1112

1213
Jvers="1.6"
1314

@@ -136,11 +137,11 @@ where it left off.
136137
EOF
137138

138139
# Handle existing installs
139-
if [ -d "/sw" ]; then
140+
if [ -d "${FinkPrefix}" ]; then
140141
FinkExisting="1"
141142
cat > "/dev/stderr" << EOF
142143
It looks like you already have fink installed; if it did not finish or
143-
you are upgrading we will move it aside to /sw.old so you can delete it
144+
you are upgrading we will move it aside to ${FinkPrefix}.old so you can delete it
144145
later if you like; otherwise you may want to exit.
145146
146147
EOF
@@ -151,10 +152,10 @@ if ! read -n1 -rsp $'Press any key to continue or ctrl+c to exit.\n'; then
151152
fi
152153

153154
if [ "${FinkExisting}" = "1" ]; then
154-
if ! sudo mv /sw /sw.old; then
155+
if ! sudo mv "${FinkPrefix}" "${FinkPrefix}".old; then
155156
clear
156157
cat > "/dev/stderr" << EOF
157-
Could not move /sw to /sw.old; you may need to delete one or both these
158+
Could not move ${FinkPrefix} to ${FinkPrefix}.old; you may need to delete one or both these
158159
yourself.
159160
EOF
160161
exit 1
@@ -260,7 +261,7 @@ fi
260261
clear
261262
cd "${FinkOutDir}"
262263

263-
if ! ./bootstrap /sw; then
264+
if ! ./bootstrap "${FinkPrefix}"; then
264265
exit 1
265266
fi
266267

@@ -269,17 +270,17 @@ fi
269270
if [ "${UseBinaryDist}" = "1" ]; then
270271
clear
271272
echo "Activating the Binary Distribution..." >&2
272-
sudo rm /sw/etc/fink.conf.bak
273-
sudo mv /sw/etc/fink.conf /sw/etc/fink.conf.bak
274-
sed -e 's|UseBinaryDist: false|UseBinaryDist: true|' "/sw/etc/fink.conf.bak" | sudo tee "/sw/etc/fink.conf"
273+
sudo rm "${FinkPrefix}/etc/fink.conf.bak"
274+
sudo mv "${FinkPrefix}/etc/fink.conf" "${FinkPrefix}/etc/fink.conf.bak"
275+
sed -e 's|UseBinaryDist: false|UseBinaryDist: true|' "${FinkPrefix}/etc/fink.conf.bak" | sudo tee "${FinkPrefix}/etc/fink.conf"
275276

276-
if grep -Fqx 'bindist.finkmirrors.net' "/sw/etc/apt/sources.list"; then
277+
if grep -Fqx 'bindist.finkmirrors.net' "${FinkPrefix}/etc/apt/sources.list"; then
277278
# Fix wrong address.
278-
sudo rm "/sw/etc/apt/sources.list.finkbak"
279-
sudo mv "/sw/etc/apt/sources.list" "/sw/etc/apt/sources.list.finkbak"
280-
sed -e 's:finkmirrors.net:finkproject.org:g' "/sw/etc/apt/sources.list.finkbak" | sudo tee "/sw/etc/apt/sources.list"
281-
elif ! grep -Fqx 'http://bindist.finkproject.org/' "/sw/etc/apt/sources.list"; then
282-
sudo tee -a "/sw/etc/apt/sources.list" << EOF
279+
sudo rm "${FinkPrefix}/etc/apt/sources.list.finkbak"
280+
sudo mv "${FinkPrefix}/etc/apt/sources.list" "${FinkPrefix}/etc/apt/sources.list.finkbak"
281+
sed -e 's:finkmirrors.net:finkproject.org:g' "${FinkPrefix}/etc/apt/sources.list.finkbak" | sudo tee "${FinkPrefix}/etc/apt/sources.list"
282+
elif ! grep -Fqx 'http://bindist.finkproject.org/' "${FinkPrefix}/etc/apt/sources.list"; then
283+
sudo tee -a "${FinkPrefix}/etc/apt/sources.list" << EOF
283284
284285
# Official bindist see http://bindist.finkproject.org/ for details.
285286
deb http://bindist.finkproject.org/${OSXVersion} stable main
@@ -291,10 +292,10 @@ fi
291292
# Set up paths
292293
clear
293294
echo "Setting up Fink paths..." >&2
294-
/sw/bin/pathsetup.sh
295+
${FinkPrefix}/bin/pathsetup.sh
295296

296297
# First selfupdate
297-
source /sw/bin/init.sh
298+
source ${FinkPrefix}/bin/init.sh
298299
clear
299300
cat > "/dev/stderr" << EOF
300301
Now the last thing we will do is run 'fink selfupdate' for the first

0 commit comments

Comments
 (0)