2 # BCU SDK bcu development enviroment - install helper
3 # Copyright (C) 2005-2011 Martin Koegler <mkoegler@auto.tuwien.ac.at>
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 # searches replacement for missing (or equal) SDK files
20 # parameter: destdir installfilename
31 prefix
="`echo $F|sed -e 's/\([A-Za-z0-9]*_\).*/\1/g'`"
32 last
="`echo $F|sed -e 's/[A-Za-z0-9]*_\(.*\)/\1/g'`"
34 base
="`echo "$last" | sed -e 's/\([0-9A-Fa-f]\{4\}\)[^.]*\([.].*\)/\1\2/g'`"
36 if [ -f "$prefix$base" ]; then
37 echo "using $prefix$base for $F"
39 cp "$prefix$base" "$1/$2" ||
exit 1
43 ext
="`echo $base | sed -e 's/[0-9A-Fa-f]\{4\}\([.].*\)/\1/g'`"
44 mask
="`echo $base | sed -e 's/\([0-9A-Fa-f]\{4\}\)[.].*/\1/g'`"
45 var
="`echo $last | sed -e 's/[0-9A-Fa-f]\{4\}\([^.]*\)[.].*/\1/g'`"
49 *) echo "unknown mask version $mask"
55 if [ -f "$prefix$a$var$ext" ]; then
56 echo using
"$prefix$a$var$ext for $F"
58 cp "$prefix$a$var$ext" "$1/$2" ||
exit 1
63 if [ -f "$prefix$a$ext" ]; then
64 echo "using $prefix$a$ext for $F"
66 cp "$prefix$a$ext" "$1/$2" ||
exit 1
73 echo "no file found for $F"