[Pkg-libvirt-commits] [SCM] Libguestfs Debian packaging branch, experimental, updated. debian/1%1.21.40-1

Richard W.M. Jones rjones at redhat.com
Sat Jun 1 11:04:38 UTC 2013


The following commit has been merged in the experimental branch:
commit d66145622550ff4f4ce9a5f8aefcdb6e9ae4c33a
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Thu May 9 15:35:08 2013 +0100

    New API: cp-r
    
    This runs 'cp -rP' and is useful for copying when the target
    doesn't support file owners or permissions (ie. FAT).

diff --git a/daemon/cpmv.c b/daemon/cpmv.c
index 516fa97..f91c9af 100644
--- a/daemon/cpmv.c
+++ b/daemon/cpmv.c
@@ -43,6 +43,12 @@ do_cp_a (const char *src, const char *dest)
 }
 
 int
+do_cp_r (const char *src, const char *dest)
+{
+  return cpmv_cmd (str_cp, "-rP", src, dest);
+}
+
+int
 do_mv (const char *src, const char *dest)
 {
   return cpmv_cmd (str_mv, NULL, src, dest);
diff --git a/generator/actions.ml b/generator/actions.ml
index b0b4be7..a22d43d 100644
--- a/generator/actions.ml
+++ b/generator/actions.ml
@@ -11146,6 +11146,28 @@ about the contents of this file, see L<extlinux(1)>.
 
 See also C<guestfs_syslinux>." };
 
+  { defaults with
+    name = "cp_r";
+    style = RErr, [Pathname "src"; Pathname "dest"], [];
+    proc_nr = Some 401;
+    tests = [
+      InitScratchFS, Always, TestResultString (
+        [["mkdir"; "/cp_r1"];
+         ["mkdir"; "/cp_r2"];
+         ["write"; "/cp_r1/file"; "file content"];
+         ["cp_r"; "/cp_r1"; "/cp_r2"];
+         ["cat"; "/cp_r2/cp_r1/file"]], "file content")
+    ];
+    shortdesc = "copy a file or directory recursively";
+    longdesc = "\
+This copies a file or directory from C<src> to C<dest>
+recursively using the C<cp -rP> command.
+
+Most users should use C<guestfs_cp_a> instead.  This command
+is useful when you don't want to preserve permissions, because
+the target filesystem does not support it (primarily when
+writing to DOS FAT filesystems)." };
+
 ]
 
 (* Non-API meta-commands available only in guestfish.
diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
index d411bb7..066cbfe 100644
--- a/src/MAX_PROC_NR
+++ b/src/MAX_PROC_NR
@@ -1 +1 @@
-400
+401

-- 
Libguestfs Debian packaging



More information about the Pkg-libvirt-commits mailing list