-rwxr-xr-x | scripts/mkipkg | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/scripts/mkipkg b/scripts/mkipkg index 43bd3a3..a336371 100755 --- a/scripts/mkipkg +++ b/scripts/mkipkg | |||
@@ -176,29 +176,31 @@ createFileList() | |||
176 | { | 176 | { |
177 | local excludeMask | 177 | local excludeMask |
178 | local includeMask | 178 | local includeMask |
179 | local includemaskpresent=0 | 179 | local includemaskpresent=0 |
180 | local excludemaskpresent=0 | 180 | local excludemaskpresent=0 |
181 | 181 | ||
182 | if (cat $1|grep -q ^FileExcludeMask); then | 182 | if (grep -q ^FileExcludeMask $1); then |
183 | excludemaskpresent=1 | 183 | excludemaskpresent=1 |
184 | excludeMask=$(eval echo '"'$(sed -n -e "s,^FileExcludeMask: *,,p" $1)'"') | 184 | excludeMask=$(eval echo '"'$(sed -n -e "s,^FileExcludeMask: *,,p" $1)'"') |
185 | fi | 185 | fi |
186 | if (cat $1|grep -q ^FileIncludeMask); then | 186 | if (grep -q ^FileIncludeMask $1); then |
187 | includemaskpresent=1 | 187 | includemaskpresent=1 |
188 | includeMask=$(eval echo '"'$(sed -n -e "s,^FileIncludeMask: *,,p" $1)'"') | 188 | includeMask=$(eval echo '"'$(sed -n -e "s,^FileIncludeMask: *,,p" $1)'"') |
189 | else | 189 | else |
190 | if (cat $1|grep -q ^Files:); then | 190 | if (grep -q ^Files: $1); then |
191 | includemaskpresent=1 | 191 | includemaskpresent=1 |
192 | includeMask=$(eval echo '"'$(sed -n -e "s,^Files: *,,p" $1)'"') | 192 | includeMask=$(eval echo '"'$(sed -n -e "s,^Files: *,,p" $1)'"') |
193 | fi | 193 | fi |
194 | fi | 194 | fi |
195 | 195 | ||
196 | _pushd $destdir | 196 | _pushd $destdir |
197 | 197 | ||
198 | excludeMask="$excludeMask CONTROL/* usr/share/*" | 198 | declare -a excludeMaskArray |
199 | excludeMaskArray=( $excludeMask ) | ||
200 | excludeMaskArray=( "${excludeMaskArray[@]}" "CONTROL/*" "usr/share/*" ) | ||
199 | 201 | ||
200 | if [ $includemaskpresent != 1 ]; then | 202 | if [ $includemaskpresent != 1 ]; then |
201 | includeMask="." | 203 | includeMask="." |
202 | fi | 204 | fi |
203 | 205 | ||
204 | if [ -z "$includeMask" ]; then | 206 | if [ -z "$includeMask" ]; then |
@@ -206,27 +208,25 @@ createFileList() | |||
206 | _popd | 208 | _popd |
207 | return 0 | 209 | return 0 |
208 | fi | 210 | fi |
209 | 211 | ||
210 | expandMaskToList "$includeMask" _fileList | 212 | expandMaskToList "$includeMask" _fileList |
211 | 213 | ||
212 | _excludeList= | 214 | excludeMaskArray=( "${excludeMaskArray[@]}" "*/CVS*" "*/SCCS*" ) |
213 | if [ -n "$excludeMask" ]; then | ||
214 | expandMaskToList "$excludeMask" _excludeList | ||
215 | _excludeList="$_excludeList `find -name \*CVS\* -o -name \*SCCS\*`" | ||
216 | fi | ||
217 | 215 | ||
218 | local realFileList= | 216 | local realFileList= |
219 | local missing=0 | 217 | local missing=0 |
220 | for file in $_fileList; do | 218 | for file in $_fileList; do |
221 | local containedInList=0 | 219 | local containedInList=0 |
222 | for i in $_excludeList; do | 220 | for i in "${excludeMaskArray[@]}"; do |
223 | if [ $file = $i ]; then | 221 | if [[ $file == $i ]]; then |
224 | containedInList=1 | 222 | containedInList=1 |
223 | break; | ||
225 | fi | 224 | fi |
226 | done | 225 | done |
226 | |||
227 | if [ $containedInList = 0 ]; then | 227 | if [ $containedInList = 0 ]; then |
228 | if ! [ -e $file -o -L $file ]; then | 228 | if ! [ -e $file -o -L $file ]; then |
229 | echo "$self: $file not found" | 229 | echo "$self: $file not found" |
230 | missing=1 | 230 | missing=1 |
231 | fi | 231 | fi |
232 | realFileList=$file" $realFileList" | 232 | realFileList=$file" $realFileList" |