* updated kompare (21.12.1 -> 21.12.2), untested
[t2-trunk.git] / scripts / Create-FlatPriPatch
blob323615914bc5036d4d2bfde6e463d486e10c8e66
1 #!/bin/bash
2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # T2 SDE: scripts/Create-FlatPriPatch
4 # Copyright (C) 2004 - 2021 The T2 SDE Project
5 #
6 # This Copyright note is generated by scripts/Create-CopyPatch,
7 # more information can be found in the files COPYING and README.
8 #
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 tempfile=`mktemp`
15 function create_pkg_patch() {
16 local pkg=$1
17 local priority=$2
18 sed -e 's,^\(\[P\] .* \)[0-9\.][0-9\.]*$,\1'$priority',' \
19 < package/$pkg/${pkg#*/}.desc > $tempfile
20 diff -u ./package/$pkg/${pkg#*/}.desc $tempfile
23 pkg="$1" ; shift
25 if [ "$pkg" ]; then
26 for other ; do
27 other_desc=$(echo package/*/$other/$other.desc)
28 [ -e "$other_desc" ] || continue
29 counter=$(sed -n 's,^\(\[P\] .* \)\([0-9\.][0-9\.]*$\),\2,p' $other_desc)
30 counter=${counter%??}
31 counter=${counter/./}
32 (( counter++ ))
33 counter="${counter%?}.${counter#???}00"
34 create_pkg_patch $pkg $counter
35 exit
36 done
37 else
38 counter=1000
39 for pkg in $( scripts/Create-PkgList "$@" | cut -f4,5 -d' ' | tr ' ' / )
41 xcounter="${counter%?}.${counter#???}00"
42 case $pkg in
43 *t2-debug) xcounter=999.900 ;;
44 *t2-src) xcounter=999.800 ;;
45 *99-final) xcounter=999.999 ;;
46 esac
48 create_pkg_patch $pkg $xcounter
50 (( counter++ ))
51 done