Skip to content
This repository
Newer
Older
100755 86 lines (78 sloc) 1.731 kb
785ac7ea »
2012-04-26 sm-installer
1 #!/usr/bin/env zsh
b99c84aa »
2011-05-05 Installer fully functional once again.
2
a4f9662c »
2011-08-21 Allow arguments to pass through during install.
3 extension_args=()
4
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
5 while (( $# ))
6 do
785ac7ea »
2012-04-26 sm-installer
7 case "$1" in
4c3cadd5 »
2011-08-21 Be explicit.
8 (--trace|trace)
a8b9cd43 »
2011-08-21 Switch to trace all for trace
9 extension_args+=("--trace=all")
785ac7ea »
2012-04-26 sm-installer
10 shift
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
11 ;;
977f03ca »
2011-11-17 Added --verbose to install.
12 (--verbose=*)
13 extension_args+=("--verbose")
785ac7ea »
2012-04-26 sm-installer
14 shift
977f03ca »
2011-11-17 Added --verbose to install.
15 ;;
0858bb2b »
2011-08-21 I'm seeing starz!!!
16 (--prefix=*)
785ac7ea »
2012-04-26 sm-installer
17 prefix_path="${1/*\=}"
18 shift
4ee0fad8 »
2011-08-21 Equality is overrated :P
19 ;;
785ac7ea »
2012-04-26 sm-installer
20 (--zsh|--shell)
21 export sm_shell="$2"
22 shift 2
f9ba6852 »
2011-09-09 Beginnings of working on zsh switch.
23 ;;
4c3cadd5 »
2011-08-21 Be explicit.
24 (--prefix|prefix)
785ac7ea »
2012-04-26 sm-installer
25 prefix_path="$2"
26 if ! shift 2
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
27 then
07587c59 »
2011-08-20 Some cleansing, some removal of external processes.
28 echo "ERROR: A prefix path must be followed by keyword 'prefix'."
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
29 exit 1
30 fi
31 ;;
4ee0fad8 »
2011-08-21 Equality is overrated :P
32 (DESTROOT=)
785ac7ea »
2012-04-26 sm-installer
33 DESTROOT="${1/*\=}"
34 shift
4ee0fad8 »
2011-08-21 Equality is overrated :P
35 ;;
d5776a4a »
2011-08-20 Forgot keyword "in"
36 (DESTROOT)
785ac7ea »
2012-04-26 sm-installer
37 DESTROOT="$2"
38 if ! shift 2
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
39 then
40 echo "ERROR: A DESTROOT path must be followed by keyword 'DESTROOT'."
41 exit 1
42 fi
43 ;;
d5776a4a »
2011-08-20 Forgot keyword "in"
44 (*)
785ac7ea »
2012-04-26 sm-installer
45 extension_args+=("$1")
46 shift
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
47 ;;
48 esac
49 done
50
896cd31f »
2012-04-26 improved zsh detection
51 if [[ -z "${sm_shell:-}" ]] && ! command -v zsh >/dev/null
52 then
53 echo "ERROR: ZSH is required for SM."
54 exit 1
55 fi
56
602e0571 »
2011-08-21 DOH!
57 if [[ -n "${prefix_path}" ]]
82d5c762 »
2011-08-07 fix local/install
58 then
4dec8fad »
2011-08-21 That was one hella sneaky sneaky, sir but. Thanks Deryl.
59 sm_path="${DESTROOT:-}${prefix_path}/sm"
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
60
61 elif [[ -z "${sm_path:-}" ]]
62 then
63 if (( UID ))
82d5c762 »
2011-08-07 fix local/install
64 then
5b2029e9 »
2012-06-20 prepare install for ebuild
65 sm_path="${DESTROOT:-/}${HOME#/}/.sm"
f4f906e3 »
2011-08-20 Support for DESTROOT, prefix and trace on install.
66 else
5b2029e9 »
2012-06-20 prepare install for ebuild
67 sm_path="${DESTROOT:-/}opt/sm"
82d5c762 »
2011-08-07 fix local/install
68 fi
69 fi
70
71 # set BDSM basic paths
785ac7ea »
2012-04-26 sm-installer
72 export sm_path install_path archives_path scm_path src_path sets_user_path DESTROOT
ac1c7758 »
2011-08-14 Speaking of S&M, this commit was... tedious.
73 install_path="${sm_path}" # Path to install everything to.
74 archives_path="${sm_path}/archives"
75 scm_path="${sm_path}/scm"
76 src_path="${sm_path}/src"
c93a9b54 »
2011-08-26 extension ext/set variable rename for clarity.
77 sets_user_path="${sm_path}/sets"
78 exts_user_path="${sm_path}/exts"
dd3f10b6 »
2011-08-07 install oprates on target dir
79
785ac7ea »
2012-04-26 sm-installer
80 if [[ -n "${sm_shell:-}" ]]
81 then
82 exec "${sm_shell}" "${PWD}/local" --call=install/install_sm "${extension_args[@]}"
83 else
84 exec "${PWD}/local" --call=install/install_sm "${extension_args[@]}"
85 fi
Something went wrong with that request. Please try again.