Hello, on Freitag, 23. Oktober 2009, Cristian Morales Vega wrote:
Sometimes I find a package with a long changelog that has always lived directly in the .spec file. I would like to continue the changelog in a .changes file... but how should I convert all the existing entries?
Use sed ;-) LANG=C rpm -q --changelog aaa_base |head -n30 | \ sed '1,/^%changelog/ d ; s§^* (...) (...) ([0-3][0-9]) ([12][0-9][0-9][0-9]) (.*)§-------------------------------------------------------------------\n\1 \2 \3 12:34:56 CET \4 - \5\n§' If you want to run it against a spec file, add another sed command: sed '1,/^%changelog/ d' (running both in one sed command works also, of course) LANG=C is used to enforce english weekday names - otherwise rpm translates them to $LANG (not needed when parsing a specfile directly). Known issues: - The time and timezone are not listed in the spec, therefore a dummy is used. - the sed command will fail for years > 2999 ;-) because of the "[12]" part (which ensures that at least very broken dates get filtered out) To make sure everything went right, grep '^*' in the resulting .changes file (it shouldn't find anything). BTW: I license the above sed command as GPL v2 or later so that it is compatible with the build package ;-) Regards, Christian Boltz -- Also, ich hab mit win3.11 (damals war ich 2 jahre alt) angefangen und hab dann alle Win-versionen erlebt, bis xp. Das war entgültig zuviel. Danach war Schluss. Jetzt nur noch SuSE Linux. [Soeren Wengerowsky in suse-linux] -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org