|
Line
Link Here
|
| 0 |
-- scripts/inspect.in |
0 |
++ scripts/inspect.in |
|
Lines 143-161
Link Here
|
| 143 |
return 1 |
143 |
return 1 |
| 144 |
} |
144 |
} |
| 145 |
|
145 |
|
| 146 |
# Extract the -p option from the command line |
146 |
# Extract the -p|--strip= option from the command line |
| 147 |
strip_option() { |
147 |
strip_option() { |
| 148 |
while [ $# -ne 0 -a "${1:0:2}" != -p ] |
148 |
local p |
|
|
149 |
while [ $# -ne 0 ] |
| 149 |
do |
150 |
do |
|
|
151 |
case "${1}" in |
| 152 |
-p*) |
| 153 |
p="${1}" |
| 154 |
[ "$p" = -p ] && { p="$1$2"; shift; } |
| 155 |
;; |
| 156 |
--strip=*) |
| 157 |
p="-p${1#--strip=}" |
| 158 |
;; |
| 159 |
esac |
| 150 |
shift |
160 |
shift |
| 151 |
done |
161 |
done |
| 152 |
if [ "${1:0:2}" = -p ] |
162 |
[ "$p" -a "$p" != -p1 ] && echo $p |
| 153 |
then |
|
|
| 154 |
[ "$1" = -p ] && set -- "$1$2" |
| 155 |
[ "$1" != -p1 ] && echo $1 |
| 156 |
fi |
| 157 |
} |
163 |
} |
| 158 |
|
164 |
|
|
|
165 |
# parse and remove -i|--input= and redirect stdin from that file |
| 166 |
case "${0##*/}" in |
| 167 |
patch) |
| 168 |
OPTS=() |
| 169 |
while [ "$1" ] |
| 170 |
do |
| 171 |
case "$1" in |
| 172 |
-i*) |
| 173 |
if [ "$1" = -i ] ; then |
| 174 |
exec <"$2" |
| 175 |
shift |
| 176 |
else |
| 177 |
exec <"${1#-i}" |
| 178 |
fi |
| 179 |
shift ;; |
| 180 |
--input=*) |
| 181 |
exec <"${1#--input=}" |
| 182 |
shift ;; |
| 183 |
*) |
| 184 |
OPTS=("${OPTS[@]}" "$1") |
| 185 |
shift ;; |
| 186 |
esac |
| 187 |
done |
| 188 |
set -- "${OPTS[@]}" |
| 189 |
;; |
| 190 |
esac |
| 191 |
|
| 159 |
# put data into tmpfile |
192 |
# put data into tmpfile |
| 160 |
tmpdir=${RPM_BUILD_DIR%/*} |
193 |
tmpdir=${RPM_BUILD_DIR%/*} |
| 161 |
cat > $tmpdir/data |
194 |
cat > $tmpdir/data |