![](https://seccdn.libravatar.org/avatar/3a86c070fa777ba1d186d99f57f97042.jpg?s=120&d=mm&r=g)
Stephan Kulow <coolo@suse.de> writes:
I fixed this for the pre_checkin.sh in bundle-lang-common now in having a little perl script that I call like this:
perl update_spec.pl oldfile attributes > newfile
this reads Summary, Description, Group and License out of the attributes file and updates the spec file. The attributes file I created from pdb content.
Because I'm not that good with querying the pdb, here are some awk bits to create the attributes file from the old spec file (multi-line processing is not perfect...): awk -f create-attr.awk *.spec > attributes /^Name:/ { name=$2 nname = name next} in_desc == 1 && /^%/ { in_desc = 0 sub (/^ */, "", line) printf ("+description.%s\n",nname) print line printf ("-description.%s\n",nname) line = "" } in_desc == 1 { line = line " " $0 next } /^%description/ { in_desc = 1 next } /^%package/ { if ( $2 == "-n" ) nname = $3 else nname = name "-" $2 next } /^Group:/ { group = $2 printf ("group.%s %s\n", nname,group) next } /^License:/ { sub(/License:/, "", $0) printf ("license.%s %s\n", nname,$0 ) next} /^Summary:/ { sub(/Summary:/, "", $0) printf ("summary.%s %s\n", nname,$0 ) next} -- Karl Eichwalder R&D / Documentation SUSE LINUX Products GmbH, GF: Markus Rex, HRB 16746 (AG Nuernberg)