5 echo "Create plain patch list from list-XXX and XXX.spec"
6 echo "Usage: -l|--list_file <LIST_FILE> "
7 echo " -s|--spec_file <SPEC_FILE>"
8 echo " -p|--prefix <PREFIX_PATH> patch prefix"
12 while [ $# -gt 0 ]; do
38 list_dir
=`dirname $list_file`
40 spec_dir
=`dirname $spec_file`
41 out_patch_dir
=$prefix_dir/patches
42 out_vzmod_dir
=$prefix_dir/vzmod
44 if [ ! -f "$list_file" ]; then
45 echo "No such list $list_file"
49 if [ ! -f "$spec_file" ]; then
50 echo "No such spec $spec_file"
54 function cat_list_file
59 cat "$lfile" |
grep -v '^[:space:]*$' | \
60 while read patch rest
; do
61 echo $patch |
grep '^[:space:]*#' && {
65 if [ "$patch" = "include" ]; then
67 cat_list_file
"$ldir" "$ldir/$rest" "$odir"
71 if [ "$patch" = "cd" ]; then
75 if [ "$patch" = "merge" ]; then
83 function cat_spec_file
{
88 odir_scr
="$(echo $odir | sed -r 's/\//\\\//g')"
91 if ($0 ~ /# Start VZ patches/) lock=0;\
92 if (lock==0) print $0;\
93 if ($0 ~ /# End VZ patches/) lock=1 ;\
95 sed -r "s/^Patch[0-9]+:[[:space:]]+/$odir_scr\//" | \
96 grep -v "^$odir/patch-%{ovzver}-core"| \
97 grep -v "^$odir/patch-%{ovzver}-mod"
99 echo "update-uname-core-begin"
100 cat_list_file
$list_dir $list_file $out_patch_dir
101 echo "update-uname-mod-begin"
102 cat_spec_file
$spec_dir $spec_file $out_vzmod_dir
103 echo "update-uname-mod-end"