summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Arnold <nerdboy@gentoo.org>2006-11-15 03:04:42 +0000
committerSteve Arnold <nerdboy@gentoo.org>2006-11-15 03:04:42 +0000
commitdf560afa6d16dd4aa3875b5f2dc83807c23f71a4 (patch)
tree2a53f41a8eb51faaca35f037d75ed4d3e4cbe310 /net-misc/unison/files/unison-2.17.1-io-error.patch
parentMarked ~hppa (bug #154244). (diff)
downloadgentoo-2-df560afa6d16dd4aa3875b5f2dc83807c23f71a4.tar.gz
gentoo-2-df560afa6d16dd4aa3875b5f2dc83807c23f71a4.tar.bz2
gentoo-2-df560afa6d16dd4aa3875b5f2dc83807c23f71a4.zip
adding patch for more robust io-handling (back-ported from current trunk)
(Portage version: 2.1.2_rc1-r6)
Diffstat (limited to 'net-misc/unison/files/unison-2.17.1-io-error.patch')
-rw-r--r--net-misc/unison/files/unison-2.17.1-io-error.patch66
1 files changed, 66 insertions, 0 deletions
diff --git a/net-misc/unison/files/unison-2.17.1-io-error.patch b/net-misc/unison/files/unison-2.17.1-io-error.patch
new file mode 100644
index 000000000000..eea448534504
--- /dev/null
+++ b/net-misc/unison/files/unison-2.17.1-io-error.patch
@@ -0,0 +1,66 @@
+diff -uNr unison-2.17.1.orig/stasher.ml unison-2.17.1/stasher.ml
+--- unison-2.17.1.orig/stasher.ml 2005-08-11 17:26:59.000000000 -0700
++++ unison-2.17.1/stasher.ml 2006-09-13 12:04:18.000000000 -0700
+@@ -314,23 +314,36 @@
+ (Path.toString backPath)
+ (Fspath.toString backRoot));
+ try Os.rename fspath path backRoot backPath
+- with
+- _ ->
+- ((let info = Fileinfo.get true fspath path in
+- match info.Fileinfo.typ with
+- `SYMLINK ->
+- Os.symlink
+- backRoot backPath
+- (Os.readLink fspath path)
+- | _ ->
+- Copy.localFile
+- fspath path
+- backRoot backPath backPath
+- `Copy
+- info.Fileinfo.desc
+- (Osx.ressLength info.Fileinfo.osX.Osx.ressInfo)
+- None);
+- Os.delete fspath path)
++ with
++ _ ->
++ debug (fun () -> Util.msg "Rename failed -- copying instead\n");
++ let rec copy p backp =
++ let info = Fileinfo.get true fspath p in
++ match info.Fileinfo.typ with
++ | `SYMLINK ->
++ debug (fun () -> Util.msg " Copying link %s / %s to %s / %s\n"
++ (Fspath.toString fspath) (Path.toString p)
++ (Fspath.toString backRoot) (Path.toString backp));
++ Os.symlink backRoot backp (Os.readLink fspath p)
++ | `FILE ->
++ debug (fun () -> Util.msg " Copying file %s / %s to %s / %s\n"
++ (Fspath.toString fspath) (Path.toString p)
++ (Fspath.toString backRoot) (Path.toString backp));
++ Copy.localFile fspath p backRoot backp backp
++ `Copy info.Fileinfo.desc
++ (Osx.ressLength info.Fileinfo.osX.Osx.ressInfo) None
++ | `DIRECTORY ->
++ debug (fun () -> Util.msg " Copying directory %s / %s to %s / %s\n"
++ (Fspath.toString fspath) (Path.toString p)
++ (Fspath.toString backRoot) (Path.toString backp));
++ Os.createDir backRoot backp info.Fileinfo.desc;
++ let ch = Os.childrenOf fspath p in
++ Safelist.iter (fun n -> copy (Path.child p n) (Path.child backp n)) ch
++ | `ABSENT -> assert false in
++ copy path backPath;
++ debug (fun () -> Util.msg " Finished copying; deleting %s / %s\n"
++ (Fspath.toString fspath) (Path.toString path));
++ Os.delete fspath path
+ end else begin
+ debug ( fun () -> Util.msg
+ "File %s in %s will not be backed up.\n"
+diff -uNr unison-2.17.1.orig/uutil.ml unison-2.17.1/uutil.ml
+--- unison-2.17.1.orig/uutil.ml 2005-08-11 17:26:59.000000000 -0700
++++ unison-2.17.1/uutil.ml 2006-09-13 12:01:33.000000000 -0700
+@@ -123,4 +123,4 @@
+ end else if !l > 0 then
+ notify !l
+ in
+- Util.convertUnixErrorsToTransient "readWrite" (fun () -> read len)
++ Util.convertUnixErrorsToTransient "readWriteBounded" (fun () -> read len)