comparison ar-lib @ 1806:40557fb08e98

New release
author Adam Chlipala <adam@chlipala.net>
date Tue, 07 Aug 2012 09:41:02 -0400
parents 74fcc977a13d
children
comparison
equal deleted inserted replaced
1805:d12192c7aa3e 1806:40557fb08e98
1 #! /bin/sh 1 #! /bin/sh
2 # Wrapper for Microsoft lib.exe 2 # Wrapper for Microsoft lib.exe
3 3
4 me=ar-lib 4 me=ar-lib
5 scriptversion=2012-01-30.22; # UTC 5 scriptversion=2012-03-01.08; # UTC
6 6
7 # Copyright (C) 2010, 2012 Free Software Foundation, Inc. 7 # Copyright (C) 2010, 2012 Free Software Foundation, Inc.
8 # Written by Peter Rosin <peda@lysator.liu.se>. 8 # Written by Peter Rosin <peda@lysator.liu.se>.
9 # 9 #
10 # This program is free software; you can redistribute it and/or modify 10 # This program is free software; you can redistribute it and/or modify
151 action=${action#-} 151 action=${action#-}
152 152
153 delete= 153 delete=
154 extract= 154 extract=
155 list= 155 list=
156 quick=
156 replace= 157 replace=
158 index=
157 create= 159 create=
158 160
159 while test -n "$action" 161 while test -n "$action"
160 do 162 do
161 case $action in 163 case $action in
162 d*) delete=yes ;; 164 d*) delete=yes ;;
163 x*) extract=yes ;; 165 x*) extract=yes ;;
164 t*) list=yes ;; 166 t*) list=yes ;;
167 q*) quick=yes ;;
165 r*) replace=yes ;; 168 r*) replace=yes ;;
169 s*) index=yes ;;
170 S*) ;; # the index is always updated implicitly
166 c*) create=yes ;; 171 c*) create=yes ;;
167 u*) ;; # TODO: don't ignore the update modifier 172 u*) ;; # TODO: don't ignore the update modifier
168 v*) ;; # TODO: don't ignore the verbose modifier 173 v*) ;; # TODO: don't ignore the verbose modifier
169 *) 174 *)
170 func_error "unknown action specified" 175 func_error "unknown action specified"
171 ;; 176 ;;
172 esac 177 esac
173 action=${action#?} 178 action=${action#?}
174 done 179 done
175 180
176 case $delete$extract$list$replace in 181 case $delete$extract$list$quick$replace,$index in
177 yes) 182 yes,* | ,yes)
178 ;; 183 ;;
179 yesyes*) 184 yesyes*)
180 func_error "more than one action specified" 185 func_error "more than one action specified"
181 ;; 186 ;;
182 *) 187 *)
223 do 228 do
224 $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $? 229 $AR -NOLOGO -EXTRACT:"$member" "$archive" || exit $?
225 done 230 done
226 fi 231 fi
227 232
228 elif test -n "$replace"; then 233 elif test -n "$quick$replace"; then
229 if test ! -f "$orig_archive"; then 234 if test ! -f "$orig_archive"; then
230 if test -z "$create"; then 235 if test -z "$create"; then
231 echo "$me: creating $orig_archive" 236 echo "$me: creating $orig_archive"
232 fi 237 fi
233 orig_archive= 238 orig_archive=