Tom
|
Re:Script for using bundles in subversion - 2006/08/09 15:07
OK last one. This now works for bundles with spaces in their names as well as ful paths with spaces. Sorry but I don't usually do perl. Here's the DIFF:
| Code: |
--- /Users/tbrice/bin/update_bundle.pl 2006-07-20 06:20:02.000000000 -0500
+++ /Users/tbrice/bin/update_bundle_new.pl 2006-08-09 16:53:19.000000000 -0500
@@ -35,25 +35,25 @@
# remove and backup - do some error checking here so that if we screw up later we still have a
backup
unlink $tarball;
if ( -e $tarball ) { die "Unable to remove backup tar $tarball"; }
-`tar cPzf $tarball $bundle_dir`; # backup
+print `tar cPzf "$tarball" "$bundle_dir"`; # backup
if ( ! -e $tarball ) { die "Unable to create backup tar $tarball"; }
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|grep -v .svn|xargs rm`; # get rid of all the files
-`tar xPzf $tarball`; # restore files
-open SVN_ST, "svn st $bundle_dir|";
+`rm -rf "$bundle_dir"`; # nuke
+`svn up "$bundle_dir"`; # recreate directory structure with .svn dirs
+`find "$bundle_dir" -type d -name .svn -prune -o -type f -print0 | xargs -0 rm`; # get rid of all the files excpet .svn directories
+`tar xPzf "$tarball"`; # restore files
+open SVN_ST, "svn st '$bundle_dir'|";
while (<SVN_ST>)
{
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'`;
}
}
|
|