[opensuse-packaging] adding with sed?
Hello Mates, i would like to add this in the End of libs/toolkit/objects/tkSettings.cpp: if (QDir("/usr/lib64/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib64/qt4/plugins" ) ); else if (QDir("/usr/lib/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib/qt4/plugins" ) ); Can i do this with sed? -- Sincerely yours Sascha Manns openSUSE Ambassador openSUSE Marketing Team openSUSE Build Service Web: http://saschamanns.gulli.to Project-Blog: http://lizards.opensuse.org/author/saigkill Private-Blog: http://saschasbacktrace.blogspot.com -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
On 8/12/2009 at 10:43, "Sascha 'saigkill' Manns"
wrote: Hello Mates, i would like to add this in the End of libs/toolkit/objects/tkSettings.cpp: if (QDir("/usr/lib64/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib64/qt4/plugins" ) ); else if (QDir("/usr/lib/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib/qt4/plugins" ) ); Can i do this with sed?
Hi,
Just for 'adding' those exact lines at the end of the file? I think sed is a bit over the top for this.
Simply use cat:
## example ##
cat >> libs/toolkit/objects/tkSettings.cpp <
Am Mittwoch 12 August 2009 10:51:19 wrote Dominique Leuenberger:
On 8/12/2009 at 10:43, "Sascha 'saigkill' Manns"
wrote:
Hello Mates,
i would like to add this in the End of libs/toolkit/objects/tkSettings.cpp: if (QDir("/usr/lib64/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib64/qt4/plugins" ) ); else if (QDir("/usr/lib/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib/qt4/plugins" ) ); Can i do this with sed?
Hi,
Just for 'adding' those exact lines at the end of the file? I think sed is a bit over the top for this. Simply use cat: ## example ## cat >> libs/toolkit/objects/tkSettings.cpp <
m_Enum_Path.insert( QtPlugInsPath,"/usr/lib64/qt4/plugins" ) ); else if (QDir("/usr/lib/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib/qt4/plugins" ) ); EOF ## end example ## Cool. Thanks for the hint :-)
-- Sincerely yours Sascha Manns openSUSE Ambassador openSUSE Marketing Team openSUSE Build Service Web: http://saschamanns.gulli.to Project-Blog: http://lizards.opensuse.org/author/saigkill Private-Blog: http://saschasbacktrace.blogspot.com -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
Hello, On Wed, 12 Aug 2009, Sascha 'saigkill' Manns wrote:
i would like to add this in the End of libs/toolkit/objects/tkSettings.cpp: if (QDir("/usr/lib64/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib64/qt4/plugins" ) ); else if (QDir("/usr/lib/qt4/plugins").exists()) d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib/qt4/plugins" ) ); Can i do this with sed?
Sure. Untested: sed -i -e ' $ # address the end of the file a\ if (QDir("/usr/lib64/qt4/plugins").exists())\ d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib64/qt4/plugins" ) );\ else if (QDir("/usr/lib/qt4/plugins").exists())\ d->m_Enum_Path.insert( QtPlugInsPath,"/usr/lib/qt4/plugins" ) ); ' libs/toolkit/objects/tkSettings.cpp Please test locally first. -dnh [1] I'm not into Qt, no idea if that string concat would work, it works with an #defined string (QString(ASSUMA_DATADIR"/data") ;). Using 2 QStrings and concatenating those should work. -- SprintLINK makes proton decay look fast. -- Jude Charles Giampaolo -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-packaging+help@opensuse.org
participants (3)
-
David Haller
-
Dominique Leuenberger
-
Sascha 'saigkill' Manns