2 # --- T2-COPYRIGHT-BEGIN ---
4 # Copyright (C) 2004 - 2025 The T2 SDE Project
5 # SPDX-License-Identifier: GPL-2.0
6 # --- T2-COPYRIGHT-END ---
20 -u|
-untested) untested
=1 ;;
32 [ ! -e "$1" -a -e `echo package/*/$1` ] &&
33 x
=`echo package/*/$1` || x
="$1"
34 locations
="$locations $x"
40 if [ -z "$locations" ]; then
41 echo "Usage $0 [ -cache ] [ -fold ] package | files"
53 # save out [T], fold and insert with appropriate newlines
54 sed -n '/\[T\] \(.*\)/{s//\1/; H}; ${x; s/\n/ /g; s/^ //; p}' "$1" |
55 fold -w 76 -s |
sed 's/^/[T] /; s/ */ /g; s/ $//' > x
56 sed "/^\[I\].*/{ s//&\n/; r x
57 }; /^\[T\]/d" $1 |
sed '/^$/{n;/^$/d}' > x
.2
62 trap 'echo "Got SIGINT (Ctrl-C)."; exit 1' INT
64 # Copy .caches if requested and changed significantly
67 for p
in $locations; do
68 [[ $p != *package
/*/* ]] && continue
71 d
=$
(echo package
/*/$p)
73 if [ -e $d/$p.cache
-a -e $root/var
/adm
/cache
/$p ]; then
74 # changes of DEP/OPT content, if not enforced
75 changes
=$
(diff -u $d/$p.cache
$root/var
/adm
/cache
/$p |
sed -n '/^[+-]\[...\]/p' |
wc -l)
76 [ $changes -le 1 -a $cache -lt 2 ] && continue
78 cp -vf $root/var
/adm
/cache
/$p $d/$p.cache
82 # CopyPatch and Checksum and CkSumPatch
84 svn st
$locations |
grep '^\(A\|M\)' | cut
-c8- |
while read f
; do
86 scripts
/Create-CopyPatch
$f |
patch -p0
87 if [[ $f = *.desc
]]; then
88 [ "$fold" ] && fold_desc
$f
89 if grep '\[D\] \+0 \+' $f; then
90 pkg
=${f%.desc} pkg
=${pkg##*/}
91 scripts
/Create-CkSumPatch
$pkg |
patch -p0
97 visualize_warnings
() {
98 # do not highlight just single space diff lines
100 s/\([[ \r\t]]*\)$/\o033[0;41m\1\o033[0m/
101 s/\( *\)/\o033[0;41m\1\o033[0m/
106 svn
diff $locations |
tee $$.
diff | visualize_warnings
108 # the grep -v === is a hack - somehow the svn === lines confuse awk ... ?!?
109 grep -v === $$.
diff | gawk
"
110 BEGIN { FS=\"[ /]\" }
112 /^\+\+\+ / { pkg = \$4 }
113 { if (sub(/^\+\[I\]/,\" -\") ) { info = \$0 } }
115 /^\-\[V\] / { oldver=\$2 }
119 print \"\t* updated \" pkg \" (\" oldver \" -> \" newver \")\"
121 print \"\t* added \" pkg \" (\" newver \")\" info
123 oldver=\"\"; newver=\"\"; info=\"\"
126 /^\-\[P\] / { oldprio=\$4 }
130 print \"\t* changed \" pkg \" build priority (\" oldprio \" -> \" newprio \")\"
131 oldprio=\"\"; newprior=\"\"
136 [ "$untested" ] && sed -i -z 's/\n$/, untested\n/g' $$.log
138 [ "$addtxt" ] && sed -i "\$s|\$|$addtxt|" $$.log
141 svn commit
$svnopt $locations --file $$.log ||
exit $?
144 if [ -s $$.
diff ]; then
146 until [ $quit -ne 0 ]; do
149 if [ -s $$.log
]; then
153 echo -e "\tEmpty Log File!"
157 echo -en "\nLog ok (q=quit,e=edit,d=diff,s=status$commit)? "
158 [ ! "$force" ] && read in ||
in="commit"
161 c
*) if [ -n "$commit" ]; then
164 d
*) cat $$.
diff | visualize_warnings |
less -R ;;
165 s
*) svn st
$locations ;;
166 e
*) ${EDITOR:-vi} $$.log
;;
172 echo -e "\nNo changes detected at:$locations"