version 1.1.1.1.2.1, 2011/07/21 08:32:21
|
version 1.3.2.2, 2013/01/27 21:06:42
|
Line 40 SnitVer()
|
Line 40 SnitVer()
|
# $3 = To Dest dir |
# $3 = To Dest dir |
InstallList() |
InstallList() |
{ |
{ |
sed -nE -e 's/^ *([^ #]+) */\1/p' < $1 | tr ':' '\n' | | local TMPFILE=$(mktemp -q /tmp/instlist.XXXXXX) |
tar -C $2 -cvf - -T - | tar -C $3 -x -f - | if [ $? -ne 0 ]; then |
| echo "Error:: Can't create temp file, exiting..." |
| exit 1 |
| fi |
| |
| sed -nE -e 's/^ *([^ #]+) */\1/p' < $1 | tr ':' '\n' >$TMPFILE |
| cd $2 |
| for i in $(cat $TMPFILE); do |
| if [ -x $i ]; then |
| echo "Strip '$i'" |
| strip -s $i |
| fi |
| done |
| cd - |
| tar -C $2 -cvf - -T $TMPFILE | tar -C $3 -x -f - |
| rm -f $TMPFILE |
} |
} |
|
|
# $1 = From dir |
# $1 = From dir |
Line 60 InstallProg()
|
Line 75 InstallProg()
|
} |
} |
|
|
# $1 = file_pattern |
# $1 = file_pattern |
# $2 = To dir | # $2 = From dir |
# $3 = From dir | # $3 = To dir |
InstallFiles() |
InstallFiles() |
{ |
{ |
cd $2 | if [ -d "$2" ]; then |
find . -type f -name "$1" | | cd $2 |
tar -cvf - -T - | tar -C $3 -xf - | find . -type f -name "$1" | |
cd - | tar -cvf - -T - | tar -C $3 -xf - |
| cd - |
| fi |
| } |
| |
| # $1 = Directory for clean |
| CleanCVS() |
| { |
| find $1 -type d -name CVS -exec rm -rf {} \; >/dev/null 2>&1 |
| find $1 -type f -name .#\* -exec rm -f {} \; >/dev/null 2>&1 |
| } |
| |
| # $1 = file_pattern |
| # $2 = From dir |
| StripFiles() |
| { |
| if [ -d "$2" ]; then |
| local TMPFILE=$(mktemp -q /tmp/instlist.XXXXXX) |
| if [ $? -ne 0 ]; then |
| echo "Error:: Can't create temp file, exiting..." |
| exit 1 |
| fi |
| |
| cd $2 |
| find . -type f -name "$1" >$TMPFILE |
| for i in $(cat $TMPFILE); do |
| if [ -x $i ]; then |
| echo "Strip '$i'" |
| strip -s $i |
| fi |
| done |
| cd - |
| rm -f $TMPFILE |
| fi |
} |
} |