107 |
exit 1 |
exit 1 |
108 |
} |
} |
109 |
|
|
110 |
|
print_usage() |
111 |
|
{ |
112 |
|
echo "Usage: $(basename $0) --opt arg ..." |
113 |
|
echo |
114 |
|
echo "Options:" |
115 |
|
echo " --profile, -p -- select a profile (needed)" |
116 |
|
echo " --root, -r -- location to new root (needed)" |
117 |
|
echo " --magerc, -m -- location of mage.rc (needed)" |
118 |
|
echo |
119 |
|
echo " --toolchain, -t -- select other toolchain than from profile" |
120 |
|
echo " --basesystem, -b -- select other basesystem than from profile" |
121 |
|
echo " --stage1, -s1 -- if set, abort after stage1 (toolchain)" |
122 |
|
echo " --help, -h -- prints this help" |
123 |
|
echo |
124 |
|
|
125 |
|
exit 1 |
126 |
|
} |
127 |
|
|
128 |
# set some proper traps |
# set some proper traps |
129 |
trap "trap_exit" SIGINT SIGQUIT |
trap "trap_exit" SIGINT SIGQUIT |
130 |
|
|
131 |
|
# show usage if no opts given |
132 |
|
[[ -z $* ]] && print_usage |
133 |
|
|
134 |
# very basic getops |
# very basic getops |
135 |
for i in $* |
for i in $* |
136 |
do |
do |
141 |
--root|-r) shift; MROOT="$1" ;; |
--root|-r) shift; MROOT="$1" ;; |
142 |
--stage1|-s1) ABORT_AFTER_STAGE1=true ;; |
--stage1|-s1) ABORT_AFTER_STAGE1=true ;; |
143 |
--magerc|-m) shift; MAGERC="$1" ;; |
--magerc|-m) shift; MAGERC="$1" ;; |
144 |
|
--help|-h) print_usage ;; |
145 |
|
'') shift;; |
146 |
|
*) echo "Unkown option '$1', use --help or -h to get more info."; exit 1 ;; |
147 |
esac |
esac |
148 |
shift |
shift |
149 |
done |
done |