Re: [opensuse-packaging] Check for KDE SC version inside SPEC files
On 15/01/11 13:15, Matthias Fehring wrote:
Am Freitag, 14. Januar 2011, 19:18:32 schrieb Tejas Guruswamy:
The original macro failed just because the output from kde4-config changed format slightly with the KDE rebranding.
I've been using this one in my spec files for a while
%define kde4_version %(/usr/bin/kde4-config --version | sed -r '/KDE.*:/! { d }; { s/KDE.*: (([0-9]+)\\.([0-9]+)\\.([0-9]+)) .*/\\2\\3\\4/g }')
Works on all KDE versions I've seen.
Regards, Tejas
When I try this in terminal I get the following:
KDE: 4.9.95 (4.6 RC2)
I would expect something like
4995
I am only a novice in sed... ;-)
Best Greetings Matthias
The macro I gave has extra escapes to work inside the spec file. To test it in the terminal use only one backslash ('\' instead of '\\') everywhere. And make sure it's all on one line. Regards, Tejas -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Am Samstag, 15. Januar 2011, 17:03:49 schrieb Tejas Guruswamy:
On 15/01/11 13:15, Matthias Fehring wrote:
Am Freitag, 14. Januar 2011, 19:18:32 schrieb Tejas Guruswamy:
The original macro failed just because the output from kde4-config changed format slightly with the KDE rebranding.
I've been using this one in my spec files for a while
%define kde4_version %(/usr/bin/kde4-config --version | sed -r '/KDE.*:/! { d }; { s/KDE.*: (([0-9]+)\\.([0-9]+)\\.([0-9]+)) .*/\\2\\3\\4/g }')
Works on all KDE versions I've seen.
Regards, Tejas
When I try this in terminal I get the following:
KDE: 4.9.95 (4.6 RC2)
I would expect something like
4995
I am only a novice in sed... ;-)
Best Greetings Matthias
The macro I gave has extra escapes to work inside the spec file. To test it in the terminal use only one backslash ('\' instead of '\\') everywhere.
And make sure it's all on one line.
Regards, Tejas
Ah, ok, now it works. Thank you all. :) Regards Matthias -- Das Gesetz hat zum Schneckengang verdorben, was Adlerflug geworden wäre. (Friedrich Schiller - Die Räuber) Und der Buschfunk spielt gerade "Creepy" von "Lagwagon".
participants (2)
-
Matthias Fehring
-
Tejas Guruswamy