ZigZig Forums  


::post new topic::
<< Start < Prev 1 2 Next > End >>
Script for using bundles in subversion - 2006/07/20 04:23 If you've tried using bundles in ZigVersion(pages and keynotes documents, for instance), you probably noticed it gave you a terrible error. Subversion does not play nicely with bundles, and therefore ZigVersion so far does not play nicely with bundles. Well, that sucks. I've created a script for people to try out to make bundles work. Use at your own risk
Download here

tar xzvf update_bundle.tar.gz ### you'll get update_bundle.pl
chmod +x update_bundle.pl
maybe copy it somewhere useful like /usr/local/bin...

You can now run this at the command line as "update_bundle.pl bundle_directory", and it will attempt to do all the right steps to get your bundle directory ready for checking in. I've tested this out a bit on two different pages bundles, and it works so far Let me know how this works out for anyone that tries it. This is the first step in getting bundle support into ZigVersion.
  reply | quote
Re:Script for using bundles in subversion - 2006/07/20 11:51 Fantastic.

I had just been about to get around to telling you about this problem, despite being confident it was a subversion probably rather than a ZigVersion problem. I appreciate your going above and beyond by, in effect, attempting to give ZigVersion a file-handling capability beyond that of subversion at the present moment.

I will let you know how this works for me (I have iWeb, Pages, and Keynote bundles that have been driving me nuts whether I try to manage them through ZigVersion (preferred!!!) or through the CLI)).
  reply | quote
Re:Script for using bundles in subversion - 2006/08/09 11:13 eriks,
thanks for posting this. I have been looking at ZigVersion recently and found you script. This is an area where Subversion really falls down for mac developers.

I write and maintain about 30 applescripts. I put them in Subversion for my own sanity. Currently I commit 2 versions of each file - a non bundle and a text version (for easier DIFFs) - if I could get bundles to work things might be different.

Anyway. your script appears to work well but I'm getting an error an error with the "svn rm" and "svn add" lines at the very end of the script. They do not handle files or dirs in the bundle that have spaces in them. Is there a way to quote/escape those paths?

Anyway, thanks for the script. ZigVersion looks to be coming along nicely too.
  reply | quote
Re:Script for using bundles in subversion - 2006/08/09 11:48 Actually it looks to be the 'xargs' line...
  reply | quote
Re:Script for using bundles in subversion - 2006/08/09 12:05 OK I changed the offending line to this (basically added the -print0 option and the -0 flag)
Code:

 `find $bundle_dir -type f -print0|grep -v .svn|xargs -0 rm`; # get rid of all the files



So it works now but it never matches anything in the 'while' loop to remove missings files and/or add unversioned files.
  reply | quote
Re:Script for using bundles in subversion - 2006/08/09 13:32 OK I think I've got this working. I had to rework the 'find' line and args for the final svn commands. Here's the DIFF:

Code:

  --- /Users/tbrice/bin/update_bundle.pl    2006-08-09 13:57:31.000000000 -0500 +++ /Users/tbrice/bin/update_bundle_new.pl    2006-08-09 15:26:18.000000000 -0500 @@ -40,+40,@@  print "nBackup tar named $tarballnn";  `rm -rf $bundle_dir`; # nuke  `svn up $bundle_dir`; # recreate directory structure with .svn dirs -`find $bundle_dir -type f -print0|grep -v .svn|xargs -0 rm`; # get rid of all the files +`find $bundle_dir -type d -name .svn -prune -o -type f -print0 | xargs -0 rm`; # get rid of all the files   `tar xPzf $tarball`; # restore files  open SVN_ST"svn st $bundle_dir|";  while (<SVN_ST>) @@ -48,12 +48,12 @@      if ( /^!s+(.*)/ ) # missing files      {          print "removing $1n"; -        `svn rm $1`; +        `svn rm '$1'`;      }      if ( /^?s+(.*)/ ) # unversioned files      {          print "adding $1n"; -        `svn add $1`; +        `svn add '$1'`;      }  }  

  reply | quote
<< Start < Prev 1 2 Next > End >>
::post new topic::