2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: misc/target/functions.in
4 # Copyright (C) 2004 - 2023 The T2 SDE Project
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License version 2.
11 # --- T2-COPYRIGHT-NOTE-END ---
13 # copy, with special files
15 copy_with_list_from_file
() {
16 ( cd $1; tar cSp
--no-recursion --files-from=$3 ) |
18 ( x
=`wc -l`; echo "$x files transfered." )
21 # copy out of T2 source without .svn files
25 # the sed is a work around for a find issue, outputting empty rows
26 # in some versions ...
27 find $1 -name '.svn' -prune -o -printf "%P\n" |
sed '/^$/d' > $list
29 copy_with_list_from_file
$1 $2 $list
34 # copy out of T2 source without .svn files and does honor special files to
35 # apply patches, change owner:group or permissions
37 copy_and_parse_from_source
() {
38 # the sed is a work around for a find issue, outputting empty rows
39 # in some versions ...
40 find $1 -name '.svn' -prune -o -printf "%P\n" |
sed '/^$/d' |
sort |
42 if [ -h $1/$file ]; then
43 #echo "Symlink: $file"
44 cp -afv $1/$file $2/$file
45 elif [ -d $1/$file ]; then
50 if [[ $cmd = \
#\![a-y]* ]]; then
53 #echo "Code $code Command: $cmd File: $file"
54 args
=`echo $cmd | wc -w`
58 pushd $2/$dirname > /dev
/null
#; set -x
61 if [ $args -le 3 ]; then
67 if [ $args -le 2 ]; then
72 patch) patch -f < $1/$file
74 *) echo "Code: $code unknown"; exit 1 ;;
77 elif [[ $cmd = \
#\!* ]]; then
79 cp -afv $1/$file $2/$file
83 cp -afv $1/$file $2/$file
89 # link indentical files to save space
90 link_identical_files
() {
93 if [ "$oldck" = "$ck" -a -s $fn ]; then
94 echo "\"$fn -> $oldfn\""
99 done < <( find -type f |
xargs md5sum |
sort )
100 ) |
( x
=`wc -l`; echo "$x links created." )