Debian Codegraph @

mac/setup/ncftp_dist/Resources/preflight

raw
1 #!/bin/sh
2 #
3 # NcFTP 2.4.3 is included with the Mac OS X installation from Apple.
4 # This script tries to preserve it by renaming
5 # /usr/bin/ncftp to /usr/bin/ncftp-2.4.3.
6 #
7 SCRIPT_NAME=`basename "$0"`
8 ID="`/usr/bin/id`"
9 NCFTP_PKG_DEBUG="no"
10
11 if [ "$NCFTP_PKG_DEBUG" = yes ] ; then
12
13 echo "Running the script $SCRIPT_NAME from the Installer as: $ID" > /private/var/tmp/$SCRIPT_NAME.out
14
15 /usr/bin/osascript -l AppleScript <<EOF
16 tell application "Finder"
17 display dialog "Running the script $SCRIPT_NAME from the Installer as: $ID"
18 end tell
19 EOF
20
21 fi
22
23 #
24 # More debug stuff, but this goes to stdout, or while in the installer,
25 # to the Installer Log
26 #
27 echo "Running the script $SCRIPT_NAME from the Installer as: $ID"
28 i=0
29 for arg in "$@"
30 do
31 i=`expr "$i" + 1`
32 echo " $SCRIPT_NAME arg $i: $arg"
33 done
34 echo
35
36 echo "$SCRIPT_NAME environment:"
37 set | sed 's/^/ /;'
38
39 echo
40 echo "$SCRIPT_NAME execution starting at `date`."
41
42 v=`/usr/bin/ncftp -H 2>&1 | sed -n '/^Version:\ *2\./{s/^Version:\ *\(2\..\..\).*$/\1/;p;q;}'`
43 case "$v" in
44 2.*)
45 if [ -f /usr/bin/ncftp ] ; then
46 echo /bin/mv /usr/bin/ncftp "/usr/bin/ncftp-$v"
47 /bin/mv /usr/bin/ncftp "/usr/bin/ncftp-$v"
48 echo "(exit status=$?)"
49 fi
50 if [ -f /usr/share/man/man1/ncftp.1 ] ; then
51 echo /bin/mv /usr/share/man/man1/ncftp.1 "/usr/share/man/man1/ncftp-$v.1"
52 /bin/mv /usr/share/man/man1/ncftp.1 "/usr/share/man/man1/ncftp-$v.1"
53 echo "(exit status=$?)"
54 fi
55 ;;
56 esac
57
58 echo "$SCRIPT_NAME execution finished at `date`."
59 exit 0