$OpenBSD: patch-common_snapshots_py,v 1.3 2011/09/15 06:54:41 ajacoutot Exp $

OpenBSD does not support extended attributes & ACLs.
Needs the "--link" option from gcp(1) for incremental backups.

--- common/snapshots.py.orig	Sun Jun  5 13:57:48 2011
+++ common/snapshots.py	Wed Sep 14 15:17:46 2011
@@ -561,14 +561,14 @@ class Snapshots:
 		#cmd = "chmod -R u+rwx \"%s\"" %  path
 		cmd = "find \"%s\" -type d -exec chmod u+wx {} \\;" % path #Debian patch
 		self._execute( cmd )
-		cmd = "rm -rfv \"%s\"" % path
+		cmd = "rm -rf \"%s\"" % path
 		self._execute( cmd )
 
 	def copy_snapshot( self, snapshot_id, new_folder ):
 		'''Copies a known snapshot to a new location'''
 		current.path = self.get_snapshot_path( snapshot_id )
 		#need to implement hardlinking to existing folder -> cp newest snapshot folder, rsync -aEAXHv --delete to this folder
-		cmd = "cp -dRl \"%s\"* \"%s\"" % ( current_path, new_folder )
+		cmd = "gcp -dRl \"%s\"* \"%s\"" % ( current_path, new_folder )
 		logger.info( '%s is copied to folder %s' %( snapshot_id, new_folder ) )
 		self._execute( cmd )
 
@@ -1092,7 +1092,7 @@ class Snapshots:
 			self._execute( "find \"%s\" -type d -exec chmod u+wx {} \\;" % prev_snapshot_path ) #Debian patch
 
 			#clone snapshot
-			cmd = "cp -aRl \"%s\"* \"%s\"" % ( prev_snapshot_path, new_snapshot_path_to )
+			cmd = "gcp -aRl \"%s\"* \"%s\"" % ( prev_snapshot_path, new_snapshot_path_to )
 			self.append_to_take_snapshot_log( '[I] ' + cmd, 3 )
 			cmd_ret_val = self._execute( cmd )
 			self.append_to_take_snapshot_log( "[I] returns: %s" % cmd_ret_val, 3 )
@@ -1141,7 +1141,7 @@ class Snapshots:
 		#backup config file
 		logger.info( 'Save config file' )
 		self.set_take_snapshot_message( 0, _('Save config file ...') )
-		self._execute( 'cp %s %s' % (self.config._LOCAL_CONFIG_PATH, new_snapshot_path_to + '..') )
+		self._execute( 'gcp %s %s' % (self.config._LOCAL_CONFIG_PATH, new_snapshot_path_to + '..') )
 		
 		#save permissions for sync folders
 		logger.info( 'Save permissions' )
