• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Info.plist preprocessing in single-file tool? [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Info.plist preprocessing in single-file tool? [SOLVED]


  • Subject: Re: Info.plist preprocessing in single-file tool? [SOLVED]
  • From: Philip Aker <email@hidden>
  • Date: Mon, 9 Mar 2009 13:21:40 -0700

On 2009-03-09, at 01:40:32, Nathan Ramella wrote:

Here's an example of Plistbuddy using -c. Under my targets for a kernel module I added a 'Run Script' command like this:

/usr/libexec/PlistBuddy -c "set OSBundleLibraries:com.apple.kernel `uname -r`" Info.plist

This will modify to plist entry so that 'ANYTHING' is replaced with the currently running kernel version for your system. I'm sure kext developers will shudder at that technique, but I got tired of having to hand fix it across the multiple kernel versions I test against. Something with 'sed' or XML parsing will do the same thing, but I wanted to try doing it 'The Apple' way using their provided tools to see if it would be possible.

<key>OSBundleLibraries</key>
	 <dict>
               <key>com.apple.kernel</key>
               <string>ANYTHING</string>
       </dict>

Thanks Nathan,

I was creating a test plist in Terminal with 'defaults' like so:

$ DIR=`pwd`
$ defaults write $DIR/some OSBundleLibraries -dict-add com.apple.kernel ANYTHING


which creates a binary property list and I didn't release that PlistBuddy can't handle binary plists. If I convert the plist to XML:

$ plutil -convert xml1 some.plist

then things work.

There is one caveat, it doesn't always update/run the script for some reason, I'm guessing mtime of the target plist. But if you make clean, make, it works 100% -- it might work 100% if there's enough time between makes as well but no promises from me.


I don't have this problem anymore because I now use separate (and dependent) targets for scripts which have determinant output for higher level targets.


Philip Aker echo email@hidden@nl | tr a-z@. p-za-o.@

Democracy: Two wolves and a sheep voting on lunch.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Re: Info.plist preprocessing in single-file tool? [SOLVED] (From: Karl Moskowski <email@hidden>)
 >Re: Info.plist preprocessing in single-file tool? [SOLVED] (From: Philip Aker <email@hidden>)
 >Re: Info.plist preprocessing in single-file tool? [SOLVED] (From: Nathan Ramella <email@hidden>)

  • Prev by Date: Re: Cross Platform Dev List
  • Next by Date: Distributed build OS Build incompatibilities..
  • Previous by thread: Re: Info.plist preprocessing in single-file tool? [SOLVED]
  • Next by thread: Applying number formatter to table view column - newbie question?
  • Index(es):
    • Date
    • Thread