summaryrefslogtreecommitdiff
path: root/sysutils/pdumpfs-rsync/files/patch-pdumpfs-rsync
blob: bae6b030c3a2f9813fa6123b3055462d273b21ba (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--- pdumpfs-rsync.orig	Mon Dec 26 12:31:35 2005
+++ pdumpfs-rsync	Mon Dec 26 12:33:21 2005
@@ -15,7 +15,7 @@
 # the GNU General Public License version 2.
 #
 
-load '/usr/bin/pdumpfs'
+load File.join(File.dirname(__FILE__), 'pdumpfs')
 require 'ftools'
 require 'getoptlong'
 
@@ -128,8 +128,10 @@
     end
   end
 
-  latest = latest_snapshot(src, dest, base)
-  today  = File.join(dest, datedir(Date.today), base)
+  start_time = Time.now
+  pdumpfs = Pdumpfs::Pdumpfs.new(opts)
+  latest = pdumpfs.latest_snapshot(start_time, src, dest, base)
+  today = File.join(dest, pdumpfs.datedir(Date.today), base)
   rsync_array = rsync_array + rsync_opts
   rsync_array.push(ARGV[0].sub(%r!/+$!, '') + '/')
   rsync_array.push(src + '/')
@@ -141,7 +143,7 @@
     if ( $? >> 8 != 0 )
       STDERR.print "WARNING: rsync failed: #{ARGV[0]}; exit value: #{$? >> 8}\n"
     end
-    update_snapshot(src, src, today, matcher)
+    pdumpfs.update_snapshot(src, src, today, matcher)
   else
     STDERR.print "rsync failed: #{ARGV[0]}; exit value: #{$? >> 8}\n"
     exit $? >> 8