From bdeb at willmore.eu Wed Mar 11 10:56:37 2009 From: bdeb at willmore.eu (Ben Willmore) Date: Wed, 11 Mar 2009 14:56:37 +0000 Subject: [Unison-hackers] tiny patch Message-ID: I don't know my SVN password any more (or whether it would be appropriate to use it). So here is a tiny patch which makes 'make clean' work better by removing 'Info.plist' which is generated from a template when Unison is built. Ben Index: Makefile =================================================================== --- Makefile (revision 317) +++ Makefile (working copy) @@ -358,6 +358,7 @@ clean:: -(cd $(UIMACDIR); xcodebuild clean) -(cd $(UIMACDIR); $(RM) -r build ExternalSettings.xcconfig) + -(cd $(UIMACDIR); $(RM) Info.plist) endif checkin: From bdeb at willmore.eu Wed Mar 11 11:24:11 2009 From: bdeb at willmore.eu (Ben Willmore) Date: Wed, 11 Mar 2009 15:24:11 +0000 Subject: [Unison-hackers] ignore the last Message-ID: I see now that completely different things happen to Info.plist if you build from the command line or from Xcode... I can't figure it out. Ben From alan.schmitt at polytechnique.org Wed Mar 11 14:47:13 2009 From: alan.schmitt at polytechnique.org (Alan Schmitt) Date: Wed, 11 Mar 2009 19:47:13 +0100 Subject: [Unison-hackers] ignore the last In-Reply-To: References: Message-ID: <56BA3ED6-0D8E-4779-8878-D34410D538D9@polytechnique.org> On 11 mars 09, at 16:24, Ben Willmore wrote: > I see now that completely different things happen to Info.plist if you > build from the command line or from Xcode... I can't figure it out. This should not happen, as the command line call xcodebuild, which uses the same settings than Xcode. I can try helping you figure this out, as I think I'm the last person who tweaked that. Alan -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 195 bytes Desc: This is a digitally signed message part Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20090311/fffc3338/PGP.sig From bcpierce at seas.upenn.edu Thu Mar 12 22:38:03 2009 From: bcpierce at seas.upenn.edu (Benjamin C. Pierce) Date: Thu, 12 Mar 2009 22:38:03 -0400 Subject: [Unison-hackers] [unison-svn] r318 - trunk/src Message-ID: <200903130238.n2D2c3Nb023661@yaws.seas.upenn.edu> Author: bcpierce Date: 2009-03-12 22:38:02 -0400 (Thu, 12 Mar 2009) New Revision: 318 Modified: trunk/src/RECENTNEWS trunk/src/mkProjectInfo.ml trunk/src/uitext.ml trunk/src/update.ml Log: * Text UI now includes the current time in its completion message * Fix a small bug that was affecting mainly windows users. We need to commit the archives at the end of the sync even if there are no updates to propagate because some files (in fact, if we've just switched to DST on windows, a LOT of files) might have new modtimes in the archive. (Changed the text UI only. It's less clear where to change the GUI.) * Small improvement to text UI "scanning..." messages, to print just directories (hopefully making it clearer that individual files are not necessarily being fingerprinted). Modified: trunk/src/RECENTNEWS =================================================================== --- trunk/src/RECENTNEWS 2009-02-13 15:20:07 UTC (rev 317) +++ trunk/src/RECENTNEWS 2009-03-13 02:38:02 UTC (rev 318) @@ -1,3 +1,20 @@ +CHANGES FROM VERSION 2.32.4 + +* Text UI now includes the current time in its completion message + +* Fix a small bug that was affecting mainly windows users. We need to + commit the archives at the end of the sync even if there are no + updates to propagate because some files (in fact, if we've just + switched to DST on windows, a LOT of files) might have new modtimes + in the archive. (Changed the text UI only. It's less clear where + to change the GUI.) + +* Small improvement to text UI "scanning..." messages, to print just + directories (hopefully making it clearer that individual files are + not necessarily being fingerprinted). + + +------------------------------- CHANGES FROM VERSION 2.32.2 * Don't delete the temp file when a transfer fails due to a Modified: trunk/src/mkProjectInfo.ml =================================================================== --- trunk/src/mkProjectInfo.ml 2009-02-13 15:20:07 UTC (rev 317) +++ trunk/src/mkProjectInfo.ml 2009-03-13 02:38:02 UTC (rev 318) @@ -101,3 +101,4 @@ + Modified: trunk/src/uitext.ml =================================================================== --- trunk/src/uitext.ml 2009-02-13 15:20:07 UTC (rev 317) +++ trunk/src/uitext.ml 2009-03-13 02:38:02 UTC (rev 318) @@ -492,11 +492,14 @@ let trans = updatesToDo - failures in let summary = Printf.sprintf - "Synchronization %s (%d item%s transferred, %d skipped, %d failure%s)" + "Synchronization %s at %s (%d item%s transferred, %d skipped, %d failed)" (if failures=0 then "complete" else "incomplete") + (let tm = Util.localtime (Util.time()) in + Printf.sprintf "%02d:%02d:%02d" + tm.Unix.tm_hour tm.Unix.tm_min tm.Unix.tm_sec) trans (if trans=1 then "" else "s") skipped - failures (if failures=1 then "" else "s") in + failures in Trace.log (summary ^ "\n"); if skipped>0 then Safelist.iter @@ -509,14 +512,18 @@ Safelist.iter (fun p -> alwaysDisplayAndLog (" failed: " ^ (Path.toString p))) failedPaths; - (skipped > 0, failures > 0, failedPaths) - in - if updatesToDo = 0 then - (display "No updates to propagate\n"; - (skipped > 0, false, [])) - else if proceed=ProceedImmediately then + (skipped > 0, failures > 0, failedPaths) in + if updatesToDo = 0 then begin + display "No updates to propagate\n"; + (* BCP (3/09): We need to commit the archives even if there are + no updates to propagate because some files (in fact, if we've + just switched to DST on windows, a LOT of files) might have new + modtimes in the archive. *) + Update.commitUpdates (); + (skipped > 0, false, []) + end else if proceed=ProceedImmediately then begin doit() - else begin + end else begin displayWhenInteractive "\nProceed with propagating updates? "; selectAction (* BCP: I find it counterintuitive that every other prompt except this one Modified: trunk/src/update.ml =================================================================== --- trunk/src/update.ml 2009-02-13 15:20:07 UTC (rev 317) +++ trunk/src/update.ml 2009-03-13 02:38:02 UTC (rev 318) @@ -984,42 +984,61 @@ let immutablenot = Pred.create "immutablenot" ~advanced:true ("This preference overrides {\\tt immutable}.") -let bigFileLength = 10 * 1024 -let bigFileLengthFS = Uutil.Filesize.ofInt bigFileLength -let smallFileLength = 1024 -let fileLength = ref 0 -let t0 = ref 0. +(** Status display **) -(* Note that we do *not* want to do any status displays from the server - side, since this will cause the server to block until the client has - finished its own update detection and can receive and acknowledge - the status display message -- thus effectively serializing the client - and server! *) -let showStatusAddLength info = - if not !Trace.runningasserver then begin - let len1 = Props.length info.Fileinfo.desc in - let len2 = Osx.ressLength info.Fileinfo.osX.Osx.ressInfo in - if len1 >= bigFileLengthFS || len2 >= bigFileLengthFS then - fileLength := bigFileLength - else - fileLength := - min bigFileLength - (!fileLength + Uutil.Filesize.toInt len1 + Uutil.Filesize.toInt len2) - end +(* BCP (3/09) We used to try to be smart about showing status messages + at regular intervals, but people seem to find this confusing. + Let's replace all this with something simpler -- just show directories as + they are scanned... (but I'll leave the code in for now, in case we find + we want to restore the old behavior). *) +(* + let bigFileLength = 10 * 1024 + let bigFileLengthFS = Uutil.Filesize.ofInt bigFileLength + let smallFileLength = 1024 + let fileLength = ref 0 + let t0 = ref 0. -let showStatus path = - if not !Trace.runningasserver then begin - fileLength := !fileLength + smallFileLength; - if !fileLength >= bigFileLength then begin - fileLength := 0; - let t = Unix.gettimeofday () in - if t -. !t0 > 0.05 then begin - Trace.statusDetail ("scanning " ^ Path.toString path); - t0 := t + (* Note that we do *not* want to do any status displays from the server + side, since this will cause the server to block until the client has + finished its own update detection and can receive and acknowledge + the status display message -- thus effectively serializing the client + and server! *) + let showStatusAddLength info = + if not !Trace.runningasserver then begin + let len1 = Props.length info.Fileinfo.desc in + let len2 = Osx.ressLength info.Fileinfo.osX.Osx.ressInfo in + if len1 >= bigFileLengthFS || len2 >= bigFileLengthFS then + fileLength := bigFileLength + else + fileLength := + min bigFileLength + (!fileLength + Uutil.Filesize.toInt len1 + Uutil.Filesize.toInt len2) + end + + let showStatus path = + if not !Trace.runningasserver then begin + fileLength := !fileLength + smallFileLength; + if !fileLength >= bigFileLength then begin + fileLength := 0; + let t = Unix.gettimeofday () in + if t -. !t0 > 0.05 then begin + Trace.statusDetail ("scanning... got to " ^ Path.toString path); + t0 := t + end end end +*) + +let showStatus path = () +let showStatusAddLength info = () + +let showStatusDir path = + if not !Trace.runningasserver then begin + Trace.statusDetail ("scanning... " ^ Path.toString path); end +(* ------- *) + let symlinkInfo = Common.Previous (`SYMLINK, Props.dummy, Os.fullfingerprint_dummy, Osx.ressDummy) @@ -1079,7 +1098,7 @@ (Util.msg "archStamp is ctime (%f)" stamp; Util.msg " / info.ctime (%f)" info.Fileinfo.ctime) end; - Util.msg " / times: %f - %f - %b" + Util.msg " / times: %f = %f... %b" (Props.time archDesc) (Props.time info.Fileinfo.desc) (Props.same_time info.Fileinfo.desc archDesc); Util.msg " / lengths: %s - %s" @@ -1122,10 +1141,15 @@ (Os.fullfingerprint_to_string archDig) (Os.fullfingerprint_to_string newDigest)); if archDig = newDigest then begin - Some (ArchiveFile - (Props.setTime archDesc (Props.time info.Fileinfo.desc), - archDig, Fileinfo.stamp info, Fileinfo.ressStamp info)), - checkPropChange info archive archDesc + let newprops = Props.setTime archDesc (Props.time info.Fileinfo.desc) in + let newarch = + ArchiveFile + + (newprops, archDig, Fileinfo.stamp info, Fileinfo.ressStamp info) in + debugverbose (fun() -> + Util.msg " Contents match: update archive with new time...%f\n" + (Props.time newprops)); + Some newarch, checkPropChange info archive archDesc end else begin debug (fun() -> Util.msg " Updated file\n"); None, @@ -1203,6 +1227,7 @@ fspath path (archChi: archive NameMap.t) fastCheck : archive NameMap.t option * (Name.t * Common.updateItem) list * bool = + showStatusDir path; let t = Trace.startTimerQuietly (Printf.sprintf "checking %s" (Path.toString path)) in let skip = From rhardy at teledyne.com Fri Mar 20 13:11:46 2009 From: rhardy at teledyne.com (Robert Hardy) Date: Fri, 20 Mar 2009 13:11:46 -0400 (EDT) Subject: [Unison-hackers] PATCH: Bugfix unison -times support for directories In-Reply-To: <80FE369B-F5E4-454B-90EC-B248F3219536@cis.upenn.edu> References: <80FE369B-F5E4-454B-90EC-B248F3219536@cis.upenn.edu> Message-ID: Sorry it took so long to reply. It seems you are right, while this does work for the initial replication, if a file changes the parent's directory's modtime will be changed to the wrong time. Any idea how we can fix the -times option properly? # mkdir -p test1/test2 test1/test3 # cp -a /tmp/49c2fbf3855bd /tmp/7XEMQU.tmp /tmp/jar_cache27933.tmp /tmp/test1/test2 # ls -l /tmp/test1/test2 total 20 -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp -rw-r--r-- 1 rhardy rhardy 1047 Mar 15 13:33 jar_cache27933.tmp test2/ test3/ # cp -a /tmp/49c2fbf3855bd /tmp/7XEMQU.tmp /tmp/jar_cache27933.tmp /tmp/test1/test3 # ls -la /tmp/test1/test3 total 20 drwxr-xr-x 2 root root 152 Mar 20 12:50 ./ drwxr-xr-x 4 root root 96 Mar 20 12:49 ../ -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp -rw-r--r-- 1 rhardy rhardy 1047 Mar 15 13:33 jar_cache27933.tmp # touch /tmp/test1/test3 vortex:/tmp/test1 12:51 {0}# ls -la /tmp/test1 total 1 drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ drwxrwxrwt 17 root root 1344 Mar 20 12:51 ../ drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ vortex:/tmp 12:51 {0}# ls -la total 342 drwxrwxrwt 17 root root 1344 Mar 20 12:51 ./ drwxr-xr-x 25 root root 680 Mar 2 18:37 ../ -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf39ec83 -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbfa288a3 -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp drwxr-xr-x 2 rhardy rhardy 48 Mar 19 23:45 acroread_500_500/ -rw-r--r-- 1 root root 32227 Mar 11 23:44 alsa-info.txt drwxrwxrwt 2 root root 72 Mar 1 12:41 .font-unix/ drwx------ 3 rhardy rhardy 72 Mar 20 12:45 gconfd-rhardy/ srw-rw-rw- 1 root root 0 Mar 2 09:40 .gdm_socket= -rw------- 1 rhardy rhardy 117 Mar 20 12:45 .gdmYEH1QU drwxr-xr-x 2 rhardy rhardy 48 Mar 20 00:01 hsperfdata_rhardy/ drwxr-xr-x 2 root root 48 Mar 15 13:29 hsperfdata_root/ drwxrwxrwt 2 root root 112 Mar 20 12:45 .ICE-unix/ -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:32 jar_cache27926.tmp -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:32 jar_cache27927.tmp -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:32 jar_cache27929.tmp -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:32 jar_cache27930.tmp -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27932.tmp -rw-r--r-- 1 rhardy rhardy 1047 Mar 15 13:33 jar_cache27933.tmp -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27935.tmp -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:33 jar_cache27936.tmp -rw-r--r-- 1 rhardy rhardy 65598 Mar 15 13:33 jar_cache27937.tmp -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27938.tmp -rw-r--r-- 1 rhardy rhardy 1046 Mar 15 13:33 jar_cache27939.tmp -rw-r--r-- 1 rhardy rhardy 167887 Mar 15 13:33 jar_cache27940.tmp -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27941.tmp -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:33 jar_cache27942.tmp drwx------ 2 rhardy rhardy 72 Mar 20 12:51 kde-rhardy/ drwx------ 3 rhardy rhardy 592 Mar 20 12:45 ksocket-rhardy/ -rw-r----- 1 rhardy rhardy 6 Mar 11 21:24 .ktorrent_500.lock drwx------ 2 root root 48 Feb 12 01:55 lost+found/ drwx------ 2 rhardy rhardy 360 Mar 20 12:45 orbit-rhardy/ drwx------ 2 rhardy rhardy 80 Mar 20 12:45 ssh-ICvvB13260/ drwxr-xr-x 4 root root 96 Mar 20 12:49 test1/ -r--r--r-- 1 root root 11 Mar 20 00:03 .X0-lock drwxrwxrwt 2 root root 72 Mar 20 00:03 .X11-unix/ vortex:/tmp 12:53 {0}# unison -owner -group -times test1 dest Contacting server... Connected [//vortex//tmp/dest -> //vortex//tmp/test1] Looking for changes Press return to continue.[] scanning test2/7XEMQU.tmp Reconciling changes test1 dest props ====> props / [] . dir ----> test2 [f] . dir ----> test3 [f] . Proceed with propagating updates? [] y Propagating updates UNISON 2.27.57 started propagating changes at 12:54:40 on 20 Mar 2009 [BGN] Copying properties for from /tmp/test1 to /tmp/dest [END] Copying properties for [BGN] Copying test2 from /tmp/test1 to /tmp/dest [END] Copying test2 [BGN] Copying test3 from /tmp/test1 to /tmp/dest [END] Copying test3 UNISON 2.27.57 finished propagating changes at 12:54:40 on 20 Mar 2009 Saving synchronizer state Synchronization complete (3 items transferred, 0 skipped, 0 failures) vortex:/tmp 12:54 {0}# ls -l total 329 drwxr-xr-x 4 root root 96 Mar 20 12:54 dest/ drwxr-xr-x 4 root root 96 Mar 20 12:49 test1/ vortex:/tmp 12:54 {0}# ls -l dest/ total 0 drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ 49c2fbf3855bd 7XEMQU.tmp jar_cache27933.tmp # cp -a /tmp/jar_cache27940.tmp /tmp/test1/test3/jar_cache27933.tmp vortex:/tmp 12:55 {0}# unison -owner -group -times test1 dest Contacting server... Connected [//vortex//tmp/dest -> //vortex//tmp/test1] Looking for changes scanning Reconciling changes test1 dest ====> props / [f] . changed ----> test3/jar_cache27933.tmp [f] . Proceed with propagating updates? [] y Propagating updates UNISON 2.27.57 started propagating changes at 12:56:05 on 20 Mar 2009 [BGN] Copying properties for from /tmp/test1 to /tmp/dest [END] Copying properties for [BGN] Updating file test3/jar_cache27933.tmp from /tmp/test1 to /tmp/dest [END] Updating file test3/jar_cache27933.tmp UNISON 2.27.57 finished propagating changes at 12:56:05 on 20 Mar 2009 Saving synchronizer state Synchronization complete (2 items transferred, 0 skipped, 0 failures) # ls -la /tmp/ total 342 drwxrwxrwt 18 root root 1368 Mar 20 12:55 ./ drwxr-xr-x 25 root root 680 Mar 2 18:37 ../ drwxr-xr-x 4 root root 96 Mar 20 12:49 dest/ drwxr-xr-x 4 root root 96 Mar 20 12:49 test1/ # ls -la test1 dest/ dest/: total 1 drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ drwxrwxrwt 18 root root 1368 Mar 20 12:55 ../ drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ drwxr-xr-x 2 root root 152 Mar 20 12:56 test3/ ******* WRONG TIME ************* test1: total 1 drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ drwxrwxrwt 18 root root 1368 Mar 20 12:55 ../ drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ # ls -la test1 dest/test3/ dest/test3/: total 180 drwxr-xr-x 2 root root 152 Mar 20 12:56 ./ drwxr-xr-x 4 root root 96 Mar 20 12:49 ../ -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp -rw-r--r-- 1 rhardy rhardy 167887 Mar 15 13:33 jar_cache27933.tmp test1: total 1 drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ drwxrwxrwt 18 root root 1368 Mar 20 12:55 ../ drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ Regards, Rob -- Robert Hardy, B.Eng Computer Systems Systems Analyst/Software Developer/I.T. Specialist Teledyne Controls Simulation 105-2255 St Laurent Blvd Ottawa, ON K1G 4K3 Canada +16135262059 ex 355 Fax +16135265751 On Mon, 2 Feb 2009, Benjamin Pierce wrote: > Hi Rob, > > With just this patch, if an updated file is transferred by Unison, > won't its parent directory's modtime then be wrong on the receiving > host? > > Best, > > - Benjamin > > > On Feb 2, 2009, at 6:20 PM, Robert Hardy wrote: >> There seems to be a bug in the unison -times option in that it ignores >> directory times. I found some comments in BUGS.txt that suggests this >> needed OCAML changes. I can't see why that comment is there. With some >> suggestions from freenode's #ocaml I came up with this patch which works >> on Linux. >> >> I was syncing large quanties of data between an el4 and el5 box. Ignoring >> the directory times caused me a lot of problems. >> >> I suspect this patch should also be extended for Unix.S_LNK as currently >> unison with -owner -group -times should set the user/owner for links and >> it does not. >> >> Here is a simple patch which in basic testing under el5 seems to fix >> this problem: >> >> http://webcon.ca/~rhardy/utmp/unison-2.27.57-dir_times.patch >> >> diff -urNbBp unison-2.27.57/props.ml.orig unison-2.27.57/props.ml >> --- unison-2.27.57/props.ml.orig 2007-04-01 23:03:20.000000000 -0400 >> +++ unison-2.27.57/props.ml 2009-02-02 14:22:07.000000000 -0500 >> @@ -501,6 +501,8 @@ let get stats _ = >> let v = stats.Unix.LargeFile.st_mtime in >> if stats.Unix.LargeFile.st_kind = Unix.S_REG && Prefs.read sync >> then >> Synced v >> + else if stats.Unix.LargeFile.st_kind = Unix.S_DIR && Prefs.read >> sync then >> + Synced v >> else >> NotSynced v From bcpierce at cis.upenn.edu Fri Mar 20 17:57:22 2009 From: bcpierce at cis.upenn.edu (Benjamin Pierce) Date: Fri, 20 Mar 2009 17:57:22 -0400 Subject: [Unison-hackers] PATCH: Bugfix unison -times support for directories In-Reply-To: References: <80FE369B-F5E4-454B-90EC-B248F3219536@cis.upenn.edu> Message-ID: > Sorry it took so long to reply. It seems you are right, while this > does work > for the initial replication, if a file changes the parent's > directory's > modtime will be changed to the wrong time. Any idea how we can fix the > -times option properly? I don't remember what was the issue with OCaml for propagating directory modtimes. Maybe Trevor or Jerome does? Best, - Benjamin > > > # mkdir -p test1/test2 test1/test3 > > # cp -a /tmp/49c2fbf3855bd /tmp/7XEMQU.tmp /tmp/jar_cache27933.tmp / > tmp/test1/test2 > # ls -l /tmp/test1/test2 > total 20 > -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd > -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp > -rw-r--r-- 1 rhardy rhardy 1047 Mar 15 13:33 jar_cache27933.tmp > test2/ test3/ > > # cp -a /tmp/49c2fbf3855bd /tmp/7XEMQU.tmp /tmp/jar_cache27933.tmp / > tmp/test1/test3 > # ls -la /tmp/test1/test3 > total 20 > drwxr-xr-x 2 root root 152 Mar 20 12:50 ./ > drwxr-xr-x 4 root root 96 Mar 20 12:49 ../ > -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd > -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp > -rw-r--r-- 1 rhardy rhardy 1047 Mar 15 13:33 jar_cache27933.tmp > # touch /tmp/test1/test3 > vortex:/tmp/test1 12:51 {0}# ls -la /tmp/test1 > total 1 > drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ > drwxrwxrwt 17 root root 1344 Mar 20 12:51 ../ > drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ > drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ > vortex:/tmp 12:51 {0}# ls -la > total 342 > drwxrwxrwt 17 root root 1344 Mar 20 12:51 ./ > drwxr-xr-x 25 root root 680 Mar 2 18:37 ../ > -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd > -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf39ec83 > -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbfa288a3 > -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp > drwxr-xr-x 2 rhardy rhardy 48 Mar 19 23:45 acroread_500_500/ > -rw-r--r-- 1 root root 32227 Mar 11 23:44 alsa-info.txt > drwxrwxrwt 2 root root 72 Mar 1 12:41 .font-unix/ > drwx------ 3 rhardy rhardy 72 Mar 20 12:45 gconfd-rhardy/ > srw-rw-rw- 1 root root 0 Mar 2 09:40 .gdm_socket= > -rw------- 1 rhardy rhardy 117 Mar 20 12:45 .gdmYEH1QU > drwxr-xr-x 2 rhardy rhardy 48 Mar 20 00:01 hsperfdata_rhardy/ > drwxr-xr-x 2 root root 48 Mar 15 13:29 hsperfdata_root/ > drwxrwxrwt 2 root root 112 Mar 20 12:45 .ICE-unix/ > -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:32 jar_cache27926.tmp > -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:32 jar_cache27927.tmp > -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:32 jar_cache27929.tmp > -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:32 jar_cache27930.tmp > -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27932.tmp > -rw-r--r-- 1 rhardy rhardy 1047 Mar 15 13:33 jar_cache27933.tmp > -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27935.tmp > -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:33 jar_cache27936.tmp > -rw-r--r-- 1 rhardy rhardy 65598 Mar 15 13:33 jar_cache27937.tmp > -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27938.tmp > -rw-r--r-- 1 rhardy rhardy 1046 Mar 15 13:33 jar_cache27939.tmp > -rw-r--r-- 1 rhardy rhardy 167887 Mar 15 13:33 jar_cache27940.tmp > -rw-r--r-- 1 rhardy rhardy 0 Mar 15 13:33 jar_cache27941.tmp > -rw-r--r-- 1 rhardy rhardy 1054 Mar 15 13:33 jar_cache27942.tmp > drwx------ 2 rhardy rhardy 72 Mar 20 12:51 kde-rhardy/ > drwx------ 3 rhardy rhardy 592 Mar 20 12:45 ksocket-rhardy/ > -rw-r----- 1 rhardy rhardy 6 Mar 11 21:24 .ktorrent_500.lock > drwx------ 2 root root 48 Feb 12 01:55 lost+found/ > drwx------ 2 rhardy rhardy 360 Mar 20 12:45 orbit-rhardy/ > drwx------ 2 rhardy rhardy 80 Mar 20 12:45 ssh-ICvvB13260/ > drwxr-xr-x 4 root root 96 Mar 20 12:49 test1/ > -r--r--r-- 1 root root 11 Mar 20 00:03 .X0-lock > drwxrwxrwt 2 root root 72 Mar 20 00:03 .X11-unix/ > > vortex:/tmp 12:53 {0}# unison -owner -group -times test1 dest > Contacting server... > Connected [//vortex//tmp/dest -> //vortex//tmp/test1] > Looking for changes > > Press return to continue.[] scanning test2/7XEMQU.tmp > Reconciling changes > > test1 dest > props ====> props / [] . > dir ----> test2 [f] . > dir ----> test3 [f] . > > Proceed with propagating updates? [] y > Propagating updates > > UNISON 2.27.57 started propagating changes at 12:54:40 on 20 Mar 2009 > [BGN] Copying properties for from /tmp/test1 to /tmp/dest > [END] Copying properties for > [BGN] Copying test2 from /tmp/test1 to /tmp/dest > [END] Copying test2 > [BGN] Copying test3 from /tmp/test1 to /tmp/dest > [END] Copying test3 > UNISON 2.27.57 finished propagating changes at 12:54:40 on 20 Mar 2009 > > Saving synchronizer state > Synchronization complete (3 items transferred, 0 skipped, 0 failures) > vortex:/tmp 12:54 {0}# ls -l > total 329 > drwxr-xr-x 4 root root 96 Mar 20 12:54 dest/ > drwxr-xr-x 4 root root 96 Mar 20 12:49 test1/ > vortex:/tmp 12:54 {0}# ls -l dest/ > total 0 > drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ > drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ > > 49c2fbf3855bd 7XEMQU.tmp jar_cache27933.tmp > > # cp -a /tmp/jar_cache27940.tmp /tmp/test1/test3/jar_cache27933.tmp > > vortex:/tmp 12:55 {0}# unison -owner -group -times test1 dest > Contacting server... > Connected [//vortex//tmp/dest -> //vortex//tmp/test1] > Looking for changes > scanning > Reconciling changes > > test1 dest > ====> props / [f] . > changed ----> test3/jar_cache27933.tmp [f] . > > Proceed with propagating updates? [] y > Propagating updates > > > UNISON 2.27.57 started propagating changes at 12:56:05 on 20 Mar 2009 > [BGN] Copying properties for from /tmp/test1 to /tmp/dest > [END] Copying properties for > [BGN] Updating file test3/jar_cache27933.tmp from /tmp/test1 to /tmp/ > dest > [END] Updating file test3/jar_cache27933.tmp > UNISON 2.27.57 finished propagating changes at 12:56:05 on 20 Mar 2009 > > > Saving synchronizer state > Synchronization complete (2 items transferred, 0 skipped, 0 failures) > # ls -la /tmp/ > total 342 > drwxrwxrwt 18 root root 1368 Mar 20 12:55 ./ > drwxr-xr-x 25 root root 680 Mar 2 18:37 ../ > drwxr-xr-x 4 root root 96 Mar 20 12:49 dest/ > drwxr-xr-x 4 root root 96 Mar 20 12:49 test1/ > > # ls -la test1 dest/ > dest/: > total 1 > drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ > drwxrwxrwt 18 root root 1368 Mar 20 12:55 ../ > drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ > drwxr-xr-x 2 root root 152 Mar 20 12:56 test3/ > ******* WRONG TIME ************* > > test1: > total 1 > drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ > drwxrwxrwt 18 root root 1368 Mar 20 12:55 ../ > drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ > drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ > > # ls -la test1 dest/test3/ > dest/test3/: > total 180 > drwxr-xr-x 2 root root 152 Mar 20 12:56 ./ > drwxr-xr-x 4 root root 96 Mar 20 12:49 ../ > -rw------- 1 rhardy rhardy 12057 Mar 19 22:14 49c2fbf3855bd > -rw------- 1 rhardy rhardy 1711 Mar 16 10:12 7XEMQU.tmp > -rw-r--r-- 1 rhardy rhardy 167887 Mar 15 13:33 jar_cache27933.tmp > > test1: > total 1 > drwxr-xr-x 4 root root 96 Mar 20 12:49 ./ > drwxrwxrwt 18 root root 1368 Mar 20 12:55 ../ > drwxr-xr-x 2 root root 152 Mar 20 12:50 test2/ > drwxr-xr-x 2 root root 152 Mar 20 12:51 test3/ > > > Regards, > Rob > > -- > Robert Hardy, B.Eng Computer Systems > Systems Analyst/Software Developer/I.T. Specialist > Teledyne Controls Simulation > 105-2255 St Laurent Blvd > Ottawa, ON K1G 4K3 Canada > +16135262059 ex 355 > Fax +16135265751 > > On Mon, 2 Feb 2009, Benjamin Pierce wrote: >> Hi Rob, >> >> With just this patch, if an updated file is transferred by Unison, >> won't its parent directory's modtime then be wrong on the receiving >> host? >> >> Best, >> >> - Benjamin >> >> >> On Feb 2, 2009, at 6:20 PM, Robert Hardy wrote: >>> There seems to be a bug in the unison -times option in that it >>> ignores >>> directory times. I found some comments in BUGS.txt that suggests >>> this >>> needed OCAML changes. I can't see why that comment is there. With >>> some >>> suggestions from freenode's #ocaml I came up with this patch which >>> works >>> on Linux. >>> >>> I was syncing large quanties of data between an el4 and el5 box. >>> Ignoring >>> the directory times caused me a lot of problems. >>> >>> I suspect this patch should also be extended for Unix.S_LNK as >>> currently >>> unison with -owner -group -times should set the user/owner for >>> links and >>> it does not. >>> >>> Here is a simple patch which in basic testing under el5 seems to fix >>> this problem: >>> >>> http://webcon.ca/~rhardy/utmp/unison-2.27.57-dir_times.patch >>> >>> diff -urNbBp unison-2.27.57/props.ml.orig unison-2.27.57/props.ml >>> --- unison-2.27.57/props.ml.orig 2007-04-01 23:03:20.000000000 -0400 >>> +++ unison-2.27.57/props.ml 2009-02-02 14:22:07.000000000 -0500 >>> @@ -501,6 +501,8 @@ let get stats _ = >>> let v = stats.Unix.LargeFile.st_mtime in >>> if stats.Unix.LargeFile.st_kind = Unix.S_REG && Prefs.read sync >>> then >>> Synced v >>> + else if stats.Unix.LargeFile.st_kind = Unix.S_DIR && Prefs.read >>> sync then >>> + Synced v >>> else >>> NotSynced v > > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers From rhardy at teledyne.com Fri Mar 20 22:17:19 2009 From: rhardy at teledyne.com (Robert Hardy) Date: Fri, 20 Mar 2009 22:17:19 -0400 Subject: [Unison-hackers] PATCH: Bugfix unison -times support for directories In-Reply-To: Message-ID: <200903210217.n2L2HOaH032236@airincmail.teledyne.ca> I was thinking about this and seems that when ever a file is added/removed from a directory on the destination, the parent directory's is being changed to mtime of now. I think if when using the -times option, we store the parent dir's mtime before a file change and restore it after the change it should be ok with the patch I sent already. I'm not 100% sure but it seems reasonable, mind you I have a cold :P I spent some time digging for when to implement that but got tired and gave up for now. If anyone has suggestions that would help. Rob ------- Original message ------- From: Benjamin Pierce Sent: 3/20, 17:57 > > Sorry it took so long to reply. It seems you are right, while this > > does work for the initial replication, if a file changes the parent's > > directory's modtime will be changed to the wrong time. Any idea > > how we can fix the -times option properly? > > I don't remember what was the issue with OCaml for propagating > directory modtimes. Maybe Trevor or Jerome does? From standin-000 at tianya.cn Sat Mar 28 01:44:13 2009 From: standin-000 at tianya.cn (netawater) Date: Sat, 28 Mar 2009 13:44:13 +0800 Subject: [Unison-hackers] Does copyprog option do not work for local files? Message-ID: <87hc1ew6aa.fsf@emacs.Arch.net> I try use unison to synchronize my files with copyprog option, I have set copythreshold = 0, but It seems unison does not call my copy program. I have studied the copy.ml, and found these expressions in file function match rootFrom, rootTo with (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> localFile fspathFrom pathFrom fspathTo pathTo realPathTo update desc (Osx.ressLength ress) (Some id); Lwt.return () It means if it found there are local files, it will call localFile function so that copyprog is ignored. I tried to skip these expressions, but it cause it call targetExistsOnRoot which can not work in local file environment. I know little about Ocaml, I hope someone can help me, Thanks in advance. From alan.schmitt at polytechnique.org Sat Mar 28 05:16:59 2009 From: alan.schmitt at polytechnique.org (Alan Schmitt) Date: Sat, 28 Mar 2009 10:16:59 +0100 Subject: [Unison-hackers] Does copyprog option do not work for local files? In-Reply-To: <87hc1ew6aa.fsf@emacs.Arch.net> References: <87hc1ew6aa.fsf@emacs.Arch.net> Message-ID: <4CF9D232-D0EB-4ECE-962A-3DCFC92D3FCF@polytechnique.org> On 28 mars 09, at 06:44, netawater wrote: > I try use unison to synchronize my files with copyprog option, I > have set copythreshold = 0, but It seems unison does not call my > copy program. > > I have studied the copy.ml, and found these expressions in file > function > > match rootFrom, rootTo with > (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> > localFile > fspathFrom pathFrom fspathTo pathTo realPathTo > update desc (Osx.ressLength ress) (Some id); > Lwt.return () > > It means if it found there are local files, it will call localFile > function > so that copyprog is ignored. Yes, it is correct. To be precise, copyprog is called: - when one file is remote - when the remote file is missing (i.e. it's a file creation, not a file modification) - when the remote file is bigger than the threshold. Alan -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 195 bytes Desc: This is a digitally signed message part Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20090328/0c063d0b/PGP.sig From standin-000 at tianya.cn Sun Mar 29 03:37:21 2009 From: standin-000 at tianya.cn (netawater) Date: Sun, 29 Mar 2009 15:37:21 +0800 Subject: [Unison-hackers] Does copyprog option do not work for local files? References: <87hc1ew6aa.fsf@emacs.Arch.net> <4CF9D232-D0EB-4ECE-962A-3DCFC92D3FCF@polytechnique.org> Message-ID: <87tz5cwzim.fsf@emacs.Arch.net> Alan Schmitt writes: > On 28 mars 09, at 06:44, netawater wrote: > >> I try use unison to synchronize my files with copyprog option, I >> have set copythreshold = 0, but It seems unison does not call my >> copy program. >> >> I have studied the copy.ml, and found these expressions in file >> function >> >> match rootFrom, rootTo with >> (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> >> localFile >> fspathFrom pathFrom fspathTo pathTo realPathTo >> update desc (Osx.ressLength ress) (Some id); >> Lwt.return () >> >> It means if it found there are local files, it will call localFile >> function >> so that copyprog is ignored. > > Yes, it is correct. To be precise, copyprog is called: > - when one file is remote > - when the remote file is missing (i.e. it's a file creation, not a > file modification) > - when the remote file is bigger than the threshold. > > Alan > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers Thanks for you reply. My situation is I want to synchronize my files from my local driver C: to a network driver \\Wua141699 in Windows. The network drive is not very stable and I need use my copy program to copy and verify files instead unison's native copy method. Can I make this happen? I have tried hard but I can not finish it. From bcpierce at cis.upenn.edu Sun Mar 29 09:32:19 2009 From: bcpierce at cis.upenn.edu (Benjamin Pierce) Date: Sun, 29 Mar 2009 09:32:19 -0400 Subject: [Unison-hackers] Does copyprog option do not work for local files? In-Reply-To: <87tz5cwzim.fsf@emacs.Arch.net> References: <87hc1ew6aa.fsf@emacs.Arch.net> <4CF9D232-D0EB-4ECE-962A-3DCFC92D3FCF@polytechnique.org> <87tz5cwzim.fsf@emacs.Arch.net> Message-ID: <3A34BF3E-EAF3-4F22-BC7C-B5B30B1A4CF9@cis.upenn.edu> If you only care about the file contents (not permissions, etc.), you should be able to replace the body of Copy.localFile with an invocation of your external copy program by calling External.runExternalProgram. However, depending on what you feel your time is worth, I wonder whether just replacing the network drive with one that works might not be a better solution... Best, - Benjamin On Mar 29, 2009, at 3:37 AM, netawater wrote: > Alan Schmitt writes: > >> On 28 mars 09, at 06:44, netawater wrote: >> >>> I try use unison to synchronize my files with copyprog option, I >>> have set copythreshold = 0, but It seems unison does not call my >>> copy program. >>> >>> I have studied the copy.ml, and found these expressions in file >>> function >>> >>> match rootFrom, rootTo with >>> (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> >>> localFile >>> fspathFrom pathFrom fspathTo pathTo realPathTo >>> update desc (Osx.ressLength ress) (Some id); >>> Lwt.return () >>> >>> It means if it found there are local files, it will call localFile >>> function >>> so that copyprog is ignored. >> >> Yes, it is correct. To be precise, copyprog is called: >> - when one file is remote >> - when the remote file is missing (i.e. it's a file creation, not a >> file modification) >> - when the remote file is bigger than the threshold. >> >> Alan >> _______________________________________________ >> Unison-hackers mailing list >> Unison-hackers at lists.seas.upenn.edu >> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers > > Thanks for you reply. > > My situation is I want to synchronize my files from my local driver C: > to a network driver \\Wua141699 in Windows. The network drive is not > very stable and I need use my copy program to copy and verify files > instead unison's native copy method. > > Can I make this happen? I have tried hard but I can not finish it. > > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers From standin-000 at tianya.cn Mon Mar 30 04:26:52 2009 From: standin-000 at tianya.cn (netawater) Date: Mon, 30 Mar 2009 16:26:52 +0800 Subject: [Unison-hackers] Does copyprog option do not work for local files? References: <87hc1ew6aa.fsf@emacs.Arch.net> <4CF9D232-D0EB-4ECE-962A-3DCFC92D3FCF@polytechnique.org> <87tz5cwzim.fsf@emacs.Arch.net> <3A34BF3E-EAF3-4F22-BC7C-B5B30B1A4CF9@cis.upenn.edu> Message-ID: <87tz5bquur.fsf@emacs.Arch.net> Benjamin Pierce writes: > If you only care about the file contents (not permissions, etc.), you > should be able to replace the body of Copy.localFile with an > invocation of your external copy program by calling > External.runExternalProgram. > > However, depending on what you feel your time is worth, I wonder > whether just replacing the network drive with one that works might not > be a better solution... > > Best, > > - Benjamin > > > > On Mar 29, 2009, at 3:37 AM, netawater wrote: > >> Alan Schmitt writes: >> >>> On 28 mars 09, at 06:44, netawater wrote: >>> >>>> I try use unison to synchronize my files with copyprog option, I >>>> have set copythreshold = 0, but It seems unison does not call my >>>> copy program. >>>> >>>> I have studied the copy.ml, and found these expressions in file >>>> function >>>> >>>> match rootFrom, rootTo with >>>> (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> >>>> localFile >>>> fspathFrom pathFrom fspathTo pathTo realPathTo >>>> update desc (Osx.ressLength ress) (Some id); >>>> Lwt.return () >>>> >>>> It means if it found there are local files, it will call localFile >>>> function >>>> so that copyprog is ignored. >>> >>> Yes, it is correct. To be precise, copyprog is called: >>> - when one file is remote >>> - when the remote file is missing (i.e. it's a file creation, not a >>> file modification) >>> - when the remote file is bigger than the threshold. >>> >>> Alan >>> _______________________________________________ >>> Unison-hackers mailing list >>> Unison-hackers at lists.seas.upenn.edu >>> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers >> >> Thanks for you reply. >> >> My situation is I want to synchronize my files from my local driver C: >> to a network driver \\Wua141699 in Windows. The network drive is not >> very stable and I need use my copy program to copy and verify files >> instead unison's native copy method. >> >> Can I make this happen? I have tried hard but I can not finish it. >> >> _______________________________________________ >> Unison-hackers mailing list >> Unison-hackers at lists.seas.upenn.edu >> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers Thank you! My network drive is produced by Wuala and I like its p2p online storage, so I do not want to change it. I have tried modify localfile like this: let localFile (* fspathFrom pathFrom fspathTo pathTo realPathTo update desc ressLength ido = *) rootFrom pathFrom fspathTo pathTo realPathTo update desc ressLength ido = (* Plato Wu,2009/03/30: use External.runExternalProgram instead *) targetExistsLocal rootFrom (`MakeWriteableAndCheckNonempty, fspathTo, pathTo) >>= (fun b -> let prog = if b then Prefs.read copyprogrest else Prefs.read copyprog in let fromSpec = (formatConnectionInfo rootFrom) ^ (Fspath.concatToString (snd rootFrom) pathFrom) in let toSpec = (* (formatConnectionInfo rootTo) ^ *) (Fspath.concatToString fspathTo pathTo) in let cmd = prog ^ " " ^ (Os.quotes fromSpec) ^ " " ^ (Os.quotes toSpec) in Trace.log (Printf.sprintf "%s\n" cmd); let _,log = Os.runExternalProgram cmd in debug (fun() -> let l = Util.trimWhitespace log in Util.msg "transferFileUsingExternalCopyprog %s: returned...\n%s%s" (Path.toString pathFrom) l (if l="" then "" else "\n")); targetExistsLocal rootFrom (`CheckDataSize desc, fspathTo, pathTo) >>= (fun b -> if not b then raise (Util.Transient (Printf.sprintf "External copy program did not create target file (or bad length): %s" (Path.toString pathTo))); (* Uutil.showProgress id (Props.length desc) "ext"; *) Lwt.return (match update with `Update _ -> Fileinfo.set fspathTo pathTo (`Copy realPathTo) desc | `Copy -> Fileinfo.set fspathTo pathTo (`Set Props.fileDefault) desc) )); I know little about Ocaml's grammar and semantic, so I struggled in modification and compilation, can you help me to finish this function. Thank you very much! From bcpierce at cis.upenn.edu Mon Mar 30 08:21:11 2009 From: bcpierce at cis.upenn.edu (Benjamin Pierce) Date: Mon, 30 Mar 2009 08:21:11 -0400 Subject: [Unison-hackers] Does copyprog option do not work for local files? In-Reply-To: <87tz5bquur.fsf@emacs.Arch.net> References: <87hc1ew6aa.fsf@emacs.Arch.net> <4CF9D232-D0EB-4ECE-962A-3DCFC92D3FCF@polytechnique.org> <87tz5cwzim.fsf@emacs.Arch.net> <3A34BF3E-EAF3-4F22-BC7C-B5B30B1A4CF9@cis.upenn.edu> <87tz5bquur.fsf@emacs.Arch.net> Message-ID: OK, attached is a hacked version of copy.ml that uses copyprog also for local transfers. It has been tested on exactly one example. I'm afraid I won't be able to help any more with this -- there's a long list of Unison things to be fixed and very limited time for working on them. But I hope it gets you started. Best, - Benjamin -------------- next part -------------- A non-text attachment was scrubbed... Name: copy.ml Type: application/octet-stream Size: 25790 bytes Desc: not available Url : http://lists.seas.upenn.edu/pipermail/unison-hackers/attachments/20090330/4ffa82da/copy.dll -------------- next part -------------- On Mar 30, 2009, at 4:26 AM, netawater wrote: > Benjamin Pierce writes: > >> If you only care about the file contents (not permissions, etc.), you >> should be able to replace the body of Copy.localFile with an >> invocation of your external copy program by calling >> External.runExternalProgram. >> >> However, depending on what you feel your time is worth, I wonder >> whether just replacing the network drive with one that works might >> not >> be a better solution... >> >> Best, >> >> - Benjamin >> >> >> >> On Mar 29, 2009, at 3:37 AM, netawater wrote: >> >>> Alan Schmitt writes: >>> >>>> On 28 mars 09, at 06:44, netawater wrote: >>>> >>>>> I try use unison to synchronize my files with copyprog option, I >>>>> have set copythreshold = 0, but It seems unison does not call my >>>>> copy program. >>>>> >>>>> I have studied the copy.ml, and found these expressions in file >>>>> function >>>>> >>>>> match rootFrom, rootTo with >>>>> (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> >>>>> localFile >>>>> fspathFrom pathFrom fspathTo pathTo realPathTo >>>>> update desc (Osx.ressLength ress) (Some id); >>>>> Lwt.return () >>>>> >>>>> It means if it found there are local files, it will call localFile >>>>> function >>>>> so that copyprog is ignored. >>>> >>>> Yes, it is correct. To be precise, copyprog is called: >>>> - when one file is remote >>>> - when the remote file is missing (i.e. it's a file creation, not a >>>> file modification) >>>> - when the remote file is bigger than the threshold. >>>> >>>> Alan >>>> _______________________________________________ >>>> Unison-hackers mailing list >>>> Unison-hackers at lists.seas.upenn.edu >>>> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers >>> >>> Thanks for you reply. >>> >>> My situation is I want to synchronize my files from my local >>> driver C: >>> to a network driver \\Wua141699 in Windows. The network drive is not >>> very stable and I need use my copy program to copy and verify files >>> instead unison's native copy method. >>> >>> Can I make this happen? I have tried hard but I can not finish it. >>> >>> _______________________________________________ >>> Unison-hackers mailing list >>> Unison-hackers at lists.seas.upenn.edu >>> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers > > Thank you! My network drive is produced by Wuala and I like its p2p > online storage, so I do not want to change it. > > I have tried modify localfile like this: > > let localFile > (* fspathFrom pathFrom fspathTo pathTo realPathTo update desc > ressLength ido = > *) > rootFrom pathFrom fspathTo pathTo realPathTo update desc > ressLength ido = > (* Plato Wu,2009/03/30: use External.runExternalProgram instead *) > targetExistsLocal > rootFrom (`MakeWriteableAndCheckNonempty, fspathTo, pathTo) >>= > (fun b -> > let prog = > if b > then Prefs.read copyprogrest > else Prefs.read copyprog in > let fromSpec = > (formatConnectionInfo rootFrom) > ^ (Fspath.concatToString (snd rootFrom) pathFrom) in > let toSpec = > (* (formatConnectionInfo rootTo) ^ *) > (Fspath.concatToString fspathTo pathTo) in > let cmd = prog ^ " " > ^ (Os.quotes fromSpec) ^ " " > ^ (Os.quotes toSpec) in > Trace.log (Printf.sprintf "%s\n" cmd); > let _,log = Os.runExternalProgram cmd in > debug (fun() -> > let l = Util.trimWhitespace log in > Util.msg "transferFileUsingExternalCopyprog %s: > returned...\n%s%s" > (Path.toString pathFrom) > l (if l="" then "" else "\n")); > targetExistsLocal > rootFrom (`CheckDataSize desc, fspathTo, pathTo) >>> = (fun b -> > if not b then > raise (Util.Transient (Printf.sprintf > "External copy program did not create target file (or bad > length): %s" > (Path.toString pathTo))); > (* Uutil.showProgress id (Props.length desc) "ext"; *) > Lwt.return (match update with > `Update _ -> > Fileinfo.set fspathTo pathTo (`Copy realPathTo) desc > | `Copy -> > Fileinfo.set fspathTo pathTo (`Set Props.fileDefault) > desc) )); > > I know little about Ocaml's grammar and semantic, so I struggled in > modification and compilation, can you help me to finish this function. > Thank you very much! > > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers From standin-000 at tianya.cn Tue Mar 31 11:01:45 2009 From: standin-000 at tianya.cn (netawater) Date: Tue, 31 Mar 2009 23:01:45 +0800 Subject: [Unison-hackers] Does copyprog option do not work for local files? References: <87hc1ew6aa.fsf@emacs.Arch.net> <4CF9D232-D0EB-4ECE-962A-3DCFC92D3FCF@polytechnique.org> <87tz5cwzim.fsf@emacs.Arch.net> <3A34BF3E-EAF3-4F22-BC7C-B5B30B1A4CF9@cis.upenn.edu> <87tz5bquur.fsf@emacs.Arch.net> Message-ID: <87d4bxohwm.fsf@emacs.Arch.net> Benjamin Pierce writes: > OK, attached is a hacked version of copy.ml that uses copyprog also > for local transfers. It has been tested on exactly one example. > > I'm afraid I won't be able to help any more with this -- there's a > long list of Unison things to be fixed and very limited time for > working on them. But I hope it gets you started. > > Best, > > - Benjamin > > > > > > > > On Mar 30, 2009, at 4:26 AM, netawater wrote: > >> Benjamin Pierce writes: >> >>> If you only care about the file contents (not permissions, etc.), you >>> should be able to replace the body of Copy.localFile with an >>> invocation of your external copy program by calling >>> External.runExternalProgram. >>> >>> However, depending on what you feel your time is worth, I wonder >>> whether just replacing the network drive with one that works might >>> not >>> be a better solution... >>> >>> Best, >>> >>> - Benjamin >>> >>> >>> >>> On Mar 29, 2009, at 3:37 AM, netawater wrote: >>> >>>> Alan Schmitt writes: >>>> >>>>> On 28 mars 09, at 06:44, netawater wrote: >>>>> >>>>>> I try use unison to synchronize my files with copyprog option, I >>>>>> have set copythreshold = 0, but It seems unison does not call my >>>>>> copy program. >>>>>> >>>>>> I have studied the copy.ml, and found these expressions in file >>>>>> function >>>>>> >>>>>> match rootFrom, rootTo with >>>>>> (Common.Local, fspathFrom), (Common.Local, realFspathTo) -> >>>>>> localFile >>>>>> fspathFrom pathFrom fspathTo pathTo realPathTo >>>>>> update desc (Osx.ressLength ress) (Some id); >>>>>> Lwt.return () >>>>>> >>>>>> It means if it found there are local files, it will call localFile >>>>>> function >>>>>> so that copyprog is ignored. >>>>> >>>>> Yes, it is correct. To be precise, copyprog is called: >>>>> - when one file is remote >>>>> - when the remote file is missing (i.e. it's a file creation, not a >>>>> file modification) >>>>> - when the remote file is bigger than the threshold. >>>>> >>>>> Alan >>>>> _______________________________________________ >>>>> Unison-hackers mailing list >>>>> Unison-hackers at lists.seas.upenn.edu >>>>> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers >>>> >>>> Thanks for you reply. >>>> >>>> My situation is I want to synchronize my files from my local >>>> driver C: >>>> to a network driver \\Wua141699 in Windows. The network drive is not >>>> very stable and I need use my copy program to copy and verify files >>>> instead unison's native copy method. >>>> >>>> Can I make this happen? I have tried hard but I can not finish it. >>>> >>>> _______________________________________________ >>>> Unison-hackers mailing list >>>> Unison-hackers at lists.seas.upenn.edu >>>> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers >> >> Thank you! My network drive is produced by Wuala and I like its p2p >> online storage, so I do not want to change it. >> >> I have tried modify localfile like this: >> >> let localFile >> (* fspathFrom pathFrom fspathTo pathTo realPathTo update desc >> ressLength ido = >> *) >> rootFrom pathFrom fspathTo pathTo realPathTo update desc >> ressLength ido = >> (* Plato Wu,2009/03/30: use External.runExternalProgram instead *) >> targetExistsLocal >> rootFrom (`MakeWriteableAndCheckNonempty, fspathTo, pathTo) >>= >> (fun b -> >> let prog = >> if b >> then Prefs.read copyprogrest >> else Prefs.read copyprog in >> let fromSpec = >> (formatConnectionInfo rootFrom) >> ^ (Fspath.concatToString (snd rootFrom) pathFrom) in >> let toSpec = >> (* (formatConnectionInfo rootTo) ^ *) >> (Fspath.concatToString fspathTo pathTo) in >> let cmd = prog ^ " " >> ^ (Os.quotes fromSpec) ^ " " >> ^ (Os.quotes toSpec) in >> Trace.log (Printf.sprintf "%s\n" cmd); >> let _,log = Os.runExternalProgram cmd in >> debug (fun() -> >> let l = Util.trimWhitespace log in >> Util.msg "transferFileUsingExternalCopyprog %s: >> returned...\n%s%s" >> (Path.toString pathFrom) >> l (if l="" then "" else "\n")); >> targetExistsLocal >> rootFrom (`CheckDataSize desc, fspathTo, pathTo) >>>> = (fun b -> >> if not b then >> raise (Util.Transient (Printf.sprintf >> "External copy program did not create target file (or bad >> length): %s" >> (Path.toString pathTo))); >> (* Uutil.showProgress id (Props.length desc) "ext"; *) >> Lwt.return (match update with >> `Update _ -> >> Fileinfo.set fspathTo pathTo (`Copy realPathTo) desc >> | `Copy -> >> Fileinfo.set fspathTo pathTo (`Set Props.fileDefault) >> desc) )); >> >> I know little about Ocaml's grammar and semantic, so I struggled in >> modification and compilation, can you help me to finish this function. >> Thank you very much! >> >> _______________________________________________ >> Unison-hackers mailing list >> Unison-hackers at lists.seas.upenn.edu >> http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers > > _______________________________________________ > Unison-hackers mailing list > Unison-hackers at lists.seas.upenn.edu > http://lists.seas.upenn.edu/mailman/listinfo/unison-hackers You are very kind, thanks very much!