Lines 2-7
Link Here
|
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: $ |
3 |
# $Header: $ |
4 |
|
4 |
|
|
|
5 |
ATOM= |
6 |
CAT= |
5 |
PN= |
7 |
PN= |
6 |
|
8 |
|
7 |
ACTION= |
9 |
ACTION= |
Lines 56-67
function sanity_checks() {
Link Here
|
56 |
exit 1 |
58 |
exit 1 |
57 |
fi |
59 |
fi |
58 |
|
60 |
|
59 |
if [[ $(expr index "${PN}" "/") == "0" ]] ; then |
61 |
if [[ "${CAT}x" == "x" || "${PN}x" == "x" ]]; then |
60 |
eerror "Package name must be in the form CATEGORY/PN" |
62 |
eerror "Package name must be in the form CATEGORY/PN" |
61 |
exit 1 |
63 |
exit 1 |
62 |
fi |
64 |
fi |
63 |
|
65 |
|
64 |
if [[ ! -d "${WEBAPP_DIR}/${PN}" ]]; then |
66 |
if [[ ! -d "${WEBAPP_DIR}/${CAT}/${PN}" && ! -d "${WEBAPP_DIR}/${PN}" ]]; then |
65 |
eerror "${PN} not found" |
67 |
eerror "${PN} not found" |
66 |
exit 1 |
68 |
exit 1 |
67 |
fi |
69 |
fi |
Lines 133-139
function process_opts() {
Link Here
|
133 |
ACTION="help" |
135 |
ACTION="help" |
134 |
;; |
136 |
;; |
135 |
*) |
137 |
*) |
136 |
PN="$1" |
138 |
ATOM="${1}" |
|
|
139 |
parse_atom |
137 |
;; |
140 |
;; |
138 |
esac |
141 |
esac |
139 |
|
142 |
|
Lines 141-146
function process_opts() {
Link Here
|
141 |
done |
144 |
done |
142 |
} |
145 |
} |
143 |
|
146 |
|
|
|
147 |
parse_atom() { |
148 |
local pos=$(expr index "${ATOM}" "/") |
149 |
CAT=${ATOM:0:$pos - 1} |
150 |
PN=${ATOM:$pos} |
151 |
} |
152 |
|
144 |
process_opts $@ |
153 |
process_opts $@ |
145 |
|
154 |
|
146 |
sanity_checks |
155 |
sanity_checks |
147 |
- |
|
|