Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

A script to handle bundles within Subversion Apps
I keep everything I can in Subversion; it's one of the practices of a successful programmer. The Mac, though, makes things a bit tricky: Mac OS X bundles are in an ambiguous space between files and directories. To Subversion, they are directories whose contents are individually managed. That means .svn folders everywhere. To Mac applications, they are single files, to be rewritten at will (wiping out all those critical .svn folders). My approach has been to archive the bundle and check in the archive, marking the bundle itself as svn:ignore.

Doing this manually is a challenge, especially because you only want to re-archive a bundle if the contents of the bundle folder have changed. My solution uses a Ruby script to find bundles that need archiving and then invokes tar to do the actual work. More details are available in this entry on my blog.

[robg adds: I've mirrored the script here on macosxhints, but you should check the original posting for any updates. I have not tested this one.]
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[5,416 views]  

A script to handle bundles within Subversion | 1 comments | Create New Account
Click here to return to the 'A script to handle bundles within Subversion' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
A script to handle bundles within Subversion
Authored by: jerry_quart on Sep 20, '07 08:30:25AM

Nice script, thanks for posting! I would change only a few things ;-)

1. The script was running on my Mac only by extending the first line:
#!/usr/bin/ruby -w

2. If a path or bundle-name contains spaces the 'system' call will brake. Better to quote it:
system "tar --create --file='#{archive}' --bzip2 --directory='#{dir}' '#{bundle}'"

3. In my opinion using this script only makes sense if you remove the original bundle from the folder:
system "[ -d '#{dir}/#{bundle}' ] && rm -Rf '#{dir}/#{bundle}' || echo 'Failed to remove bundle!'"

4. For developers it would make sense to extend the extensions:
$extensions = %w{pages key oo3 graffle xcodeproj pbproj nib app}

jerry



[ Reply to This | # ]