Mailinglist Archive: opensuse-packaging (250 mails)

< Previous Next >
Re: [opensuse-packaging] adding with sed?
  • From: David Haller <opensuse@xxxxxxxxxx>
  • Date: Wed, 12 Aug 2009 14:52:04 +0200
  • Message-id: <20090812125204.GA30069@xxxxxxxxxxxxxxxxxx>
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@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-packaging+help@xxxxxxxxxxxx

< Previous Next >