#!/usr/bin/env bash # --- T2-COPYRIGHT-NOTE-BEGIN --- # T2 SDE: scripts/Create-FlatPriPatch # Copyright (C) 2004 - 2023 The T2 SDE Project # # This Copyright note is generated by scripts/Create-CopyPatch, # more information can be found in the files COPYING and README. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2. # --- T2-COPYRIGHT-NOTE-END --- tempfile=`mktemp` function create_pkg_patch() { local pkg=$1 local priority=$2 sed -e 's,^\(\[P\] .* \)[0-9\.][0-9\.]*$,\1'$priority',' \ < package/$pkg/${pkg#*/}.desc > $tempfile diff -u ./package/$pkg/${pkg#*/}.desc $tempfile } pkg="$1" ; shift if [ "$pkg" ]; then for other ; do other_desc=$(echo package/*/$other/$other.desc) [ -e "$other_desc" ] || continue counter=$(sed -n 's,^\(\[P\] .* \)\([0-9\.][0-9\.]*$\),\2,p' $other_desc) counter=${counter%??} counter=${counter/./} ((counter++)) counter="${counter%?}.${counter#???}00" create_pkg_patch $pkg $counter exit done else counter=1000 for pkg in $(scripts/Create-PkgList "$@" | cut -f4,5 -d' ' | tr ' ' /) do xcounter="${counter%?}.${counter#???}00" case $pkg in *t2-debug) xcounter=999.900 ;; *t2-src) xcounter=999.800 ;; *99-final) xcounter=999.999 ;; esac create_pkg_patch $pkg $xcounter ((counter++)) done fi