[libguestfs/f20] New stable branch version 1.24.5.

Richard W.M. Jones rjones at fedoraproject.org
Mon Jan 20 17:18:40 UTC 2014


commit 51fb412f257f73fc847ee3ed12a45bfcc4be86f0
Author: Richard W.M. Jones <rjones at redhat.com>
Date:   Mon Jan 20 16:27:39 2014 +0000

    New stable branch version 1.24.5.
    
    - Backport more virt-builder patches from upstream to Fedora 20.
    - Fixes: RHBZ#1044014 RHBZ#1045033 RHBZ#1028660 RHBZ#1055452
      RHBZ#1053847 RHBZ#660687 RHBZ#1045450 RHBZ#1046509 RHBZ#1025269
      RHBZ#1044585 RHBZ#1039995 RHBZ#923355 RHBZ#1022431.

 ...-Don-t-run-virt-resize-when-not-necessary.patch |    4 +-
 ...e-xzcat-binary-configurable-and-use-AC_PA.patch |    6 +-
 ...-pxzcat-optionally-to-speed-up-xzcat-step.patch |    6 +-
 ...-Add-no-sync-option-to-avoid-sync-on-exit.patch |    8 +-
 ...er-Add-mkdir-option-to-create-directories.patch |   14 +-
 0006-builder-Allow-upload-to-a-directory.patch     |    2 +-
 ...-Add-write-option-to-write-a-literal-file.patch |   14 +-
 ...ument-how-to-boot-VMs-directly-in-qemu-or.patch |   10 +-
 ...end-the-output-to-the-console-as-well-as-.patch |    2 +-
 ...dd-a-section-on-performance-to-the-manual.patch |    6 +-
 ...dd-m-memsize-and-smp-command-line-options.patch |   18 +-
 ...low-multiple-source-paths-to-be-specified.patch |   26 +-
 ...Add-a-real-scanner-parser-for-index-files.patch |   24 +-
 0014-builder-Fix-missing-files-in-EXTRA_DIST.patch |    2 +-
 ...-website-Add-index-validation-test-script.patch |    6 +-
 ...ernal-implementation-of-parallel-xzcat-px.patch |   12 +-
 ...site-Add-validate.sh-test-script-to-EXTRA.patch |    4 +-
 0018-builder-Add-missing-dependency.patch          |    2 +-
 ...er-Add-some-generated-files-to-CLEANFILES.patch |    2 +-
 ...-dependency-from-index-parse.h-to-index-v.patch |    2 +-
 ...-dependencies-which-automake-doesn-t-gene.patch |    2 +-
 0022-builder-Fail-if-bison-is-not-installed.patch  |    4 +-
 0023-builder-Fail-if-lex-is-not-installed.patch    |    4 +-
 ...sprep-Allow-random-as-a-password-selector.patch |    8 +-
 ...prep-Allow-accounts-to-be-locked-RHBZ-102.patch |    8 +-
 ...e-is_block_device-function-into-common-ut.patch |    8 +-
 ...-a-planner-to-work-out-how-to-convert-the.patch |    8 +-
 ...nner-Handle-no-format-in-source-case-corr.patch |    4 +-
 ...uilder-Flush-debug-info-after-printing-it.patch |    4 +-
 0030-builder-Add-a-test-of-the-planner.patch       |    4 +-
 ...uilder-tests-Fix-virt-builder-list-output.patch |    2 +-
 ...ts-Add-test-virt-builder-planner.sh-to-EX.patch |    2 +-
 ...-a-link-to-blog-posting-about-the-planner.patch |    4 +-
 ...y-use-virt-resize-no-sparse-when-writing-.patch |    4 +-
 ...use-to-write-to-a-char-device-or-dev-null.patch |    4 +-
 0036-builder-Remove-blank-line.patch               |    4 +-
 ...-update-option-to-update-template-core-pa.patch |   26 +-
 ...irt-Don-t-default-to-using-NULL-for-libvi.patch |    4 +-
 0039-builder-Add-CirrOS-0.3.1-disk-image.patch     |  133 ------
 ...39-builder-Fix-handling-of-size-parameter.patch |    2 +-
 ...e-in-man-page-how-to-specify-size-in-byte.patch |   27 --
 ...h-Provide-a-friendlier-wrapper-around-vir.patch |    2 +-
 ...lder-Pass-prog-global-program-name-around.patch |  164 --------
 ...-regression-test-of-libvirt-authenticatio.patch |    6 +-
 ...ibrary-function-to-run-external-command-a.patch |   85 ----
 ...-regression-test-for-libvirt-authenticati.patch |   27 +-
 ...lder-Add-timezone-option-to-set-timezone-.patch |   10 +-
 ...er-Document-how-to-change-keyboard-layout.patch |    6 +-
 ...d-link-option-for-creating-symbolic-links.patch |    8 +-
 ...ument-how-to-change-the-language-locale-o.patch |    6 +-
 ...ument-how-to-set-up-local-mirrors-for-per.patch |    8 +-
 ...ument-how-to-set-Japanese-language-suppor.patch |    6 +-
 ...cs-Remove-confusing-reference-to-timezone.patch |   27 --
 ...tch => 0049-builder-Fix-virt-builder-test.patch |    2 +-
 ...-Document-how-to-set-Japanese-in-Debian-7.patch |    6 +-
 ...t-install-packages-in-the-same-order-as-o.patch |   31 --
 ...-no-delete-on-failure-option-to-aid-debug.patch |    6 +-
 ...-performance-recommend-using-the-no-sync-.patch |    6 +-
 ...=> 0053-builder-planner-Whitespace-change.patch |    2 +-
 ...ument-that-SELinux-guests-will-reboot-for.patch |   37 --
 ...r-simplify-the-enabling-of-the-linuxxattr.patch |  142 +++++++
 ...r-move-the-listxattrs-code-in-an-own-func.patch |  108 +++++
 0056-daemon-xattr-Remove-unused-variable.patch     |   27 ++
 0057-New-API-copy-attributes.patch                 |  437 ++++++++++++++++++++
 ...site-Add-CirrOS-signature-file-to-EXTRA_D.patch |   27 --
 ...nerated-files-for-new-copy-attributes-API.patch |   49 +++
 ...ilder-Fix-documentation-for-attach-option.patch |   75 ----
 ...fish-Add-test-file-attrs.sh-to-EXTRA_DIST.patch |   27 ++
 ...er-Minor-documentation-fix-to-manual-page.patch |   35 --
 0060-builder-edit-fish-use-copy-attributes.patch   |  212 ++++++++++
 ...lder-test-virt-builder-check-some-results.patch |   73 ++++
 ...builder-small-refactor-of-the-list-output.patch |  193 +++++++++
 0063-builder-add-list-format.patch                 |   92 ++++
 0064-builder-add-a-JSON-output-for-list.patch      |  232 +++++++++++
 ...-builder-Fix-unterminated-I-.-in-man-page.patch |   27 ++
 libguestfs.spec                                    |   63 ++--
 76 files changed, 1845 insertions(+), 855 deletions(-)
---
diff --git a/0001-builder-Don-t-run-virt-resize-when-not-necessary.patch b/0001-builder-Don-t-run-virt-resize-when-not-necessary.patch
index 1440d88..a78434c 100644
--- a/0001-builder-Don-t-run-virt-resize-when-not-necessary.patch
+++ b/0001-builder-Don-t-run-virt-resize-when-not-necessary.patch
@@ -1,4 +1,4 @@
-From 3348050d63bf00563689082ca97b8064bb241369 Mon Sep 17 00:00:00 2001
+From 33b3a097b4b7720d4d43ebe15e9881e976f70e4b Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 22 Oct 2013 13:52:25 +0100
 Subject: [PATCH] builder: Don't run virt-resize when not necessary.
@@ -16,7 +16,7 @@ the template directly to the output file.
  1 file changed, 48 insertions(+), 22 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index c814441..1785a0c 100644
+index 25ab8c4..16005e1 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -232,7 +232,12 @@ let main () =
diff --git a/0002-builder-Make-xzcat-binary-configurable-and-use-AC_PA.patch b/0002-builder-Make-xzcat-binary-configurable-and-use-AC_PA.patch
index 375a49d..9344168 100644
--- a/0002-builder-Make-xzcat-binary-configurable-and-use-AC_PA.patch
+++ b/0002-builder-Make-xzcat-binary-configurable-and-use-AC_PA.patch
@@ -1,4 +1,4 @@
-From 16ae55f5d0be0e61b00aceed70d0b71ee2503d11 Mon Sep 17 00:00:00 2001
+From 65b953629686797239b33a8dff573390308fa0d4 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 22 Oct 2013 14:09:20 +0100
 Subject: [PATCH] builder: Make xzcat binary configurable and use AC_PATH_PROG.
@@ -11,7 +11,7 @@ Subject: [PATCH] builder: Make xzcat binary configurable and use AC_PATH_PROG.
  3 files changed, 13 insertions(+), 2 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 1785a0c..5a2f23c 100644
+index 16005e1..f6d0ad9 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -323,13 +323,18 @@ let main () =
@@ -44,7 +44,7 @@ index 1785a0c..5a2f23c 100644
        msg (f_"Uncompressing: %s") file_uri;
        let r = Sys.command cmd in
 diff --git a/configure.ac b/configure.ac
-index ba390fe..0ed5fe9 100644
+index 0b3980f..35f254d 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -698,6 +698,10 @@ if test "x$WRESTOOL" != "xno"; then
diff --git a/0003-builder-Use-pxzcat-optionally-to-speed-up-xzcat-step.patch b/0003-builder-Use-pxzcat-optionally-to-speed-up-xzcat-step.patch
index 4ccfe73..83b8583 100644
--- a/0003-builder-Use-pxzcat-optionally-to-speed-up-xzcat-step.patch
+++ b/0003-builder-Use-pxzcat-optionally-to-speed-up-xzcat-step.patch
@@ -1,4 +1,4 @@
-From a5c81744e9301e944cb0225dec799d87b0372bd0 Mon Sep 17 00:00:00 2001
+From 71004a0d015b4d019324ec31b88a842bcad96fef Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 22 Oct 2013 14:22:46 +0100
 Subject: [PATCH] builder: Use pxzcat (optionally) to speed up xzcat step.
@@ -26,7 +26,7 @@ index d9c0219..0e442e1 100644
  +--------------+-------------+---+-----------------------------------------+
  | ocaml-gettext|             | O | For localizing OCaml virt-* tools.      |
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 5a2f23c..83bbad2 100644
+index f6d0ad9..9951e71 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -323,9 +323,11 @@ let main () =
@@ -44,7 +44,7 @@ index 5a2f23c..83bbad2 100644
  
    if not do_resize then (
 diff --git a/configure.ac b/configure.ac
-index 0ed5fe9..c4ce9be 100644
+index 35f254d..2e35252 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -702,6 +702,9 @@ dnl Check for xzcat (required).
diff --git a/0004-builder-Add-no-sync-option-to-avoid-sync-on-exit.patch b/0004-builder-Add-no-sync-option-to-avoid-sync-on-exit.patch
index 996958b..fe31a17 100644
--- a/0004-builder-Add-no-sync-option-to-avoid-sync-on-exit.patch
+++ b/0004-builder-Add-no-sync-option-to-avoid-sync-on-exit.patch
@@ -1,4 +1,4 @@
-From f7b2b98cf61dad455ca9c59ae9467540d7705afd Mon Sep 17 00:00:00 2001
+From 7114f530f3c0ae0fda9f7888b426a813c292b071 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 22 Oct 2013 22:28:27 +0100
 Subject: [PATCH] builder: Add --no-sync option to avoid sync on exit.
@@ -11,7 +11,7 @@ Subject: [PATCH] builder: Add --no-sync option to avoid sync on exit.
  3 files changed, 25 insertions(+), 3 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 83bbad2..8665449 100644
+index 9951e71..2394c76 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -38,7 +38,7 @@ let main () =
@@ -34,7 +34,7 @@ index 83bbad2..8665449 100644
    (* Now that we've finished the build, don't delete the output file on
     * exit.
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index b1fb003..43909cc 100644
+index 7bbde70..c8e9c46 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -161,6 +161,8 @@ let parse_cmdline () =
@@ -69,7 +69,7 @@ index b1fb003..43909cc 100644
 -  upload
 +  sync, upload
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 5de1e51..aa543bb 100644
+index 051b045..9dd86de 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
 @@ -410,6 +410,23 @@ You don't have a host network (eg. in secure/restricted environments).
diff --git a/0005-builder-Add-mkdir-option-to-create-directories.patch b/0005-builder-Add-mkdir-option-to-create-directories.patch
index 31ed9aa..594f560 100644
--- a/0005-builder-Add-mkdir-option-to-create-directories.patch
+++ b/0005-builder-Add-mkdir-option-to-create-directories.patch
@@ -1,4 +1,4 @@
-From ec66c09a8ee115b49a73a312ff6295df69adcedd Mon Sep 17 00:00:00 2001
+From b66bbde1b08b768a5d47b9f515923caab3c9bc72 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 25 Oct 2013 13:35:51 +0100
 Subject: [PATCH] builder: Add --mkdir option to create directories.
@@ -12,7 +12,7 @@ Subject: [PATCH] builder: Add --mkdir option to create directories.
  4 files changed, 32 insertions(+), 6 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 8665449..fa3f8a7 100644
+index 2394c76..760c8a1 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -36,9 +36,9 @@ let main () =
@@ -43,7 +43,7 @@ index 8665449..fa3f8a7 100644
    List.iter (
      fun (file, dest) ->
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index 43909cc..36c63a2 100644
+index c8e9c46..7ac114a 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -119,6 +119,10 @@ let parse_cmdline () =
@@ -67,7 +67,7 @@ index 43909cc..36c63a2 100644
      "--notes",   Arg.Unit notes_mode,       " " ^ s_"Display installation notes";
 @@ -281,6 +286,7 @@ read the man page virt-builder(1).
    let hostname = !hostname in
-   let install = !install in
+   let install = List.rev !install in
    let list_long = !list_long in
 +  let mkdirs = List.rev !mkdirs in
    let network = !network in
@@ -96,10 +96,10 @@ index c8d2e58..6f76972 100755
      --upload Makefile:/etc \
      --delete /Makefile \
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index aa543bb..55dba90 100644
+index 9dd86de..d8d3435 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -18,6 +18,7 @@ virt-builder - Build virtual machine images quickly
+@@ -19,6 +19,7 @@ virt-builder - Build virtual machine images quickly
      [--root-password SELECTOR]
      [--hostname HOSTNAME]
      [--install PKG,[PKG...]]
@@ -121,7 +121,7 @@ index aa543bb..55dba90 100644
  =item B<--network>
  
  =item B<--no-network>
-@@ -756,6 +764,10 @@ Packages are installed (I<--install>).
+@@ -763,6 +771,10 @@ Packages are installed (I<--install>).
  
  =item *
  
diff --git a/0006-builder-Allow-upload-to-a-directory.patch b/0006-builder-Allow-upload-to-a-directory.patch
index e0b7ff6..0420800 100644
--- a/0006-builder-Allow-upload-to-a-directory.patch
+++ b/0006-builder-Allow-upload-to-a-directory.patch
@@ -1,4 +1,4 @@
-From 973b7a6676d5aae1a29d7b7567c91108a468b9ac Mon Sep 17 00:00:00 2001
+From 8053edc7bc64dc41655d55f8e4f4ef3242bb0b33 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 26 Oct 2013 11:27:06 +0100
 Subject: [PATCH] builder: Allow --upload to a directory.
diff --git a/0007-builder-Add-write-option-to-write-a-literal-file.patch b/0007-builder-Add-write-option-to-write-a-literal-file.patch
index 36233a2..ba1cea8 100644
--- a/0007-builder-Add-write-option-to-write-a-literal-file.patch
+++ b/0007-builder-Add-write-option-to-write-a-literal-file.patch
@@ -1,4 +1,4 @@
-From 7ac3c7ae90e7ffbd33e9ac782c4d5a8912be651b Mon Sep 17 00:00:00 2001
+From 17c806003bb1d41f1a70c407991c8de1d48ed492 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 26 Oct 2013 11:40:48 +0100
 Subject: [PATCH] builder: Add --write option to write a literal file.
@@ -12,7 +12,7 @@ Subject: [PATCH] builder: Add --write option to write a literal file.
  4 files changed, 34 insertions(+), 2 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index fa3f8a7..3447dc7 100644
+index 760c8a1..a89b03f 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -38,7 +38,7 @@ let main () =
@@ -39,7 +39,7 @@ index fa3f8a7..3447dc7 100644
    List.iter (
      fun (file, dest) ->
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index 36c63a2..6611fad 100644
+index 7ac114a..28a1643 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -184,6 +184,19 @@ let parse_cmdline () =
@@ -97,10 +97,10 @@ index 30c3cf8..438f2e9 100755
      --upload Makefile:/etc/foo/bar/baz \
      --delete /Makefile \
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 55dba90..f795e7a 100644
+index d8d3435..766815d 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -19,6 +19,7 @@ virt-builder - Build virtual machine images quickly
+@@ -20,6 +20,7 @@ virt-builder - Build virtual machine images quickly
      [--hostname HOSTNAME]
      [--install PKG,[PKG...]]
      [--mkdir DIR]
@@ -108,7 +108,7 @@ index 55dba90..f795e7a 100644
      [--upload FILE:DEST]
      [--edit FILE:EXPR]
      [--delete FILE] [--scrub FILE]
-@@ -583,6 +584,10 @@ your bug report.
+@@ -586,6 +587,10 @@ your bug report.
  
  Display version number and exit.
  
@@ -119,7 +119,7 @@ index 55dba90..f795e7a 100644
  =back
  
  =head1 REFERENCE
-@@ -768,6 +773,10 @@ Directories are created (I<--mkdir>).
+@@ -775,6 +780,10 @@ Directories are created (I<--mkdir>).
  
  =item *
  
diff --git a/0008-builder-Document-how-to-boot-VMs-directly-in-qemu-or.patch b/0008-builder-Document-how-to-boot-VMs-directly-in-qemu-or.patch
index 5a14901..dae9b7c 100644
--- a/0008-builder-Document-how-to-boot-VMs-directly-in-qemu-or.patch
+++ b/0008-builder-Document-how-to-boot-VMs-directly-in-qemu-or.patch
@@ -1,4 +1,4 @@
-From 0d2ee42ef354b95cfa58cb10a647736a70a6855f Mon Sep 17 00:00:00 2001
+From f27194ce17e0806c3e3d917626c48b5f63e49928 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 26 Oct 2013 14:45:30 +0100
 Subject: [PATCH] builder: Document how to boot VMs directly in qemu or KVM.
@@ -9,12 +9,12 @@ Subject: [PATCH] builder: Document how to boot VMs directly in qemu or KVM.
  1 file changed, 15 insertions(+)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index f795e7a..7768366 100644
+index 766815d..c8e1ad7 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -841,6 +841,21 @@ XXX
- 
- =end comment
+@@ -865,6 +865,21 @@ To boot up an instance of your image on a Nova compute node, do:
+ Use S<C<nova flavor-list>> to list possible machine flavors.  Use
+ S<C<nova list>> to list running instances.
  
 +=head3 Booting directly using qemu or KVM
 +
diff --git a/0009-firstboot-Send-the-output-to-the-console-as-well-as-.patch b/0009-firstboot-Send-the-output-to-the-console-as-well-as-.patch
index 68f0b0c..9e3d734 100644
--- a/0009-firstboot-Send-the-output-to-the-console-as-well-as-.patch
+++ b/0009-firstboot-Send-the-output-to-the-console-as-well-as-.patch
@@ -1,4 +1,4 @@
-From d36f70da2a19ddd3ea000f7f64e1e97916c9349f Mon Sep 17 00:00:00 2001
+From e0a88763ad882bcbad2b66adeafee33be2179a2d Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 26 Oct 2013 17:09:06 +0100
 Subject: [PATCH] firstboot: Send the output to the console as well as to the
diff --git a/0010-builder-Add-a-section-on-performance-to-the-manual.patch b/0010-builder-Add-a-section-on-performance-to-the-manual.patch
index 0761548..9c7bee3 100644
--- a/0010-builder-Add-a-section-on-performance-to-the-manual.patch
+++ b/0010-builder-Add-a-section-on-performance-to-the-manual.patch
@@ -1,4 +1,4 @@
-From 73f2282234d44164a502733d77b36513dd4b3fae Mon Sep 17 00:00:00 2001
+From 269da752908ac9a8ba0ab6d12e5e020cd3179657 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sun, 27 Oct 2013 14:59:39 +0000
 Subject: [PATCH] builder: Add a section on performance to the manual.
@@ -9,10 +9,10 @@ Subject: [PATCH] builder: Add a section on performance to the manual.
  1 file changed, 44 insertions(+), 1 deletion(-)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 7768366..a603fcf 100644
+index c8e1ad7..bcd3615 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -1288,7 +1288,50 @@ etc are truly random when the guest boots.
+@@ -1312,7 +1312,50 @@ etc are truly random when the guest boots.
  
  You should check digital signatures and not ignore any signing errors.
  
diff --git a/0011-builder-Add-m-memsize-and-smp-command-line-options.patch b/0011-builder-Add-m-memsize-and-smp-command-line-options.patch
index a1bbd99..ed63419 100644
--- a/0011-builder-Add-m-memsize-and-smp-command-line-options.patch
+++ b/0011-builder-Add-m-memsize-and-smp-command-line-options.patch
@@ -1,4 +1,4 @@
-From d2e2bfc2df5cccee15e752223f8dfd54a6057f72 Mon Sep 17 00:00:00 2001
+From 6a3be2dbe7dcba8e0b0880168bfb880e74fbd9c3 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 29 Oct 2013 19:23:33 +0000
 Subject: [PATCH] builder: Add -m/--memsize and --smp command line options.
@@ -11,7 +11,7 @@ Subject: [PATCH] builder: Add -m/--memsize and --smp command line options.
  3 files changed, 33 insertions(+), 10 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 3447dc7..b120b45 100644
+index a89b03f..85234e0 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -36,9 +36,9 @@ let main () =
@@ -36,7 +36,7 @@ index 3447dc7..b120b45 100644
  
      (* The output disk is being created, so use cache=unsafe here. *)
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index 6611fad..aaeb763 100644
+index 28a1643..97ccd89 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -120,6 +120,9 @@ let parse_cmdline () =
@@ -78,7 +78,7 @@ index 6611fad..aaeb763 100644
      "--upload",  Arg.String add_upload,     "file:dest" ^ " " ^ s_"Upload file to dest";
 @@ -300,6 +309,7 @@ read the man page virt-builder(1).
    let hostname = !hostname in
-   let install = !install in
+   let install = List.rev !install in
    let list_long = !list_long in
 +  let memsize = !memsize in
    let mkdirs = List.rev !mkdirs in
@@ -102,7 +102,7 @@ index 6611fad..aaeb763 100644
 -  scrub_logfile, size, source, sync, upload, writes
 +  scrub_logfile, size, smp, source, sync, upload, writes
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index a603fcf..3905880 100644
+index bcd3615..7d486f7 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
 @@ -366,6 +366,18 @@ the image was built, use this option.
@@ -124,9 +124,9 @@ index a603fcf..3905880 100644
  =item B<--mkdir> DIR
  
  Create a directory in the guest.
-@@ -541,6 +553,10 @@ output is a file, then the size is the same as the template.  If the
- output is a device, partition, etc then the size of that device is
- used.
+@@ -544,6 +556,10 @@ used.
+ To specify size in bytes, the number must be followed by the lowercase
+ letter I<b>, eg: S<C<--size 10737418240b>>.
  
 +=item B<--smp> N
 +
@@ -135,7 +135,7 @@ index a603fcf..3905880 100644
  =item B<--source> URL
  
  Set the source URL to look for templates.  If not specified it
-@@ -1366,12 +1382,6 @@ are actually interpreted by L<curl(1)>, not virt-builder.
+@@ -1402,12 +1418,6 @@ are actually interpreted by L<curl(1)>, not virt-builder.
  
  Used to determine the location of the template cache.  See L</CACHING>.
  
diff --git a/0012-builder-Allow-multiple-source-paths-to-be-specified.patch b/0012-builder-Allow-multiple-source-paths-to-be-specified.patch
index 1077eee..1e49d7d 100644
--- a/0012-builder-Allow-multiple-source-paths-to-be-specified.patch
+++ b/0012-builder-Allow-multiple-source-paths-to-be-specified.patch
@@ -1,4 +1,4 @@
-From bfd9ea287b56d6e466fc555873a45c452628ad09 Mon Sep 17 00:00:00 2001
+From ebf8c4404850977946904aae3f905479916fce21 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 1 Nov 2013 14:16:34 +0000
 Subject: [PATCH] builder: Allow multiple source paths to be specified.
@@ -27,7 +27,7 @@ There is still only one built-in path, but we can add more later.
  10 files changed, 143 insertions(+), 46 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index b120b45..2940f3d 100644
+index 85234e0..a3a31e5 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -35,22 +35,27 @@ let prog = Filename.basename Sys.executable_name
@@ -73,14 +73,14 @@ index b120b45..2940f3d 100644
 -    Sigchecker.create ~debug ~gpg ?fingerprint ~check_signature in
 -
 -  (* Download the source (index) file. *)
--  let index = Index_parser.get_index ~debug ~downloader ~sigchecker source in
+-  let index = Index_parser.get_index ~prog ~debug ~downloader ~sigchecker source in
 +  let index : Index_parser.index =
 +    List.concat (
 +      List.map (
 +        fun (source, fingerprint) ->
 +          let sigchecker =
 +            Sigchecker.create ~debug ~gpg ~fingerprint ~check_signature in
-+          Index_parser.get_index ~debug ~downloader ~sigchecker source
++          Index_parser.get_index ~prog ~debug ~downloader ~sigchecker source
 +      ) sources
 +    ) in
  
@@ -102,7 +102,7 @@ index b120b45..2940f3d 100644
    (match mode with
    | `Notes ->                           (* --notes *)
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index aaeb763..632b227 100644
+index 97ccd89..b4e21fc 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -37,6 +37,8 @@ let default_cachedir =
@@ -231,7 +231,7 @@ index aaeb763..632b227 100644
 -  scrub_logfile, size, smp, source, sync, upload, writes
 +  scrub_logfile, size, smp, sources, sync, upload, writes
 diff --git a/builder/index_parser.ml b/builder/index_parser.ml
-index b5a0cf0..dc039fe 100644
+index 326b395..5f07902 100644
 --- a/builder/index_parser.ml
 +++ b/builder/index_parser.ml
 @@ -37,6 +37,8 @@ and entry = {
@@ -243,7 +243,7 @@ index b5a0cf0..dc039fe 100644
  }
  
  let print_entry chan (name, { printable_name = printable_name;
-@@ -348,7 +350,8 @@ let get_index ~debug ~downloader ~sigchecker source =
+@@ -348,7 +350,8 @@ let get_index ~prog ~debug ~downloader ~sigchecker source =
                          expand = expand;
                          lvexpand = lvexpand;
                          notes = notes;
@@ -254,7 +254,7 @@ index b5a0cf0..dc039fe 100644
        ) sections in
  
 diff --git a/builder/index_parser.mli b/builder/index_parser.mli
-index 79df5ef..0b6317d 100644
+index a9b328a..54f1807 100644
 --- a/builder/index_parser.mli
 +++ b/builder/index_parser.mli
 @@ -31,6 +31,8 @@ and entry = {
@@ -265,7 +265,7 @@ index 79df5ef..0b6317d 100644
 +  sigchecker : Sigchecker.t;
  }
  
- val get_index : debug:bool -> downloader:Downloader.t -> sigchecker:Sigchecker.t -> string -> index
+ val get_index : prog:string -> debug:bool -> downloader:Downloader.t -> sigchecker:Sigchecker.t -> string -> index
 diff --git a/builder/list_entries.ml b/builder/list_entries.ml
 index cf97142..5940d79 100644
 --- a/builder/list_entries.ml
@@ -354,7 +354,7 @@ index 3a159bb..3077b23 100755
  os-version:              phony-debian
  Full name:               Phony Debian
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 3905880..fb99d7c 100644
+index 7d486f7..bbcdb3a 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
 @@ -264,10 +264,14 @@ Check that the index and templates are signed by the key with the
@@ -376,7 +376,7 @@ index 3905880..fb99d7c 100644
  
  You can also set the C<VIRT_BUILDER_FINGERPRINT> environment variable.
  
-@@ -559,8 +563,11 @@ Enable N E<ge> 2 virtual CPUs for I<--run> scripts to use.
+@@ -562,8 +566,11 @@ Enable N E<ge> 2 virtual CPUs for I<--run> scripts to use.
  
  =item B<--source> URL
  
@@ -390,7 +390,7 @@ index 3905880..fb99d7c 100644
  
  See also L</CREATING YOUR OWN TEMPLATES> below.
  
-@@ -1201,6 +1208,36 @@ Now run virt-builder commands as normal, eg:
+@@ -1225,6 +1232,36 @@ Now run virt-builder commands as normal, eg:
  
  To debug problems, add the C<-v> option to these commands.
  
@@ -427,7 +427,7 @@ index 3905880..fb99d7c 100644
  =head3 Licensing of templates
  
  You should be aware of the licensing of images that you distribute.
-@@ -1384,13 +1421,13 @@ Used to determine the location of the template cache.  See L</CACHING>.
+@@ -1420,13 +1457,13 @@ Used to determine the location of the template cache.  See L</CACHING>.
  
  =item C<VIRT_BUILDER_FINGERPRINT>
  
diff --git a/0013-builder-Add-a-real-scanner-parser-for-index-files.patch b/0013-builder-Add-a-real-scanner-parser-for-index-files.patch
index c96e0b2..4fa5ad9 100644
--- a/0013-builder-Add-a-real-scanner-parser-for-index-files.patch
+++ b/0013-builder-Add-a-real-scanner-parser-for-index-files.patch
@@ -1,4 +1,4 @@
-From 6886883c75c46b56c970ed2c87a7b0ef377f18b2 Mon Sep 17 00:00:00 2001
+From 142ae72758d659df4a6a945c827b8dcffb2388f5 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Mon, 4 Nov 2013 14:53:41 +0000
 Subject: [PATCH] builder: Add a real scanner/parser for index files.
@@ -36,7 +36,7 @@ This adds a tool called virt-index-validate to validate index files.
  create mode 100644 builder/virt-index-validate.pod
 
 diff --git a/.gitignore b/.gitignore
-index 8c5fbe7..43f9f40 100644
+index ea42d28..4a77963 100644
 --- a/.gitignore
 +++ b/.gitignore
 @@ -58,10 +58,16 @@ Makefile.in
@@ -808,7 +808,7 @@ index 0000000..d156c43
 +  exit (EXIT_SUCCESS);
 +}
 diff --git a/builder/index_parser.ml b/builder/index_parser.ml
-index dc039fe..fb47e50 100644
+index 5f07902..453a3a1 100644
 --- a/builder/index_parser.ml
 +++ b/builder/index_parser.ml
 @@ -97,14 +97,17 @@ let print_entry chan (name, { printable_name = printable_name;
@@ -825,17 +825,17 @@ index dc039fe..fb47e50 100644
 +(* Calls yyparse in the C code. *)
 +external parse_index : string -> sections = "virt_builder_parse_index"
  
- let get_index ~debug ~downloader ~sigchecker source =
+ let get_index ~prog ~debug ~downloader ~sigchecker source =
 -  let rec corrupt_line line =
--    eprintf (f_"virt-builder: error parsing index near this line:\n\n%s\n")
--      line;
+-    eprintf (f_"%s: error parsing index near this line:\n\n%s\n")
+-      prog line;
 -    corrupt_file ()
 -  and corrupt_file () =
 +  let corrupt_file () =
      eprintf (f_"\nThe index file downloaded from '%s' is corrupt.\nYou need to ask the supplier of this file to fix it and upload a fixed version.\n")
        source;
      exit 1
-@@ -119,133 +122,15 @@ let get_index ~debug ~downloader ~sigchecker source =
+@@ -119,133 +122,15 @@ let get_index ~prog ~debug ~downloader ~sigchecker source =
       *)
      Sigchecker.verify sigchecker tmpfile;
  
@@ -973,7 +973,7 @@ index dc039fe..fb47e50 100644
      ) sections in
  
      (* Check for repeated os-version names. *)
-@@ -356,7 +241,7 @@ let get_index ~debug ~downloader ~sigchecker source =
+@@ -356,7 +241,7 @@ let get_index ~prog ~debug ~downloader ~sigchecker source =
        ) sections in
  
      if debug then (
@@ -1037,10 +1037,10 @@ index 3077b23..ff16abe 100755
      echo "$long_list"
      exit 1
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index fb99d7c..b9fd69c 100644
+index bbcdb3a..71569ec 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -1245,6 +1245,23 @@ For open source guests, provide a link to the source code in the
+@@ -1269,6 +1269,23 @@ For open source guests, provide a link to the source code in the
  C<notes> field and comply with other requirements (eg. around
  trademarks).
  
@@ -1163,7 +1163,7 @@ index 0000000..6b03703
 +
 +Copyright (C) 2013 Red Hat Inc.
 diff --git a/configure.ac b/configure.ac
-index c4ce9be..9b5c051 100644
+index 2e35252..35d0879 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -705,6 +705,10 @@ test "x$XZCAT" = "xno" && AC_MSG_ERROR([xzcat must be installed])
@@ -1214,7 +1214,7 @@ index 23857bd..e954f04 100644
  	virt-list-filesystems.1 \
  	virt-list-partitions.1 \
 diff --git a/po/POTFILES b/po/POTFILES
-index a766f64..aa52b75 100644
+index 56d192e..5418a6b 100644
 --- a/po/POTFILES
 +++ b/po/POTFILES
 @@ -1,4 +1,9 @@
diff --git a/0014-builder-Fix-missing-files-in-EXTRA_DIST.patch b/0014-builder-Fix-missing-files-in-EXTRA_DIST.patch
index 32cf504..2886812 100644
--- a/0014-builder-Fix-missing-files-in-EXTRA_DIST.patch
+++ b/0014-builder-Fix-missing-files-in-EXTRA_DIST.patch
@@ -1,4 +1,4 @@
-From 59dd74c69728174b75ed092eda5390c434686091 Mon Sep 17 00:00:00 2001
+From 48ee01ebe27fe3d5123f9ee70b478cd367df363a Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 07:15:19 +0000
 Subject: [PATCH] builder: Fix missing files in EXTRA_DIST.
diff --git a/0015-builder-website-Add-index-validation-test-script.patch b/0015-builder-website-Add-index-validation-test-script.patch
index f5aeb9b..b892fe0 100644
--- a/0015-builder-website-Add-index-validation-test-script.patch
+++ b/0015-builder-website-Add-index-validation-test-script.patch
@@ -1,4 +1,4 @@
-From 22d618f0072103db58dc9d452a789d8d3d641c8f Mon Sep 17 00:00:00 2001
+From 2627de60b603630ba8be79707766d5631d56f714 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 07:25:46 +0000
 Subject: [PATCH] builder/website: Add index validation test script.
@@ -11,10 +11,10 @@ Subject: [PATCH] builder/website: Add index validation test script.
  create mode 100755 builder/website/validate.sh
 
 diff --git a/builder/website/Makefile.am b/builder/website/Makefile.am
-index fae8c52..61234a2 100644
+index 9cec356..cf13ed4 100644
 --- a/builder/website/Makefile.am
 +++ b/builder/website/Makefile.am
-@@ -39,3 +39,7 @@ EXTRA_DIST = \
+@@ -40,3 +40,7 @@ EXTRA_DIST = \
  	ubuntu-*.*.xz.sig
  
  CLEANFILES = *~
diff --git a/0016-builder-Internal-implementation-of-parallel-xzcat-px.patch b/0016-builder-Internal-implementation-of-parallel-xzcat-px.patch
index 495c6a3..337a410 100644
--- a/0016-builder-Internal-implementation-of-parallel-xzcat-px.patch
+++ b/0016-builder-Internal-implementation-of-parallel-xzcat-px.patch
@@ -1,4 +1,4 @@
-From 1bd0129134c935e3bf0a51669c4534a56dda85fb Mon Sep 17 00:00:00 2001
+From 2eabacbc0d217ece0091dc754969f0c0df3c7eac Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 10:21:32 +0000
 Subject: [PATCH] builder: Internal implementation of parallel xzcat (pxzcat).
@@ -85,7 +85,7 @@ index 0af3f95..9430d62 100644
  	  -o $@
  
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 2940f3d..e0b724b 100644
+index a3a31e5..7dba186 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -24,6 +24,7 @@ open Common_utils
@@ -860,10 +860,10 @@ index 0000000..a2830f0
 +        implementation of parallel xzcat.  Otherwise regular xzcat is
 +        used. *)
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index b9fd69c..19dc3ea 100644
+index 71569ec..a1b2a1f 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -1396,10 +1396,9 @@ the output format is the same as the template format (usually raw).
+@@ -1420,10 +1420,9 @@ the output format is the same as the template format (usually raw).
  
  =head3 pxzcat
  
@@ -878,7 +878,7 @@ index b9fd69c..19dc3ea 100644
  =head3 User-Mode Linux
  
 diff --git a/configure.ac b/configure.ac
-index 9b5c051..78e85ae 100644
+index 35d0879..7648977 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -701,9 +701,15 @@ fi
@@ -914,7 +914,7 @@ index 5586c5c..d18bf7b 100644
 -  | "no" -> None
 -  | path -> Some path
 diff --git a/po/POTFILES b/po/POTFILES
-index aa52b75..4bf805f 100644
+index 5418a6b..1e831ff 100644
 --- a/po/POTFILES
 +++ b/po/POTFILES
 @@ -4,6 +4,7 @@ builder/index-parser-c.c
diff --git a/0017-builder-website-Add-validate.sh-test-script-to-EXTRA.patch b/0017-builder-website-Add-validate.sh-test-script-to-EXTRA.patch
index 554d15a..7f1e8e7 100644
--- a/0017-builder-website-Add-validate.sh-test-script-to-EXTRA.patch
+++ b/0017-builder-website-Add-validate.sh-test-script-to-EXTRA.patch
@@ -1,4 +1,4 @@
-From 74bb8531d33306676710de6f3013a8dd17c22912 Mon Sep 17 00:00:00 2001
+From e91cfd9900ec8efeff8692731608a1fc95917a64 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 15:15:17 +0000
 Subject: [PATCH] builder/website: Add validate.sh test script to EXTRA_DIST.
@@ -11,7 +11,7 @@ This fixes commit 154bfb7dd46e7998eed1d40ead95923590763739.
  1 file changed, 1 insertion(+)
 
 diff --git a/builder/website/Makefile.am b/builder/website/Makefile.am
-index 61234a2..dff186f 100644
+index cf13ed4..a5b1bcf 100644
 --- a/builder/website/Makefile.am
 +++ b/builder/website/Makefile.am
 @@ -21,6 +21,7 @@ EXTRA_DIST = \
diff --git a/0018-builder-Add-missing-dependency.patch b/0018-builder-Add-missing-dependency.patch
index aff8299..3cfa851 100644
--- a/0018-builder-Add-missing-dependency.patch
+++ b/0018-builder-Add-missing-dependency.patch
@@ -1,4 +1,4 @@
-From bdbc3118bff765a028164eccb7ce317f9eca776f Mon Sep 17 00:00:00 2001
+From b5889645e7c558b3d65206920235ac1ac990f509 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 15:42:05 +0000
 Subject: [PATCH] builder: Add missing dependency.
diff --git a/0019-builder-Add-some-generated-files-to-CLEANFILES.patch b/0019-builder-Add-some-generated-files-to-CLEANFILES.patch
index 3d5f204..2cc8668 100644
--- a/0019-builder-Add-some-generated-files-to-CLEANFILES.patch
+++ b/0019-builder-Add-some-generated-files-to-CLEANFILES.patch
@@ -1,4 +1,4 @@
-From 77aaa2ee468f42d27bf340876cc4084adedbd4a3 Mon Sep 17 00:00:00 2001
+From 9a97ac527afdacc07007aa1f0ec84c2a6f95b608 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 15:43:24 +0000
 Subject: [PATCH] builder: Add some generated files to CLEANFILES.
diff --git a/0020-builder-Add-dependency-from-index-parse.h-to-index-v.patch b/0020-builder-Add-dependency-from-index-parse.h-to-index-v.patch
index 769c74a..f28b038 100644
--- a/0020-builder-Add-dependency-from-index-parse.h-to-index-v.patch
+++ b/0020-builder-Add-dependency-from-index-parse.h-to-index-v.patch
@@ -1,4 +1,4 @@
-From b6a3ab9a2c2781dc371928249378191b44438329 Mon Sep 17 00:00:00 2001
+From 065d9527e1f694f99e31950b298eb5990c7c024d Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 15:56:34 +0000
 Subject: [PATCH] builder: Add dependency from index-parse.h to index-validate.
diff --git a/0021-builder-Add-dependencies-which-automake-doesn-t-gene.patch b/0021-builder-Add-dependencies-which-automake-doesn-t-gene.patch
index 943f310..243ed56 100644
--- a/0021-builder-Add-dependencies-which-automake-doesn-t-gene.patch
+++ b/0021-builder-Add-dependencies-which-automake-doesn-t-gene.patch
@@ -1,4 +1,4 @@
-From 605d3669c34efb00422b3103c08d501b216bfa3d Mon Sep 17 00:00:00 2001
+From 0d06b917f7c8fa15e397f64d964326ce22631847 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 17:40:20 +0000
 Subject: [PATCH] builder: Add dependencies which automake doesn't generate
diff --git a/0022-builder-Fail-if-bison-is-not-installed.patch b/0022-builder-Fail-if-bison-is-not-installed.patch
index 7f63661..5470ba1 100644
--- a/0022-builder-Fail-if-bison-is-not-installed.patch
+++ b/0022-builder-Fail-if-bison-is-not-installed.patch
@@ -1,4 +1,4 @@
-From 1ebe00e9725d78d882d7b47785ed7c256a8799e4 Mon Sep 17 00:00:00 2001
+From 51e511ec86c0f35363721a8912b40fc0b9c200c3 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 5 Nov 2013 22:25:59 +0000
 Subject: [PATCH] builder: Fail if bison is not installed.
@@ -11,7 +11,7 @@ This partially fixes commit a4800e2d4fc50f372a8b626333c4fbb9b8ca9633.
  1 file changed, 6 insertions(+), 1 deletion(-)
 
 diff --git a/configure.ac b/configure.ac
-index 78e85ae..595438d 100644
+index 7648977..59960c8 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -711,9 +711,14 @@ PKG_CHECK_MODULES([LIBLZMA], [liblzma],[
diff --git a/0023-builder-Fail-if-lex-is-not-installed.patch b/0023-builder-Fail-if-lex-is-not-installed.patch
index 64a3581..6c33834 100644
--- a/0023-builder-Fail-if-lex-is-not-installed.patch
+++ b/0023-builder-Fail-if-lex-is-not-installed.patch
@@ -1,4 +1,4 @@
-From f6344122357663d783581878a73c848b4f08f0b6 Mon Sep 17 00:00:00 2001
+From 50ba3ce108ccdeca327c904213094fcbdfcc51e7 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Wed, 6 Nov 2013 15:08:08 +0000
 Subject: [PATCH] builder: Fail if lex is not installed.
@@ -11,7 +11,7 @@ This completes the fix for commit a4800e2d4fc50f372a8b626333c4fbb9b8ca9633.
  1 file changed, 3 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
-index 595438d..5b4de91 100644
+index 59960c8..634f75d 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -716,6 +716,9 @@ dnl XXX Could be optional with some work.
diff --git a/0024-builder-sysprep-Allow-random-as-a-password-selector.patch b/0024-builder-sysprep-Allow-random-as-a-password-selector.patch
index 29e193e..456c6cb 100644
--- a/0024-builder-sysprep-Allow-random-as-a-password-selector.patch
+++ b/0024-builder-sysprep-Allow-random-as-a-password-selector.patch
@@ -1,4 +1,4 @@
-From 289a05aa49ae751cf763b3030eda5e3e870d724e Mon Sep 17 00:00:00 2001
+From 6c102fd01dc1cfccc0805c76ed2c333f0f3e63ee Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Thu, 21 Nov 2013 17:34:44 +0000
 Subject: [PATCH] builder/sysprep: Allow 'random' as a password selector.
@@ -15,7 +15,7 @@ This chooses a random password.
  5 files changed, 53 insertions(+), 41 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index e0b724b..541eb60 100644
+index 7dba186..473460c 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -448,31 +448,19 @@ let main () =
@@ -62,10 +62,10 @@ index e0b724b..541eb60 100644
        eprintf (f_"%s: warning: root password could not be set for this type of guest\n%!") prog in
  
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 19dc3ea..7b74bdb 100644
+index a1b2a1f..f70802b 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -705,6 +705,13 @@ Set the root password to the literal string C<PASSWORD>.
+@@ -712,6 +712,13 @@ Set the root password to the literal string C<PASSWORD>.
  B<Note: this is not secure> since any user on the same machine can
  see the cleartext password using L<ps(1)>.
  
diff --git a/0025-builder-sysprep-Allow-accounts-to-be-locked-RHBZ-102.patch b/0025-builder-sysprep-Allow-accounts-to-be-locked-RHBZ-102.patch
index aaa8c1e..bd9773d 100644
--- a/0025-builder-sysprep-Allow-accounts-to-be-locked-RHBZ-102.patch
+++ b/0025-builder-sysprep-Allow-accounts-to-be-locked-RHBZ-102.patch
@@ -1,4 +1,4 @@
-From 1766c2ef9f6fe7b87d0d6c12c80c11445d6addb7 Mon Sep 17 00:00:00 2001
+From 08ffde60906f113fa2c8d6c56efb7d7bd0b15015 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Thu, 21 Nov 2013 17:13:22 +0000
 Subject: [PATCH] builder/sysprep: Allow accounts to be locked (RHBZ#1028660).
@@ -27,7 +27,7 @@ probably not useful.  The shadow password field will contain "!!*".
  5 files changed, 100 insertions(+), 16 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 541eb60..2710f10 100644
+index 473460c..2050d10 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -458,7 +458,7 @@ let main () =
@@ -40,10 +40,10 @@ index 541eb60..2710f10 100644
        set_linux_passwords ~prog ?password_crypto g root password_map
      | _ ->
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 7b74bdb..4bb9f64 100644
+index f70802b..02b07e4 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -712,6 +712,27 @@ has approximately 120 bits of randomness.
+@@ -719,6 +719,27 @@ has approximately 120 bits of randomness.
  
  This is the default.
  
diff --git a/0026-builder-Move-is_block_device-function-into-common-ut.patch b/0026-builder-Move-is_block_device-function-into-common-ut.patch
index f15ecd5..6461b4c 100644
--- a/0026-builder-Move-is_block_device-function-into-common-ut.patch
+++ b/0026-builder-Move-is_block_device-function-into-common-ut.patch
@@ -1,4 +1,4 @@
-From 47ebaa9a6276fa94014e8955611b49a04e4b3528 Mon Sep 17 00:00:00 2001
+From 330f37c4c0937ca258595254a647c57a7e6554c2 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 13:18:48 +0000
 Subject: [PATCH] builder: Move is_block_device function into common utilities.
@@ -12,7 +12,7 @@ This is just code motion.
  2 files changed, 4 insertions(+), 3 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 2710f10..b59f6ec 100644
+index 2050d10..86e38f3 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -249,9 +249,6 @@ let main () =
@@ -26,10 +26,10 @@ index 2710f10..b59f6ec 100644
  
      let headroom = 256L *^ 1024L *^ 1024L in
 diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
-index 6497f58..3b0d9f8 100644
+index 1f8208b..357ffba 100644
 --- a/mllib/common_utils.ml
 +++ b/mllib/common_utils.ml
-@@ -391,6 +391,10 @@ let rm_rf_only_files (g : Guestfs.guestfs) dir =
+@@ -401,6 +401,10 @@ let rm_rf_only_files (g : Guestfs.guestfs) dir =
      List.iter g#rm files
    )
  
diff --git a/0027-builder-Use-a-planner-to-work-out-how-to-convert-the.patch b/0027-builder-Use-a-planner-to-work-out-how-to-convert-the.patch
index 6b76f0d..eada8b5 100644
--- a/0027-builder-Use-a-planner-to-work-out-how-to-convert-the.patch
+++ b/0027-builder-Use-a-planner-to-work-out-how-to-convert-the.patch
@@ -1,4 +1,4 @@
-From 1dfb6894138018c50534e90210f2916eab2fd842 Mon Sep 17 00:00:00 2001
+From d2327e3eff07ed25e326c52f6e3c9d22b6a61547 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 13 Dec 2013 13:18:47 +0000
 Subject: [PATCH] builder: Use a planner to work out how to convert the
@@ -41,7 +41,7 @@ index 30ada87..ca4a254 100644
  	index-scan.o \
  	index-struct.o \
 diff --git a/builder/builder.ml b/builder/builder.ml
-index b59f6ec..c0e81f5 100644
+index 86e38f3..df82707 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -22,9 +22,9 @@ module G = Guestfs
@@ -520,10 +520,10 @@ index 1103ffb..67027d2 100644
  noinst_SCRIPTS = dummy
  
 diff --git a/mllib/common_utils.ml b/mllib/common_utils.ml
-index 3b0d9f8..80c5aca 100644
+index 357ffba..3943417 100644
 --- a/mllib/common_utils.ml
 +++ b/mllib/common_utils.ml
-@@ -391,6 +391,18 @@ let rm_rf_only_files (g : Guestfs.guestfs) dir =
+@@ -401,6 +401,18 @@ let rm_rf_only_files (g : Guestfs.guestfs) dir =
      List.iter g#rm files
    )
  
diff --git a/0028-builder-planner-Handle-no-format-in-source-case-corr.patch b/0028-builder-planner-Handle-no-format-in-source-case-corr.patch
index 6b540c4..10731ef 100644
--- a/0028-builder-planner-Handle-no-format-in-source-case-corr.patch
+++ b/0028-builder-planner-Handle-no-format-in-source-case-corr.patch
@@ -1,4 +1,4 @@
-From 5a6c4921a84ff98ce200024cf997c89a7d34367b Mon Sep 17 00:00:00 2001
+From 80671be3c32a4d95801448815435f4ee708b446b Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 15:49:25 +0000
 Subject: [PATCH] builder: planner: Handle no format= in source case correctly.
@@ -9,7 +9,7 @@ Subject: [PATCH] builder: planner: Handle no format= in source case correctly.
  1 file changed, 28 insertions(+), 16 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index c0e81f5..d74251c 100644
+index df82707..f5a8df4 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -246,14 +246,16 @@ let main () =
diff --git a/0029-builder-Flush-debug-info-after-printing-it.patch b/0029-builder-Flush-debug-info-after-printing-it.patch
index 4aa601e..aa1a5e7 100644
--- a/0029-builder-Flush-debug-info-after-printing-it.patch
+++ b/0029-builder-Flush-debug-info-after-printing-it.patch
@@ -1,4 +1,4 @@
-From baa57e116113ee9e416a26ec5c41c240c6bdd2f0 Mon Sep 17 00:00:00 2001
+From 2e7013906f7e1eb6f11fe63196eb07e414cc584a Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 15:50:04 +0000
 Subject: [PATCH] builder: Flush debug info after printing it.
@@ -9,7 +9,7 @@ Subject: [PATCH] builder: Flush debug info after printing it.
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index d74251c..de229b3 100644
+index f5a8df4..5106263 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -427,7 +427,7 @@ let main () =
diff --git a/0030-builder-Add-a-test-of-the-planner.patch b/0030-builder-Add-a-test-of-the-planner.patch
index a621fdd..46bed19 100644
--- a/0030-builder-Add-a-test-of-the-planner.patch
+++ b/0030-builder-Add-a-test-of-the-planner.patch
@@ -1,4 +1,4 @@
-From f3f592d14b0362933aeeb5d7d891193529d8ce0a Mon Sep 17 00:00:00 2001
+From b50e02ca9354ebd173bc47684eaec41fa250215f Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 15:50:37 +0000
 Subject: [PATCH] builder: Add a test of the planner.
@@ -16,7 +16,7 @@ that the planner can deal with them.
  create mode 100755 builder/test-virt-builder-planner.sh
 
 diff --git a/.gitignore b/.gitignore
-index 43f9f40..b967dbd 100644
+index 4a77963..32b8662 100644
 --- a/.gitignore
 +++ b/.gitignore
 @@ -61,6 +61,7 @@ Makefile.in
diff --git a/0031-builder-tests-Fix-virt-builder-list-output.patch b/0031-builder-tests-Fix-virt-builder-list-output.patch
index e7c6eaa..425f185 100644
--- a/0031-builder-tests-Fix-virt-builder-list-output.patch
+++ b/0031-builder-tests-Fix-virt-builder-list-output.patch
@@ -1,4 +1,4 @@
-From 614cdbcbef51f222318519509e703c3cecf76f65 Mon Sep 17 00:00:00 2001
+From 44cc06949962243ac0d262a9b1c6166a7840a147 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 16:18:23 +0000
 Subject: [PATCH] builder: tests: Fix virt-builder --list output.
diff --git a/0032-builder-tests-Add-test-virt-builder-planner.sh-to-EX.patch b/0032-builder-tests-Add-test-virt-builder-planner.sh-to-EX.patch
index 3bb915f..9beba6d 100644
--- a/0032-builder-tests-Add-test-virt-builder-planner.sh-to-EX.patch
+++ b/0032-builder-tests-Add-test-virt-builder-planner.sh-to-EX.patch
@@ -1,4 +1,4 @@
-From 466ab4e0a1fe0536ed5b4c5ef7367574e34745dd Mon Sep 17 00:00:00 2001
+From c6a116452d896f8b164806ad440091732b8645f5 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 16:18:50 +0000
 Subject: [PATCH] builder: tests: Add test-virt-builder-planner.sh to
diff --git a/0033-builder-Add-a-link-to-blog-posting-about-the-planner.patch b/0033-builder-Add-a-link-to-blog-posting-about-the-planner.patch
index 15f738d..a779097 100644
--- a/0033-builder-Add-a-link-to-blog-posting-about-the-planner.patch
+++ b/0033-builder-Add-a-link-to-blog-posting-about-the-planner.patch
@@ -1,4 +1,4 @@
-From 923e23f10f10c158a92431bcc79aa704b26cb8e1 Mon Sep 17 00:00:00 2001
+From 86ac9a614d3791df16eb307f0c7fb6aef29ca0b8 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 16:43:40 +0000
 Subject: [PATCH] builder: Add a link to blog posting about the planner.
@@ -13,7 +13,7 @@ should help people to understand how this code works.
  2 files changed, 6 insertions(+), 15 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index de229b3..95896ed 100644
+index 5106263..77b18ce 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -243,6 +243,10 @@ let main () =
diff --git a/0034-builder-Only-use-virt-resize-no-sparse-when-writing-.patch b/0034-builder-Only-use-virt-resize-no-sparse-when-writing-.patch
index 58720f1..7207020 100644
--- a/0034-builder-Only-use-virt-resize-no-sparse-when-writing-.patch
+++ b/0034-builder-Only-use-virt-resize-no-sparse-when-writing-.patch
@@ -1,4 +1,4 @@
-From 4d149e883f6ff3744b8bf0ebacf049b0070fab0b Mon Sep 17 00:00:00 2001
+From 7b618e1d4da8407652f74a5a7d466ff50bcb71b7 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 18:53:20 +0000
 Subject: [PATCH] builder: Only use virt-resize --no-sparse when writing to a
@@ -16,7 +16,7 @@ device.
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 95896ed..975284d 100644
+index 77b18ce..5c2b27a 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -491,7 +491,7 @@ let main () =
diff --git a/0035-builder-Refuse-to-write-to-a-char-device-or-dev-null.patch b/0035-builder-Refuse-to-write-to-a-char-device-or-dev-null.patch
index f5c9a5b..f4a16ff 100644
--- a/0035-builder-Refuse-to-write-to-a-char-device-or-dev-null.patch
+++ b/0035-builder-Refuse-to-write-to-a-char-device-or-dev-null.patch
@@ -1,4 +1,4 @@
-From b067259923b36ece95c5ad3e1e3c32cef649a58e Mon Sep 17 00:00:00 2001
+From 9fdc0f1303626742595e8d25a3359736037204df Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sat, 14 Dec 2013 18:54:56 +0000
 Subject: [PATCH] builder: Refuse to write to a char device or /dev/null.
@@ -13,7 +13,7 @@ prevent it happening.
  1 file changed, 5 insertions(+)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 975284d..019fd23 100644
+index 5c2b27a..5947667 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -279,6 +279,11 @@ let main () =
diff --git a/0036-builder-Remove-blank-line.patch b/0036-builder-Remove-blank-line.patch
index 0189717..c7938eb 100644
--- a/0036-builder-Remove-blank-line.patch
+++ b/0036-builder-Remove-blank-line.patch
@@ -1,4 +1,4 @@
-From b7d2d32be242115149f8831fdd028822fc9f2c9b Mon Sep 17 00:00:00 2001
+From aeebf2b7118591ed0588c394adfcb1c75f350cef Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Mon, 16 Dec 2013 14:14:01 +0000
 Subject: [PATCH] builder: Remove blank line.
@@ -9,7 +9,7 @@ Subject: [PATCH] builder: Remove blank line.
  1 file changed, 1 deletion(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 019fd23..66a3823 100644
+index 5947667..f6e3595 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -56,7 +56,6 @@ let main () =
diff --git a/0037-builder-Add-update-option-to-update-template-core-pa.patch b/0037-builder-Add-update-option-to-update-template-core-pa.patch
index 197d9cb..3878e90 100644
--- a/0037-builder-Add-update-option-to-update-template-core-pa.patch
+++ b/0037-builder-Add-update-option-to-update-template-core-pa.patch
@@ -1,4 +1,4 @@
-From 545f557603ac96e1f655dfe4a4f797a5975de697 Mon Sep 17 00:00:00 2001
+From ec21401178ef8ac0b1b2ebf5d9e4680bf16c4665 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Thu, 19 Dec 2013 11:17:43 +0000
 Subject: [PATCH] builder: Add --update option to update template/core
@@ -12,7 +12,7 @@ Subject: [PATCH] builder: Add --update option to update template/core
  3 files changed, 90 insertions(+), 22 deletions(-)
 
 diff --git a/builder/builder.ml b/builder/builder.ml
-index 66a3823..07c2b02 100644
+index f6e3595..0f8e069 100644
 --- a/builder/builder.ml
 +++ b/builder/builder.ml
 @@ -39,7 +39,7 @@ let main () =
@@ -79,7 +79,7 @@ index 66a3823..07c2b02 100644
    if install <> [] then (
      msg (f_"Installing packages: %s") (String.concat " " install);
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index 632b227..c6a3cd8 100644
+index b4e21fc..f25280c 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -169,6 +169,7 @@ let parse_cmdline () =
@@ -113,10 +113,10 @@ index 632b227..c6a3cd8 100644
 -  scrub_logfile, size, smp, sources, sync, upload, writes
 +  scrub_logfile, size, smp, sources, sync, update, upload, writes
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 4bb9f64..09315e4 100644
+index 02b07e4..f72e284 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -17,6 +17,7 @@ virt-builder - Build virtual machine images quickly
+@@ -18,6 +18,7 @@ virt-builder - Build virtual machine images quickly
      [--attach ISOFILE]
      [--root-password SELECTOR]
      [--hostname HOSTNAME]
@@ -142,7 +142,7 @@ index 4bb9f64..09315e4 100644
  =item B<-l>
  
  =item B<--list>
-@@ -577,6 +580,14 @@ Note that you should not point I<--source> to sources that you don't
+@@ -580,6 +583,14 @@ Note that you should not point I<--source> to sources that you don't
  trust (unless the source is signed by someone you do trust).  See also
  the I<--no-network> option.
  
@@ -157,7 +157,7 @@ index 4bb9f64..09315e4 100644
  =item B<--upload> FILE:DEST
  
  Upload local file C<FILE> to destination C<DEST> in the disk image.
-@@ -631,6 +642,18 @@ you can use I<--install> to install packages like this:
+@@ -634,6 +645,18 @@ you can use I<--install> to install packages like this:
  This uses the guest's package manager and the host's network
  connection.
  
@@ -176,7 +176,7 @@ index 4bb9f64..09315e4 100644
  =head3 Installing packages at first boot
  
  Another option is to install the packages when the guest first boots:
-@@ -750,8 +773,8 @@ are other ways to manage passwords, see L<useradd(8)> for details.
+@@ -757,8 +780,8 @@ are other ways to manage passwords, see L<useradd(8)> for details.
  =head2 LOG FILE
  
  Scripts and package installation that runs at build time (I<--run>,
@@ -187,7 +187,7 @@ index 4bb9f64..09315e4 100644
  
  =over 4
  
-@@ -816,6 +839,10 @@ The root password is changed (I<--root-password>).
+@@ -823,6 +846,10 @@ The root password is changed (I<--root-password>).
  
  =item *
  
@@ -198,7 +198,7 @@ index 4bb9f64..09315e4 100644
  Packages are installed (I<--install>).
  
  =item *
-@@ -1318,9 +1345,9 @@ are not cached.
+@@ -1342,9 +1369,9 @@ are not cached.
  
  Virt-builder uses L<curl(1)> to download files and it also uses the
  current C<http_proxy> (etc) settings when installing packages
@@ -211,7 +211,7 @@ index 4bb9f64..09315e4 100644
  
  =head2 DIGITAL SIGNATURES
  
-@@ -1355,8 +1382,8 @@ host architecture is.  For example an x86-64 guest on an ARM host.
+@@ -1379,8 +1406,8 @@ host architecture is.  For example an x86-64 guest on an ARM host.
  
  However certain options may not work correctly, specifically options
  that require running commands in the guest during the build process:
@@ -222,7 +222,7 @@ index 4bb9f64..09315e4 100644
  
  An x86-64 host building 32 bit i686 guests should work without any
  special steps.
-@@ -1366,11 +1393,11 @@ special steps.
+@@ -1390,11 +1417,11 @@ special steps.
  Virt-builder does not need to run as root (in fact, should not be run
  as root), and doesn't use setuid, C<sudo> or any similar mechanism.
  
@@ -239,7 +239,7 @@ index 4bb9f64..09315e4 100644
  
  However these options will have access to the host's network and since
  the template may contain untrusted code, the code might try to access
-@@ -1393,13 +1420,13 @@ Templates gets downloaded into the cache the first time they are used,
+@@ -1417,13 +1444,13 @@ Templates gets downloaded into the cache the first time they are used,
  or if you use the I<--cache-all-templates> option.  See L</CACHING>
  above for further information.
  
diff --git a/0038-launch-libvirt-Don-t-default-to-using-NULL-for-libvi.patch b/0038-launch-libvirt-Don-t-default-to-using-NULL-for-libvi.patch
index bc4b5e6..1fd5cf5 100644
--- a/0038-launch-libvirt-Don-t-default-to-using-NULL-for-libvi.patch
+++ b/0038-launch-libvirt-Don-t-default-to-using-NULL-for-libvi.patch
@@ -1,4 +1,4 @@
-From 7e9e44f84f2ab98a095633ff4fb8da36a7f68d3b Mon Sep 17 00:00:00 2001
+From 5482bfb88f6c07675f4ca9073d0f3faca733fc15 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Thu, 19 Dec 2013 14:22:26 +0000
 Subject: [PATCH] launch: libvirt: Don't default to using NULL for libvirt
@@ -67,7 +67,7 @@ index 6909b50..1931055 100644
  The libvirt backend supports more features, including
  hotplugging (see L</HOTPLUGGING>) and sVirt.
 diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
-index 6b81d8b..e0506e4 100644
+index b78590a..729f437 100644
 --- a/src/launch-libvirt.c
 +++ b/src/launch-libvirt.c
 @@ -216,6 +216,16 @@ launch_libvirt (guestfs_h *g, void *datav, const char *libvirt_uri)
diff --git a/0043-builder-Fix-handling-of-size-parameter.patch b/0039-builder-Fix-handling-of-size-parameter.patch
similarity index 98%
rename from 0043-builder-Fix-handling-of-size-parameter.patch
rename to 0039-builder-Fix-handling-of-size-parameter.patch
index da887fc..78f8e57 100644
--- a/0043-builder-Fix-handling-of-size-parameter.patch
+++ b/0039-builder-Fix-handling-of-size-parameter.patch
@@ -1,4 +1,4 @@
-From f60ef10973d1bdc0df93603d5667d0528eeb0dd0 Mon Sep 17 00:00:00 2001
+From 4a6606e18882c7dfd8de84b2a081e8c6caeadcd4 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Tue, 7 Jan 2014 17:32:04 +0000
 Subject: [PATCH] builder: Fix handling of --size parameter.
diff --git a/0044-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch b/0040-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
similarity index 98%
rename from 0044-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
rename to 0040-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
index 181b3f1..bf09a35 100644
--- a/0044-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
+++ b/0040-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
@@ -1,4 +1,4 @@
-From 816462383a0cc7827177e97bbe4de775950b1aac Mon Sep 17 00:00:00 2001
+From a9da4193cf0c11b85d24f088458224be129cd550 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Thu, 2 Jan 2014 12:20:18 +0000
 Subject: [PATCH] libvirt-auth: Provide a friendlier wrapper around
diff --git a/0045-tests-Add-a-regression-test-of-libvirt-authenticatio.patch b/0041-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
similarity index 98%
rename from 0045-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
rename to 0041-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
index f3ddba1..66b6f41 100644
--- a/0045-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
+++ b/0041-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
@@ -1,4 +1,4 @@
-From 4f769c49cbd8e89f0e143b153357725327fb69d5 Mon Sep 17 00:00:00 2001
+From 76ce46c587e5e8ec45acc10b6578a59b9651d454 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Wed, 8 Jan 2014 19:36:00 +0000
 Subject: [PATCH] tests: Add a regression test of libvirt authentication
@@ -18,10 +18,10 @@ https://www.redhat.com/archives/libvir-list/2014-January/msg00378.html
  create mode 100644 tests/events/test-libvirt-auth-callbacks.c
 
 diff --git a/.gitignore b/.gitignore
-index b967dbd..b44af29 100644
+index 32b8662..3d429de 100644
 --- a/.gitignore
 +++ b/.gitignore
-@@ -461,6 +461,7 @@ Makefile.in
+@@ -462,6 +462,7 @@ Makefile.in
  /tests/data/initrd-x86_64.img.gz
  /tests/data/test-grep.txt.gz
  /tests/data/test.iso
diff --git a/0046-tests-Add-a-regression-test-for-libvirt-authenticati.patch b/0042-tests-Add-a-regression-test-for-libvirt-authenticati.patch
similarity index 93%
rename from 0046-tests-Add-a-regression-test-for-libvirt-authenticati.patch
rename to 0042-tests-Add-a-regression-test-for-libvirt-authenticati.patch
index 5583398..b6ca4e3 100644
--- a/0046-tests-Add-a-regression-test-for-libvirt-authenticati.patch
+++ b/0042-tests-Add-a-regression-test-for-libvirt-authenticati.patch
@@ -1,4 +1,4 @@
-From d4938044d2be6f8ed90022fb7ca9378378f2604b Mon Sep 17 00:00:00 2001
+From 3323012c8d90c570770049d6f68f6fb686fa0166 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Wed, 8 Jan 2014 20:22:21 +0000
 Subject: [PATCH] tests: Add a regression test for libvirt authentication
@@ -21,24 +21,24 @@ This tests the virConnectAuthPtrDefault wrapper path.
  create mode 100644 tests/regressions/rhbz1044014.xml
 
 diff --git a/.gitignore b/.gitignore
-index b44af29..90cd68b 100644
+index 3d429de..985795f 100644
 --- a/.gitignore
 +++ b/.gitignore
-@@ -483,6 +483,8 @@ Makefile.in
+@@ -484,6 +484,8 @@ Makefile.in
  /tests/regressions/rhbz501893
  /tests/regressions/rhbz790721
  /tests/regressions/rhbz914931
 +/tests/regressions/rhbz1044014
 +/tests/regressions/rhbz1044014.out
+ /tests/regressions/rhbz1055452
  /tests/rsync/rsyncd.pid
  /tests/syslinux/extlinux-guest.img
- /tests/syslinux/syslinux-guest.img
 diff --git a/tests/regressions/Makefile.am b/tests/regressions/Makefile.am
-index 1b0fb69..8051c14 100644
+index 97bc64e..3cd121a 100644
 --- a/tests/regressions/Makefile.am
 +++ b/tests/regressions/Makefile.am
-@@ -36,6 +36,10 @@ TESTS = \
- 	rhbz1001875.sh \
+@@ -37,6 +37,10 @@ TESTS = \
+ 	rhbz1055452 \
  	test-noexec-stack.pl
  
 +if HAVE_LIBVIRT
@@ -48,9 +48,9 @@ index 1b0fb69..8051c14 100644
  tests_not_run = \
  	rhbz727178.sh \
  	rhbz909624.sh
-@@ -49,6 +53,10 @@ check_PROGRAMS = \
- 	rhbz790721 \
- 	rhbz914931
+@@ -51,6 +55,10 @@ check_PROGRAMS = \
+ 	rhbz914931 \
+ 	rhbz1055452
  
 +if HAVE_LIBVIRT
 +check_PROGRAMS += rhbz1044014
@@ -59,7 +59,7 @@ index 1b0fb69..8051c14 100644
  rhbz501893_SOURCES = rhbz501893.c
  rhbz501893_CPPFLAGS = \
  	-I$(top_srcdir)/src -I$(top_builddir)/src
-@@ -79,11 +87,30 @@ rhbz914931_CFLAGS = \
+@@ -81,6 +89,23 @@ rhbz914931_CFLAGS = \
  rhbz914931_LDADD = \
  	$(top_builddir)/src/libguestfs.la
  
@@ -80,7 +80,10 @@ index 1b0fb69..8051c14 100644
 +        $(top_builddir)/gnulib/lib/libgnu.la
 +endif
 +
- EXTRA_DIST = \
+ rhbz1055452_SOURCES = rhbz1055452.c
+ rhbz1055452_CPPFLAGS = \
+ 	-I$(top_srcdir)/src -I$(top_builddir)/src \
+@@ -96,7 +121,9 @@ EXTRA_DIST = \
  	$(TESTS) \
  	$(tests_not_run) \
  	rhbz557655-expected.stdout \
diff --git a/0047-sysprep-builder-Add-timezone-option-to-set-timezone-.patch b/0043-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
similarity index 98%
rename from 0047-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
rename to 0043-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
index 83355cf..3c44135 100644
--- a/0047-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
+++ b/0043-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
@@ -1,4 +1,4 @@
-From 441fc2a889d8e1196f2f364f66e465b67984a828 Mon Sep 17 00:00:00 2001
+From 076cffb5802a01a2908fcc8d0f20b1331e3d4bf5 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 10 Jan 2014 12:12:30 +0000
 Subject: [PATCH] sysprep, builder: Add --timezone option to set timezone of
@@ -70,7 +70,7 @@ index f007b46..90300a3 100644
     * Note 'None' means that we randomize the root password.
     *)
 diff --git a/builder/cmdline.ml b/builder/cmdline.ml
-index c6a3cd8..99412bb 100644
+index f25280c..813fbd8 100644
 --- a/builder/cmdline.ml
 +++ b/builder/cmdline.ml
 @@ -169,6 +169,10 @@ let parse_cmdline () =
@@ -120,10 +120,10 @@ index 438f2e9..8d2766a 100755
      --mkdir /etc/foo/bar/baz \
      --write '/etc/foo/bar/baz/foo:Hello World' \
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index c3f685c..a703346 100644
+index f72e284..3558119 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -17,6 +17,7 @@ virt-builder - Build virtual machine images quickly
+@@ -18,6 +18,7 @@ virt-builder - Build virtual machine images quickly
      [--attach ISOFILE]
      [--root-password SELECTOR]
      [--hostname HOSTNAME]
@@ -143,7 +143,7 @@ index c3f685c..a703346 100644
  =item B<--update>
  
  Do the equivalent of C<yum update>, C<apt-get upgrade>, or whatever
-@@ -834,7 +840,7 @@ A new random seed is generated for the guest.
+@@ -838,7 +844,7 @@ A new random seed is generated for the guest.
  
  =item *
  
diff --git a/0049-builder-Document-how-to-change-keyboard-layout.patch b/0044-builder-Document-how-to-change-keyboard-layout.patch
similarity index 93%
rename from 0049-builder-Document-how-to-change-keyboard-layout.patch
rename to 0044-builder-Document-how-to-change-keyboard-layout.patch
index fafd728..59063d5 100644
--- a/0049-builder-Document-how-to-change-keyboard-layout.patch
+++ b/0044-builder-Document-how-to-change-keyboard-layout.patch
@@ -1,4 +1,4 @@
-From cace864fa0bd50a00aeb6df62bb34cf441d25281 Mon Sep 17 00:00:00 2001
+From 742a5e9fa5efdc5ba406687690c0d68a39fa7d45 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 10 Jan 2014 14:21:17 +0000
 Subject: [PATCH] builder: Document how to change keyboard layout.
@@ -14,10 +14,10 @@ using --run-command, --edit etc.
  1 file changed, 40 insertions(+)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 6db3dd9..f81c556 100644
+index 3558119..7d91daf 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -779,6 +779,46 @@ The above command will create an C<rjones> account with no password,
+@@ -783,6 +783,46 @@ The above command will create an C<rjones> account with no password,
  and force the user to set a password when they first log in.  There
  are other ways to manage passwords, see L<useradd(8)> for details.
  
diff --git a/0051-builder-Add-link-option-for-creating-symbolic-links.patch b/0045-builder-Add-link-option-for-creating-symbolic-links.patch
similarity index 95%
rename from 0051-builder-Add-link-option-for-creating-symbolic-links.patch
rename to 0045-builder-Add-link-option-for-creating-symbolic-links.patch
index 36bbb3f..44621ee 100644
--- a/0051-builder-Add-link-option-for-creating-symbolic-links.patch
+++ b/0045-builder-Add-link-option-for-creating-symbolic-links.patch
@@ -1,4 +1,4 @@
-From 289e050b75532cce6bfb9d75a8646f02b189b44f Mon Sep 17 00:00:00 2001
+From 7087b9287f9381af0e16b14bcedefaa9b2776f0a Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 10 Jan 2014 21:18:07 +0000
 Subject: [PATCH] builder: Add --link option for creating symbolic links.
@@ -106,10 +106,10 @@ index 8d2766a..47d20a4 100755
      --firstboot-install "minicom,inkscape"
  
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index f81c556..584a0e0 100644
+index 7d91daf..3405c62 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -23,6 +23,7 @@ virt-builder - Build virtual machine images quickly
+@@ -24,6 +24,7 @@ virt-builder - Build virtual machine images quickly
      [--mkdir DIR]
      [--write FILE:CONTENT]
      [--upload FILE:DEST]
@@ -131,7 +131,7 @@ index f81c556..584a0e0 100644
  =item B<-l>
  
  =item B<--list>
-@@ -916,6 +924,10 @@ Files are deleted (I<--delete>, I<--scrub>).
+@@ -920,6 +928,10 @@ Files are deleted (I<--delete>, I<--scrub>).
  
  =item *
  
diff --git a/0052-builder-Document-how-to-change-the-language-locale-o.patch b/0046-builder-Document-how-to-change-the-language-locale-o.patch
similarity index 91%
rename from 0052-builder-Document-how-to-change-the-language-locale-o.patch
rename to 0046-builder-Document-how-to-change-the-language-locale-o.patch
index 715ee48..cfc21c7 100644
--- a/0052-builder-Document-how-to-change-the-language-locale-o.patch
+++ b/0046-builder-Document-how-to-change-the-language-locale-o.patch
@@ -1,4 +1,4 @@
-From 67d5d90d6d5f8a983ddd39616f0e2d43ba4e326d Mon Sep 17 00:00:00 2001
+From fd4138919f32d4cc0b9d3fa0007b8c327afff29a Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 10 Jan 2014 19:48:28 +0000
 Subject: [PATCH] builder: Document how to change the language/locale of a new
@@ -10,10 +10,10 @@ Subject: [PATCH] builder: Document how to change the language/locale of a new
  1 file changed, 30 insertions(+)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 584a0e0..031f3d7 100644
+index 3405c62..6d1e25f 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -827,6 +827,36 @@ I<--edit> options.  For example:
+@@ -831,6 +831,36 @@ I<--edit> options.  For example:
  
  See L<https://wiki.debian.org/Keyboard>.
  
diff --git a/0053-builder-Document-how-to-set-up-local-mirrors-for-per.patch b/0047-builder-Document-how-to-set-up-local-mirrors-for-per.patch
similarity index 92%
rename from 0053-builder-Document-how-to-set-up-local-mirrors-for-per.patch
rename to 0047-builder-Document-how-to-set-up-local-mirrors-for-per.patch
index 91ca3f5..612524d 100644
--- a/0053-builder-Document-how-to-set-up-local-mirrors-for-per.patch
+++ b/0047-builder-Document-how-to-set-up-local-mirrors-for-per.patch
@@ -1,4 +1,4 @@
-From 20adf1506b99ae4c7a2ed901e6d14ba83e017325 Mon Sep 17 00:00:00 2001
+From 9170c90b419162ba3c234d83cb679c3dba801152 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Fri, 10 Jan 2014 19:49:02 +0000
 Subject: [PATCH] builder: Document how to set up local mirrors for performance
@@ -10,10 +10,10 @@ Subject: [PATCH] builder: Document how to set up local mirrors for performance
  1 file changed, 49 insertions(+), 3 deletions(-)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 031f3d7..000dfae 100644
+index 6d1e25f..2ee6db9 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -1410,6 +1410,8 @@ The index is always encoded in UTF-8.
+@@ -1431,6 +1431,8 @@ The index is always encoded in UTF-8.
  
  =head2 CACHING
  
@@ -22,7 +22,7 @@ index 031f3d7..000dfae 100644
  Since the templates are usually very large, downloaded templates are
  cached in the user's home directory.
  
-@@ -1434,11 +1436,55 @@ To disable the template cache, use I<--no-cache>.
+@@ -1455,11 +1457,55 @@ To disable the template cache, use I<--no-cache>.
  Only templates are cached.  The index and detached digital signatures
  are not cached.
  
diff --git a/0055-builder-Document-how-to-set-Japanese-language-suppor.patch b/0048-builder-Document-how-to-set-Japanese-language-suppor.patch
similarity index 92%
rename from 0055-builder-Document-how-to-set-Japanese-language-suppor.patch
rename to 0048-builder-Document-how-to-set-Japanese-language-suppor.patch
index 0e61be3..dd6a7b0 100644
--- a/0055-builder-Document-how-to-set-Japanese-language-suppor.patch
+++ b/0048-builder-Document-how-to-set-Japanese-language-suppor.patch
@@ -1,4 +1,4 @@
-From bf1c985746c136b39ed0a60817242731a09d2a19 Mon Sep 17 00:00:00 2001
+From 1db9c09f74eea29cc7b23469b3c711ff623744c3 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sun, 12 Jan 2014 17:06:02 +0000
 Subject: [PATCH] builder: Document how to set Japanese language support in
@@ -12,10 +12,10 @@ This updates/fixes commit 7e8ad13e863a5c87e3da47288bcecdb88ca0e4cb.
  1 file changed, 7 insertions(+), 11 deletions(-)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index c1adfa8..f7eb9e9 100644
+index 2ee6db9..4f57d20 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -831,31 +831,27 @@ See L<https://wiki.debian.org/Keyboard>.
+@@ -835,31 +835,27 @@ See L<https://wiki.debian.org/Keyboard>.
  
  Most Linux distributions support multiple locale settings so that you
  can have guest messages printed in another language such as Russian.
diff --git a/0056-builder-Fix-virt-builder-test.patch b/0049-builder-Fix-virt-builder-test.patch
similarity index 95%
rename from 0056-builder-Fix-virt-builder-test.patch
rename to 0049-builder-Fix-virt-builder-test.patch
index db00860..7343de7 100644
--- a/0056-builder-Fix-virt-builder-test.patch
+++ b/0049-builder-Fix-virt-builder-test.patch
@@ -1,4 +1,4 @@
-From d3dcc80c16b3731fefcde76659661b44b1bb881b Mon Sep 17 00:00:00 2001
+From 43de2c5184fbc73ea6e2a9c0f057044a6d841c4b Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Sun, 12 Jan 2014 17:49:48 +0000
 Subject: [PATCH] builder: Fix virt-builder test.
diff --git a/0058-builder-Document-how-to-set-Japanese-in-Debian-7.patch b/0050-builder-Document-how-to-set-Japanese-in-Debian-7.patch
similarity index 89%
rename from 0058-builder-Document-how-to-set-Japanese-in-Debian-7.patch
rename to 0050-builder-Document-how-to-set-Japanese-in-Debian-7.patch
index 59d4943..ead863a 100644
--- a/0058-builder-Document-how-to-set-Japanese-in-Debian-7.patch
+++ b/0050-builder-Document-how-to-set-Japanese-in-Debian-7.patch
@@ -1,4 +1,4 @@
-From 101d659c5ffe663ba9ea59cbb31c9c7321c5876b Mon Sep 17 00:00:00 2001
+From 510ff9fec3653b54663749adc1dd653f170ba328 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Mon, 13 Jan 2014 16:19:51 +0000
 Subject: [PATCH] builder: Document how to set Japanese in Debian 7.
@@ -9,10 +9,10 @@ Subject: [PATCH] builder: Document how to set Japanese in Debian 7.
  1 file changed, 21 insertions(+)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index f7eb9e9..9ec9440 100644
+index 4f57d20..3972391 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -853,6 +853,27 @@ This section contains examples for some common Linux distributions.
+@@ -857,6 +857,27 @@ This section contains examples for some common Linux distributions.
     --firstboot-command 'localectl set-keymap jp' \
     --firstboot-command 'systemctl isolate graphical.target'
  
diff --git a/0061-builder-Add-no-delete-on-failure-option-to-aid-debug.patch b/0051-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
similarity index 96%
rename from 0061-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
rename to 0051-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
index 386cd5a..93b475a 100644
--- a/0061-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
+++ b/0051-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
@@ -1,4 +1,4 @@
-From ed25594dca1d263048f2accd04ab415b77fbbe27 Mon Sep 17 00:00:00 2001
+From 274c1063ef59156570196b55e1549cbecf216c38 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Mon, 13 Jan 2014 20:29:50 +0000
 Subject: [PATCH] builder: Add --no-delete-on-failure option to aid debugging.
@@ -83,7 +83,7 @@ index 58e8a6b..67b142a 100644
    network, output, password_crypto, quiet, root_password, scrub,
    scrub_logfile, size, smp, sources, sync, timezone, update, upload,
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 1e5b9bb..366ff76 100644
+index 3972391..81db516 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
 @@ -250,6 +250,15 @@ See also: I<--upload>, I<--scrub>.
@@ -102,7 +102,7 @@ index 1e5b9bb..366ff76 100644
  =item B<--edit> FILE:EXPR
  
  Edit C<FILE> using the Perl expression C<EXPR>.
-@@ -1048,8 +1057,12 @@ chosen.  It will be C<raw> unless the I<--format> option was used.
+@@ -1065,8 +1074,12 @@ chosen.  It will be C<raw> unless the I<--format> option was used.
  
  =head2 DEBUGGING BUILDS
  
diff --git a/0062-builder-For-performance-recommend-using-the-no-sync-.patch b/0052-builder-For-performance-recommend-using-the-no-sync-.patch
similarity index 84%
rename from 0062-builder-For-performance-recommend-using-the-no-sync-.patch
rename to 0052-builder-For-performance-recommend-using-the-no-sync-.patch
index ed8f412..c72bd89 100644
--- a/0062-builder-For-performance-recommend-using-the-no-sync-.patch
+++ b/0052-builder-For-performance-recommend-using-the-no-sync-.patch
@@ -1,4 +1,4 @@
-From b04ada9b37eb1296800c212bcda4382872cece90 Mon Sep 17 00:00:00 2001
+From caaed7ea75b82f89aec818bf000fe476febe118f Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Mon, 13 Jan 2014 20:42:48 +0000
 Subject: [PATCH] builder: For performance, recommend using the --no-sync
@@ -10,10 +10,10 @@ Subject: [PATCH] builder: For performance, recommend using the --no-sync
  1 file changed, 5 insertions(+)
 
 diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
-index 366ff76..6130036 100644
+index 81db516..9cbfbab 100644
 --- a/builder/virt-builder.pod
 +++ b/builder/virt-builder.pod
-@@ -1599,6 +1599,11 @@ downloaded once.  You can also try using a local package repository,
+@@ -1616,6 +1616,11 @@ downloaded once.  You can also try using a local package repository,
  although this can be complex to set up and varies according to which
  Linux distro you are trying to install.
  
diff --git a/0063-builder-planner-Whitespace-change.patch b/0053-builder-planner-Whitespace-change.patch
similarity index 96%
rename from 0063-builder-planner-Whitespace-change.patch
rename to 0053-builder-planner-Whitespace-change.patch
index 67ef993..3eaedec 100644
--- a/0063-builder-planner-Whitespace-change.patch
+++ b/0053-builder-planner-Whitespace-change.patch
@@ -1,4 +1,4 @@
-From 586776330a7bf48f0338b9186822cbd67f98e07c Mon Sep 17 00:00:00 2001
+From f1690a36e0bf84d1ed2f85c209d4b0fd6c25f1a2 Mon Sep 17 00:00:00 2001
 From: "Richard W.M. Jones" <rjones at redhat.com>
 Date: Mon, 13 Jan 2014 20:58:08 +0000
 Subject: [PATCH] builder: planner: Whitespace change.
diff --git a/0054-daemon-xattr-simplify-the-enabling-of-the-linuxxattr.patch b/0054-daemon-xattr-simplify-the-enabling-of-the-linuxxattr.patch
new file mode 100644
index 0000000..1800f5a
--- /dev/null
+++ b/0054-daemon-xattr-simplify-the-enabling-of-the-linuxxattr.patch
@@ -0,0 +1,142 @@
+From aa4b2af3d6b1936b2fdd37290a6db4262ed115d0 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Thu, 9 Jan 2014 18:59:19 +0100
+Subject: [PATCH] daemon: xattr: simplify the enabling of the linuxxattrs
+ features
+
+Instead of enable them when having one of the two headers for it but
+still checking for the HAVE_* availability of each *xattr() function
+used, just enable the linuxxattrs as a whole when having any of the
+needed headers (like before) and all the needed functions.
+
+This might cause the linuxxattrs to not be available anymore on systems
+without the whole set of *xattr() functions implemented, but OTOH it
+simplifies the xattr.c implementations.
+
+(cherry picked from commit 7630a7bbbdceee8e6aad08511e752f5fcb273416)
+---
+ daemon/xattr.c | 49 +++++++++++--------------------------------------
+ 1 file changed, 11 insertions(+), 38 deletions(-)
+
+diff --git a/daemon/xattr.c b/daemon/xattr.c
+index 7004566..2f642db 100644
+--- a/daemon/xattr.c
++++ b/daemon/xattr.c
+@@ -27,7 +27,15 @@
+ #include "actions.h"
+ #include "optgroups.h"
+ 
+-#if defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_XATTR_H)
++#if (defined(HAVE_ATTR_XATTR_H) || defined(HAVE_SYS_XATTR_H)) && \
++    defined(HAVE_LISTXATTR) && defined(HAVE_LLISTXATTR) && \
++    defined(HAVE_GETXATTR) && defined(HAVE_LGETXATTR) && \
++    defined(HAVE_REMOVEXATTR) && defined(HAVE_LREMOVEXATTR) && \
++    defined(HAVE_SETXATTR) && defined(HAVE_LSETXATTR)
++# define HAVE_LINUX_XATTRS
++#endif
++
++#ifdef HAVE_LINUX_XATTRS
+ 
+ # ifdef HAVE_ATTR_XATTR_H
+ #  include <attr/xattr.h>
+@@ -50,67 +58,37 @@ static int _removexattr (const char *xattr, const char *path, int (*removexattr)
+ guestfs_int_xattr_list *
+ do_getxattrs (const char *path)
+ {
+-#if defined(HAVE_LISTXATTR) && defined(HAVE_GETXATTR)
+   return getxattrs (path, listxattr, getxattr);
+-#else
+-  reply_with_error ("no support for listxattr and getxattr");
+-  return NULL;
+-#endif
+ }
+ 
+ guestfs_int_xattr_list *
+ do_lgetxattrs (const char *path)
+ {
+-#if defined(HAVE_LLISTXATTR) && defined(HAVE_LGETXATTR)
+   return getxattrs (path, llistxattr, lgetxattr);
+-#else
+-  reply_with_error ("no support for llistxattr and lgetxattr");
+-  return NULL;
+-#endif
+ }
+ 
+ int
+ do_setxattr (const char *xattr, const char *val, int vallen, const char *path)
+ {
+-#if defined(HAVE_SETXATTR)
+   return _setxattr (xattr, val, vallen, path, setxattr);
+-#else
+-  reply_with_error ("no support for setxattr");
+-  return -1;
+-#endif
+ }
+ 
+ int
+ do_lsetxattr (const char *xattr, const char *val, int vallen, const char *path)
+ {
+-#if defined(HAVE_LSETXATTR)
+   return _setxattr (xattr, val, vallen, path, lsetxattr);
+-#else
+-  reply_with_error ("no support for lsetxattr");
+-  return -1;
+-#endif
+ }
+ 
+ int
+ do_removexattr (const char *xattr, const char *path)
+ {
+-#if defined(HAVE_REMOVEXATTR)
+   return _removexattr (xattr, path, removexattr);
+-#else
+-  reply_with_error ("no support for removexattr");
+-  return -1;
+-#endif
+ }
+ 
+ int
+ do_lremovexattr (const char *xattr, const char *path)
+ {
+-#if defined(HAVE_LREMOVEXATTR)
+   return _removexattr (xattr, path, lremovexattr);
+-#else
+-  reply_with_error ("no support for lremovexattr");
+-  return -1;
+-#endif
+ }
+ 
+ static guestfs_int_xattr_list *
+@@ -262,7 +240,6 @@ _removexattr (const char *xattr, const char *path,
+ guestfs_int_xattr_list *
+ do_internal_lxattrlist (const char *path, char *const *names)
+ {
+-#if defined(HAVE_LLISTXATTR) && defined(HAVE_LGETXATTR)
+   guestfs_int_xattr_list *ret = NULL;
+   size_t i, j;
+   size_t k, m, nr_attrs;
+@@ -425,10 +402,6 @@ do_internal_lxattrlist (const char *path, char *const *names)
+     free (ret);
+   }
+   return NULL;
+-#else
+-  reply_with_error ("no support for llistxattr and lgetxattr");
+-  return NULL;
+-#endif
+ }
+ 
+ char *
+@@ -527,8 +500,8 @@ do_lgetxattr (const char *path, const char *name, size_t *size_r)
+   return buf; /* caller frees */
+ }
+ 
+-#else /* no xattr.h */
++#else /* no HAVE_LINUX_XATTRS */
+ 
+ OPTGROUP_LINUXXATTRS_NOT_AVAILABLE
+ 
+-#endif /* no xattr.h */
++#endif /* no HAVE_LINUX_XATTRS */
+-- 
+1.8.4.2
+
diff --git a/0055-daemon-xattr-move-the-listxattrs-code-in-an-own-func.patch b/0055-daemon-xattr-move-the-listxattrs-code-in-an-own-func.patch
new file mode 100644
index 0000000..3980f02
--- /dev/null
+++ b/0055-daemon-xattr-move-the-listxattrs-code-in-an-own-func.patch
@@ -0,0 +1,108 @@
+From 3451e68c1599bb3ebd9cfb2be37be81a3a6d7774 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Fri, 10 Jan 2014 15:10:03 +0100
+Subject: [PATCH] daemon: xattr: move the listxattrs code in an own function
+
+Move in an own function the code that does the (l)listxattrs allocating
+the buffer of the right legth, as it will be useful later.
+
+No functional changes, just code motion.
+
+(cherry picked from commit 59d8cf62cb67688cea42a985029adea874f0b7a2)
+---
+ daemon/xattr.c | 64 ++++++++++++++++++++++++++++++++++++++++------------------
+ 1 file changed, 44 insertions(+), 20 deletions(-)
+
+diff --git a/daemon/xattr.c b/daemon/xattr.c
+index 2f642db..768f780 100644
+--- a/daemon/xattr.c
++++ b/daemon/xattr.c
+@@ -54,6 +54,7 @@ optgroup_linuxxattrs_available (void)
+ static guestfs_int_xattr_list *getxattrs (const char *path, ssize_t (*listxattr) (const char *path, char *list, size_t size), ssize_t (*getxattr) (const char *path, const char *name, void *value, size_t size));
+ static int _setxattr (const char *xattr, const char *val, int vallen, const char *path, int (*setxattr) (const char *path, const char *name, const void *value, size_t size, int flags));
+ static int _removexattr (const char *xattr, const char *path, int (*removexattr) (const char *path, const char *name));
++static char *_listxattrs (const char *path, ssize_t (*listxattr) (const char *path, char *list, size_t size), ssize_t *size);
+ 
+ guestfs_int_xattr_list *
+ do_getxattrs (const char *path)
+@@ -102,27 +103,10 @@ getxattrs (const char *path,
+   size_t i, j;
+   guestfs_int_xattr_list *r = NULL;
+ 
+-  CHROOT_IN;
+-  len = listxattr (path, NULL, 0);
+-  CHROOT_OUT;
+-  if (len == -1) {
+-    reply_with_perror ("listxattr: %s", path);
++  buf = _listxattrs (path, listxattr, &len);
++  if (buf == NULL)
++    /* _listxattrs issues reply_with_perror already. */
+     goto error;
+-  }
+-
+-  buf = malloc (len);
+-  if (buf == NULL) {
+-    reply_with_perror ("malloc");
+-    goto error;
+-  }
+-
+-  CHROOT_IN;
+-  len = listxattr (path, buf, len);
+-  CHROOT_OUT;
+-  if (len == -1) {
+-    reply_with_perror ("listxattr: %s", path);
+-    goto error;
+-  }
+ 
+   r = calloc (1, sizeof (*r));
+   if (r == NULL) {
+@@ -237,6 +221,46 @@ _removexattr (const char *xattr, const char *path,
+   return 0;
+ }
+ 
++static char *
++_listxattrs (const char *path,
++             ssize_t (*listxattr) (const char *path, char *list, size_t size),
++             ssize_t *size)
++{
++  int r;
++  char *buf = NULL;
++  ssize_t len;
++
++  CHROOT_IN;
++  len = listxattr (path, NULL, 0);
++  CHROOT_OUT;
++  if (len == -1) {
++    reply_with_perror ("listxattr: %s", path);
++    goto error;
++  }
++
++  buf = malloc (len);
++  if (buf == NULL) {
++    reply_with_perror ("malloc");
++    goto error;
++  }
++
++  CHROOT_IN;
++  len = listxattr (path, buf, len);
++  CHROOT_OUT;
++  if (len == -1) {
++    reply_with_perror ("listxattr: %s", path);
++    goto error;
++  }
++
++  if (size)
++    *size = len;
++  return buf;
++
++ error:
++  free (buf);
++  return NULL;
++}
++
+ guestfs_int_xattr_list *
+ do_internal_lxattrlist (const char *path, char *const *names)
+ {
+-- 
+1.8.4.2
+
diff --git a/0056-daemon-xattr-Remove-unused-variable.patch b/0056-daemon-xattr-Remove-unused-variable.patch
new file mode 100644
index 0000000..31d57bc
--- /dev/null
+++ b/0056-daemon-xattr-Remove-unused-variable.patch
@@ -0,0 +1,27 @@
+From 3c3659fe2fe5e26d0daaf1e414cbbdfa5ae3064f Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Fri, 10 Jan 2014 21:19:43 +0000
+Subject: [PATCH] daemon: xattr: Remove unused variable.
+
+Revealed by using ./configure --enable-gcc-warnings.
+
+(cherry picked from commit cea270de3be3ca3c2b2e6555418c4b4eb8da7509)
+---
+ daemon/xattr.c | 1 -
+ 1 file changed, 1 deletion(-)
+
+diff --git a/daemon/xattr.c b/daemon/xattr.c
+index 768f780..dc024d3 100644
+--- a/daemon/xattr.c
++++ b/daemon/xattr.c
+@@ -226,7 +226,6 @@ _listxattrs (const char *path,
+              ssize_t (*listxattr) (const char *path, char *list, size_t size),
+              ssize_t *size)
+ {
+-  int r;
+   char *buf = NULL;
+   ssize_t len;
+ 
+-- 
+1.8.4.2
+
diff --git a/0057-New-API-copy-attributes.patch b/0057-New-API-copy-attributes.patch
new file mode 100644
index 0000000..7571aa0
--- /dev/null
+++ b/0057-New-API-copy-attributes.patch
@@ -0,0 +1,437 @@
+From 338301295f0c6180edb7702882aab600d339ef4d Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Mon, 13 Jan 2014 14:41:28 +0100
+Subject: [PATCH] New API: copy-attributes.
+
+This allows one to copy attributes (like permissions, xattrs,
+ownership) from a file to another.
+
+(cherry picked from commit efb5f1841524ec75d765368b447270b8a3aff8ac)
+---
+ daemon/daemon.h         |   3 +
+ daemon/file.c           |  72 ++++++++++++++++++++++
+ daemon/xattr.c          |  69 +++++++++++++++++++++
+ fish/Makefile.am        |   1 +
+ fish/test-file-attrs.sh | 157 ++++++++++++++++++++++++++++++++++++++++++++++++
+ generator/actions.ml    |  38 ++++++++++++
+ src/MAX_PROC_NR         |   2 +-
+ 7 files changed, 341 insertions(+), 1 deletion(-)
+ create mode 100755 fish/test-file-attrs.sh
+
+diff --git a/daemon/daemon.h b/daemon/daemon.h
+index b77d764..6535658 100644
+--- a/daemon/daemon.h
++++ b/daemon/daemon.h
+@@ -231,6 +231,9 @@ extern void journal_finalize (void);
+ /*-- in proto.c --*/
+ extern void main_loop (int sock) __attribute__((noreturn));
+ 
++/*-- in xattr.c --*/
++extern int copy_xattrs (const char *src, const char *dest);
++
+ /* ordinary daemon functions use these to indicate errors
+  * NB: you don't need to prefix the string with the current command,
+  * it is added automatically by the client-side RPC stubs.
+diff --git a/daemon/file.c b/daemon/file.c
+index f348f87..856ab5f 100644
+--- a/daemon/file.c
++++ b/daemon/file.c
+@@ -28,6 +28,7 @@
+ #include "guestfs_protocol.h"
+ #include "daemon.h"
+ #include "actions.h"
++#include "optgroups.h"
+ 
+ GUESTFSD_EXT_CMD(str_file, file);
+ GUESTFSD_EXT_CMD(str_zcat, zcat);
+@@ -584,3 +585,74 @@ do_filesize (const char *path)
+ 
+   return buf.st_size;
+ }
++
++int
++do_copy_attributes (const char *src, const char *dest, int all, int mode, int xattributes, int ownership)
++{
++  int r;
++  struct stat srcstat, deststat;
++
++  static const unsigned int file_mask = 07777;
++
++  /* If it was specified to copy everything, manually enable all the flags
++   * not manually specified to avoid checking for flag || all everytime.
++   */
++  if (all) {
++    if (!(optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_MODE_BITMASK))
++      mode = 1;
++    if (!(optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_XATTRIBUTES_BITMASK))
++      xattributes = 1;
++    if (!(optargs_bitmask & GUESTFS_COPY_ATTRIBUTES_OWNERSHIP_BITMASK))
++      ownership = 1;
++  }
++
++  CHROOT_IN;
++  r = stat (src, &srcstat);
++  CHROOT_OUT;
++
++  if (r == -1) {
++    reply_with_perror ("stat: %s", src);
++    return -1;
++  }
++
++  CHROOT_IN;
++  r = stat (dest, &deststat);
++  CHROOT_OUT;
++
++  if (r == -1) {
++    reply_with_perror ("stat: %s", dest);
++    return -1;
++  }
++
++  if (mode &&
++      ((srcstat.st_mode & file_mask) != (deststat.st_mode & file_mask))) {
++    CHROOT_IN;
++    r = chmod (dest, (srcstat.st_mode & file_mask));
++    CHROOT_OUT;
++
++    if (r == -1) {
++      reply_with_perror ("chmod: %s", dest);
++      return -1;
++    }
++  }
++
++  if (ownership &&
++      (srcstat.st_uid != deststat.st_uid || srcstat.st_gid != deststat.st_gid)) {
++    CHROOT_IN;
++    r = chown (dest, srcstat.st_uid, srcstat.st_gid);
++    CHROOT_OUT;
++
++    if (r == -1) {
++      reply_with_perror ("chown: %s", dest);
++      return -1;
++    }
++  }
++
++  if (xattributes && optgroup_linuxxattrs_available ()) {
++    if (!copy_xattrs (src, dest))
++      /* copy_xattrs replies with an error already. */
++      return -1;
++  }
++
++  return 0;
++}
+diff --git a/daemon/xattr.c b/daemon/xattr.c
+index dc024d3..fdc43b3 100644
+--- a/daemon/xattr.c
++++ b/daemon/xattr.c
+@@ -523,8 +523,77 @@ do_lgetxattr (const char *path, const char *name, size_t *size_r)
+   return buf; /* caller frees */
+ }
+ 
++int
++copy_xattrs (const char *src, const char *dest)
++{
++  ssize_t len, vlen, ret, attrval_len = 0;
++  CLEANUP_FREE char *buf = NULL, *attrval = NULL;
++  size_t i;
++
++  buf = _listxattrs (src, listxattr, &len);
++  if (buf == NULL)
++    /* _listxattrs issues reply_with_perror already. */
++    goto error;
++
++  /* What we get from the kernel is a string "foo\0bar\0baz" of length
++   * len.
++   */
++  for (i = 0; i < (size_t) len; i += strlen (&buf[i]) + 1) {
++    CHROOT_IN;
++    vlen = getxattr (src, &buf[i], NULL, 0);
++    CHROOT_OUT;
++    if (vlen == -1) {
++      reply_with_perror ("getxattr: %s, %s", src, &buf[i]);
++      goto error;
++    }
++
++    if (vlen > XATTR_SIZE_MAX) {
++      /* The next call to getxattr will fail anyway, so ... */
++      reply_with_error ("extended attribute is too large");
++      goto error;
++    }
++
++    if (vlen > attrval_len) {
++      char *new = realloc (attrval, vlen);
++      if (new == NULL) {
++        reply_with_perror ("realloc");
++        goto error;
++      }
++      attrval = new;
++      attrval_len = vlen;
++    }
++
++    CHROOT_IN;
++    vlen = getxattr (src, &buf[i], attrval, vlen);
++    CHROOT_OUT;
++    if (vlen == -1) {
++      reply_with_perror ("getxattr: %s, %s", src, &buf[i]);
++      goto error;
++    }
++
++    CHROOT_IN;
++    ret = setxattr (dest, &buf[i], attrval, vlen, 0);
++    CHROOT_OUT;
++    if (ret == -1) {
++      reply_with_perror ("setxattr: %s, %s", dest, &buf[i]);
++      goto error;
++    }
++  }
++
++  return 1;
++
++ error:
++  return 0;
++}
++
+ #else /* no HAVE_LINUX_XATTRS */
+ 
+ OPTGROUP_LINUXXATTRS_NOT_AVAILABLE
+ 
++int
++copy_xattrs (const char *src, const char *dest)
++{
++  abort ();
++}
++
+ #endif /* no HAVE_LINUX_XATTRS */
+diff --git a/fish/Makefile.am b/fish/Makefile.am
+index bd0485f..fb0e99e 100644
+--- a/fish/Makefile.am
++++ b/fish/Makefile.am
+@@ -279,6 +279,7 @@ if ENABLE_APPLIANCE
+ TESTS += \
+ 	test-copy.sh \
+ 	test-edit.sh \
++	test-file-attrs.sh \
+ 	test-find0.sh \
+ 	test-inspect.sh \
+ 	test-glob.sh \
+diff --git a/fish/test-file-attrs.sh b/fish/test-file-attrs.sh
+new file mode 100755
+index 0000000..78bd817
+--- /dev/null
++++ b/fish/test-file-attrs.sh
+@@ -0,0 +1,157 @@
++#!/bin/bash -
++# libguestfs
++# Copyright (C) 2014 Red Hat Inc.
++#
++# This program is free software; you can redistribute it and/or modify
++# it under the terms of the GNU General Public License as published by
++# the Free Software Foundation; either version 2 of the License, or
++# (at your option) any later version.
++#
++# This program is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU General Public License for more details.
++#
++# You should have received a copy of the GNU General Public License
++# along with this program; if not, write to the Free Software
++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++
++# Test guestfish file attributes commands (chmod, copy-attributes, etc).
++
++set -e
++export LANG=C
++
++rm -f test.out
++
++$VG ./guestfish > test.out <<EOF
++scratch 50MB
++run
++part-disk /dev/sda mbr
++mkfs ext2 /dev/sda1
++mount /dev/sda1 /
++
++touch /foo
++touch /bar
++chmod 0712 /foo
++stat /foo | grep mode:
++copy-attributes /foo /bar mode:true
++stat /bar | grep mode:
++
++echo -----
++
++stat /foo | grep uid:
++stat /foo | grep gid:
++chown 10 11 /foo
++stat /foo | grep uid:
++stat /foo | grep gid:
++stat /bar | grep uid:
++stat /bar | grep gid:
++copy-attributes /foo /bar ownership:true
++stat /bar | grep uid:
++stat /bar | grep gid:
++
++echo -----
++
++setxattr user.test foo 3 /foo
++setxattr user.test2 secondtest 10 /foo
++setxattr user.foo another 7 /bar
++lxattrlist / "foo bar"
++copy-attributes /foo /bar xattributes:true
++lxattrlist / "foo bar"
++
++echo -----
++
++touch /new
++chmod 0111 /new
++copy-attributes /foo /new all:true mode:false
++stat /new | grep mode:
++stat /new | grep uid:
++stat /new | grep gid:
++lxattrlist / new
++copy-attributes /foo /new mode:true
++stat /new | grep mode:
++EOF
++
++if [ "$(cat test.out)" != "mode: 33226
++mode: 33226
++-----
++uid: 0
++gid: 0
++uid: 10
++gid: 11
++uid: 0
++gid: 0
++uid: 10
++gid: 11
++-----
++[0] = {
++  attrname: 
++  attrval: 2\x00
++}
++[1] = {
++  attrname: user.test
++  attrval: foo
++}
++[2] = {
++  attrname: user.test2
++  attrval: secondtest
++}
++[3] = {
++  attrname: 
++  attrval: 1\x00
++}
++[4] = {
++  attrname: user.foo
++  attrval: another
++}
++[0] = {
++  attrname: 
++  attrval: 2\x00
++}
++[1] = {
++  attrname: user.test
++  attrval: foo
++}
++[2] = {
++  attrname: user.test2
++  attrval: secondtest
++}
++[3] = {
++  attrname: 
++  attrval: 3\x00
++}
++[4] = {
++  attrname: user.foo
++  attrval: another
++}
++[5] = {
++  attrname: user.test
++  attrval: foo
++}
++[6] = {
++  attrname: user.test2
++  attrval: secondtest
++}
++-----
++mode: 32841
++uid: 10
++gid: 11
++[0] = {
++  attrname: 
++  attrval: 2\x00
++}
++[1] = {
++  attrname: user.test
++  attrval: foo
++}
++[2] = {
++  attrname: user.test2
++  attrval: secondtest
++}
++mode: 33226" ]; then
++    echo "$0: unexpected output:"
++    cat test.out
++    exit 1
++fi
++
++rm test.out
+diff --git a/generator/actions.ml b/generator/actions.ml
+index df59f44..6ed3afb 100644
+--- a/generator/actions.ml
++++ b/generator/actions.ml
+@@ -11647,6 +11647,44 @@ This function is used internally when setting up the appliance." };
+ This function is used internally when closing the appliance.  Note
+ it's only called when ./configure --enable-valgrind-daemon is used." };
+ 
++  { defaults with
++    name = "copy_attributes";
++    style = RErr, [Pathname "src"; Pathname "dest"], [OBool "all"; OBool "mode"; OBool "xattributes"; OBool "ownership"];
++    proc_nr = Some 415;
++    shortdesc = "copy the attributes of a path (file/directory) to another";
++    longdesc = "\
++Copy the attributes of a path (which can be a file or a directory)
++to another path.
++
++By default C<no> attribute is copied, so make sure to specify any
++(or C<all> to copy everything).
++
++The optional arguments specify which attributes can be copied:
++
++=over 4
++
++=item C<mode>
++
++Copy part of the file mode from C<source> to C<destination>. Only the
++UNIX permissions and the sticky/setuid/setgid bits can be copied.
++
++=item C<xattributes>
++
++Copy the Linux extended attributes (xattrs) from C<source> to C<destination>.
++This flag does nothing if the I<linuxxattrs> feature is not available
++(see C<guestfs_feature_available>).
++
++=item C<ownership>
++
++Copy the owner uid and the group gid of C<source> to C<destination>.
++
++=item C<all>
++
++Copy B<all> the attributes from C<source> to C<destination>. Enabling it
++enables all the other flags, if they are not specified already.
++
++=back" };
++
+ ]
+ 
+ (* Non-API meta-commands available only in guestfish.
+diff --git a/src/MAX_PROC_NR b/src/MAX_PROC_NR
+index d1b9f6a..21c8d99 100644
+--- a/src/MAX_PROC_NR
++++ b/src/MAX_PROC_NR
+@@ -1 +1 @@
+-414
++415
+-- 
+1.8.4.2
+
diff --git a/0058-Update-generated-files-for-new-copy-attributes-API.patch b/0058-Update-generated-files-for-new-copy-attributes-API.patch
new file mode 100644
index 0000000..63a5b31
--- /dev/null
+++ b/0058-Update-generated-files-for-new-copy-attributes-API.patch
@@ -0,0 +1,49 @@
+From b8c496a666647bfdf2b0bc54979ef06363868e93 Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Mon, 13 Jan 2014 19:26:01 +0000
+Subject: [PATCH] Update generated files for new copy-attributes API.
+
+This updates commit efb5f1841524ec75d765368b447270b8a3aff8ac.
+
+(cherry picked from commit e68baf1954f9b68a228c9ae99a738f2d750418c1)
+---
+ gobject/Makefile.inc | 6 ++++--
+ po/POTFILES          | 1 +
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/gobject/Makefile.inc b/gobject/Makefile.inc
+index fbc9eb6..7024754 100644
+--- a/gobject/Makefile.inc
++++ b/gobject/Makefile.inc
+@@ -92,7 +92,8 @@ guestfs_gobject_headers= \
+   include/guestfs-gobject/optargs-mke2fs.h \
+   include/guestfs-gobject/optargs-mktemp.h \
+   include/guestfs-gobject/optargs-syslinux.h \
+-  include/guestfs-gobject/optargs-remount.h
++  include/guestfs-gobject/optargs-remount.h \
++  include/guestfs-gobject/optargs-copy_attributes.h
+ 
+ guestfs_gobject_sources= \
+   src/session.c \
+@@ -166,4 +167,5 @@ guestfs_gobject_sources= \
+   src/optargs-mke2fs.c \
+   src/optargs-mktemp.c \
+   src/optargs-syslinux.c \
+-  src/optargs-remount.c
++  src/optargs-remount.c \
++  src/optargs-copy_attributes.c
+diff --git a/po/POTFILES b/po/POTFILES
+index 1e831ff..76c41ec 100644
+--- a/po/POTFILES
++++ b/po/POTFILES
+@@ -163,6 +163,7 @@ gobject/src/optargs-btrfs_filesystem_resize.c
+ gobject/src/optargs-btrfs_fsck.c
+ gobject/src/optargs-compress_device_out.c
+ gobject/src/optargs-compress_out.c
++gobject/src/optargs-copy_attributes.c
+ gobject/src/optargs-copy_device_to_device.c
+ gobject/src/optargs-copy_device_to_file.c
+ gobject/src/optargs-copy_file_to_device.c
+-- 
+1.8.4.2
+
diff --git a/0059-fish-Add-test-file-attrs.sh-to-EXTRA_DIST.patch b/0059-fish-Add-test-file-attrs.sh-to-EXTRA_DIST.patch
new file mode 100644
index 0000000..1a1666f
--- /dev/null
+++ b/0059-fish-Add-test-file-attrs.sh-to-EXTRA_DIST.patch
@@ -0,0 +1,27 @@
+From 7f3351b6c9731b553dea09244b5b0197268c0ae1 Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Mon, 13 Jan 2014 22:10:39 +0000
+Subject: [PATCH] fish: Add test-file-attrs.sh to EXTRA_DIST.
+
+This fixes commit efb5f1841524ec75d765368b447270b8a3aff8ac.
+
+(cherry picked from commit aba64a0327094b6a82686411c4dfa7a30d64ecee)
+---
+ fish/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/fish/Makefile.am b/fish/Makefile.am
+index fb0e99e..54ba875 100644
+--- a/fish/Makefile.am
++++ b/fish/Makefile.am
+@@ -306,6 +306,7 @@ EXTRA_DIST += \
+ 	test-edit.sh \
+ 	test-escapes.sh \
+ 	test-events.sh \
++	test-file-attrs.sh \
+ 	test-find0.sh \
+ 	test-glob.sh \
+ 	test-inspect.sh \
+-- 
+1.8.4.2
+
diff --git a/0060-builder-edit-fish-use-copy-attributes.patch b/0060-builder-edit-fish-use-copy-attributes.patch
new file mode 100644
index 0000000..23c94c9
--- /dev/null
+++ b/0060-builder-edit-fish-use-copy-attributes.patch
@@ -0,0 +1,212 @@
+From ef90768b6c036885d2e572bf7ea7508512bd62a5 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Tue, 14 Jan 2014 11:08:25 +0100
+Subject: [PATCH] builder, edit, fish: use copy-attributes
+
+Make use of the new copy-attributes command to properly copy all file
+attributes from a file to the new version of it.
+
+(cherry picked from commit b7bb1f6cee19da143996c13e6cc019a039f3ee4f)
+---
+ builder/perl_edit.ml | 29 +---------------------------
+ edit/edit.c          | 49 ++---------------------------------------------
+ fish/edit.c          | 54 ++--------------------------------------------------
+ 3 files changed, 5 insertions(+), 127 deletions(-)
+
+diff --git a/builder/perl_edit.ml b/builder/perl_edit.ml
+index aa4c2e6..28e5dea 100644
+--- a/builder/perl_edit.ml
++++ b/builder/perl_edit.ml
+@@ -42,7 +42,7 @@ let rec edit_file ~debug (g : Guestfs.guestfs) file expr =
+   g#upload tmpfile file;
+ 
+   (* However like virt-edit we do need to copy attributes. *)
+-  copy_attributes g file_old file;
++  g#copy_attributes ~all:true file_old file;
+   g#rm file_old
+ 
+ and do_perl_edit ~debug g file expr =
+@@ -76,30 +76,3 @@ and do_perl_edit ~debug g file expr =
+   );
+ 
+   Unix.rename (file ^ ".out") file
+-
+-and copy_attributes g src dest =
+-  let has_linuxxattrs = g#feature_available [|"linuxxattrs"|] in
+-
+-  (* Get the mode. *)
+-  let stat = g#stat src in
+-
+-  (* Get the SELinux context.  XXX Should we copy over other extended
+-   * attributes too?
+-   *)
+-  let selinux_context =
+-    if has_linuxxattrs then (
+-      try Some (g#getxattr src "security.selinux") with _ -> None
+-    ) else None in
+-
+-  (* Set the permissions (inc. sticky and set*id bits), UID, GID. *)
+-  let mode = Int64.to_int stat.G.mode
+-  and uid = Int64.to_int stat.G.uid and gid = Int64.to_int stat.G.gid in
+-  g#chmod (mode land 0o7777) dest;
+-  g#chown uid gid dest;
+-
+-  (* Set the SELinux context. *)
+-  match selinux_context with
+-  | None -> ()
+-  | Some selinux_context ->
+-    g#setxattr "security.selinux"
+-      selinux_context (String.length selinux_context) dest
+diff --git a/edit/edit.c b/edit/edit.c
+index e5e3a29..07790be 100644
+--- a/edit/edit.c
++++ b/edit/edit.c
+@@ -56,7 +56,6 @@ static void edit_files (int argc, char *argv[]);
+ static void edit (const char *filename, const char *root);
+ static char *edit_interactively (const char *tmpfile);
+ static char *edit_non_interactively (const char *tmpfile);
+-static int copy_attributes (const char *src, const char *dest);
+ static int is_windows (guestfs_h *g, const char *root);
+ static char *windows_path (guestfs_h *g, const char *root, const char *filename);
+ static char *generate_random_name (const char *filename);
+@@ -361,7 +360,8 @@ edit (const char *filename, const char *root)
+     /* Set the permissions, UID, GID and SELinux context of the new
+      * file to match the old file (RHBZ#788641).
+      */
+-    if (copy_attributes (filename, newname) == -1)
++    if (guestfs_copy_attributes (g, filename, newname,
++        GUESTFS_COPY_ATTRIBUTES_ALL, 1, -1) == -1)
+       goto error;
+ 
+     /* Backup or overwrite the file. */
+@@ -510,51 +510,6 @@ edit_non_interactively (const char *tmpfile)
+ }
+ 
+ static int
+-copy_attributes (const char *src, const char *dest)
+-{
+-  CLEANUP_FREE_STAT struct guestfs_stat *stat = NULL;
+-  const char *linuxxattrs[] = { "linuxxattrs", NULL };
+-  int has_linuxxattrs;
+-  CLEANUP_FREE char *selinux_context = NULL;
+-  size_t selinux_context_size;
+-
+-  has_linuxxattrs = guestfs_feature_available (g, (char **) linuxxattrs);
+-
+-  /* Get the mode. */
+-  stat = guestfs_stat (g, src);
+-  if (stat == NULL)
+-    return -1;
+-
+-  /* Get the SELinux context.  XXX Should we copy over other extended
+-   * attributes too?
+-   */
+-  if (has_linuxxattrs) {
+-    guestfs_push_error_handler (g, NULL, NULL);
+-
+-    selinux_context = guestfs_getxattr (g, src, "security.selinux",
+-                                        &selinux_context_size);
+-    /* selinux_context could be NULL.  This isn't an error. */
+-
+-    guestfs_pop_error_handler (g);
+-  }
+-
+-  /* Set the permissions (inc. sticky and set*id bits), UID, GID. */
+-  if (guestfs_chmod (g, stat->mode & 07777, dest) == -1)
+-    return -1;
+-  if (guestfs_chown (g, stat->uid, stat->gid, dest) == -1)
+-    return -1;
+-
+-  /* Set the SELinux context. */
+-  if (has_linuxxattrs && selinux_context) {
+-    if (guestfs_setxattr (g, "security.selinux", selinux_context,
+-                          (int) selinux_context_size, dest) == -1)
+-      return -1;
+-  }
+-
+-  return 0;
+-}
+-
+-static int
+ is_windows (guestfs_h *g, const char *root)
+ {
+   int w;
+diff --git a/fish/edit.c b/fish/edit.c
+index 754a34a..bd02f4b 100644
+--- a/fish/edit.c
++++ b/fish/edit.c
+@@ -32,7 +32,6 @@
+ #include "fish.h"
+ 
+ static char *generate_random_name (const char *filename);
+-static int copy_attributes (const char *src, const char *dest);
+ 
+ /* guestfish edit command, suggested by Ján Ondrej, implemented by RWMJ */
+ 
+@@ -135,7 +134,8 @@ run_edit (const char *cmd, size_t argc, char *argv[])
+   /* Set the permissions, UID, GID and SELinux context of the new
+    * file to match the old file (RHBZ#788641).
+    */
+-  if (copy_attributes (remotefilename, newname) == -1)
++  if (guestfs_copy_attributes (g, remotefilename, newname,
++      GUESTFS_COPY_ATTRIBUTES_ALL, 1, -1) == -1)
+     return -1;
+ 
+   if (guestfs_mv (g, newname, remotefilename) == -1)
+@@ -177,53 +177,3 @@ generate_random_name (const char *filename)
+ 
+   return ret; /* caller will free */
+ }
+-
+-static int
+-copy_attributes (const char *src, const char *dest)
+-{
+-  struct guestfs_stat *stat;
+-  const char *linuxxattrs[] = { "linuxxattrs", NULL };
+-  int has_linuxxattrs;
+-  CLEANUP_FREE char *selinux_context = NULL;
+-  size_t selinux_context_size;
+-
+-  has_linuxxattrs = guestfs_feature_available (g, (char **) linuxxattrs);
+-
+-  /* Get the mode. */
+-  stat = guestfs_stat (g, src);
+-  if (stat == NULL)
+-    return -1;
+-
+-  /* Get the SELinux context.  XXX Should we copy over other extended
+-   * attributes too?
+-   */
+-  if (has_linuxxattrs) {
+-    guestfs_push_error_handler (g, NULL, NULL);
+-
+-    selinux_context = guestfs_getxattr (g, src, "security.selinux",
+-                                        &selinux_context_size);
+-    /* selinux_context could be NULL.  This isn't an error. */
+-
+-    guestfs_pop_error_handler (g);
+-  }
+-
+-  /* Set the permissions (inc. sticky and set*id bits), UID, GID. */
+-  if (guestfs_chmod (g, stat->mode & 07777, dest) == -1) {
+-    guestfs_free_stat (stat);
+-    return -1;
+-  }
+-  if (guestfs_chown (g, stat->uid, stat->gid, dest) == -1) {
+-    guestfs_free_stat (stat);
+-    return -1;
+-  }
+-  guestfs_free_stat (stat);
+-
+-  /* Set the SELinux context. */
+-  if (has_linuxxattrs && selinux_context) {
+-    if (guestfs_setxattr (g, "security.selinux", selinux_context,
+-                          (int) selinux_context_size, dest) == -1)
+-      return -1;
+-  }
+-
+-  return 0;
+-}
+-- 
+1.8.4.2
+
diff --git a/0061-builder-test-virt-builder-check-some-results.patch b/0061-builder-test-virt-builder-check-some-results.patch
new file mode 100644
index 0000000..9926749
--- /dev/null
+++ b/0061-builder-test-virt-builder-check-some-results.patch
@@ -0,0 +1,73 @@
+From 10e2bc794e15a8d64d06e0fe79cc2a7b94d7c44a Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Tue, 14 Jan 2014 13:30:19 +0100
+Subject: [PATCH] builder: test-virt-builder: check some results
+
+Check at least some basic modifications in the image created with
+virt-builder.
+
+(cherry picked from commit 775c6daf22884edad8ede4b0916024d3d7c04585)
+---
+ builder/test-virt-builder.sh | 47 +++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 46 insertions(+), 1 deletion(-)
+
+diff --git a/builder/test-virt-builder.sh b/builder/test-virt-builder.sh
+index 47d20a4..3c8eb60 100755
+--- a/builder/test-virt-builder.sh
++++ b/builder/test-virt-builder.sh
+@@ -65,6 +65,51 @@ $VG ./virt-builder phony-fedora \
+     --firstboot Makefile --firstboot-command 'echo "hello"' \
+     --firstboot-install "minicom,inkscape"
+ 
+-# XXX Test that the modifications were made.
++# Check that some modifications were made.
++$VG ../fish/guestfish --ro -i -a $output > test.out <<EOF
++# Uploaded files
++is-file /etc/foo/bar/baz/Makefile
++cat /etc/foo/bar/baz/foo
++is-symlink /foo
++is-symlink /foo1
++is-symlink /foo2
++is-symlink /foo3
++
++echo -----
++# Hostname
++cat /etc/sysconfig/network | grep HOSTNAME=
++
++echo -----
++# Timezone
++is-file /usr/share/zoneinfo/Europe/London
++is-symlink /etc/localtime
++readlink /etc/localtime
++
++echo -----
++# Password
++is-file /etc/shadow
++cat /etc/shadow | sed -r '/^root:/!d;s,^(root:\\\$6\\\$).*,\\1,g'
++EOF
++
++if [ "$(cat test.out)" != "true
++Hello World
++true
++true
++true
++true
++-----
++HOSTNAME=test.example.com
++-----
++true
++true
++/usr/share/zoneinfo/Europe/London
++-----
++true
++root:\$6\$" ]; then
++    echo "$0: unexpected output:"
++    cat test.out
++    exit 1
++fi
+ 
+ rm $output
++rm test.out
+-- 
+1.8.4.2
+
diff --git a/0062-builder-small-refactor-of-the-list-output.patch b/0062-builder-small-refactor-of-the-list-output.patch
new file mode 100644
index 0000000..ddb8c83
--- /dev/null
+++ b/0062-builder-small-refactor-of-the-list-output.patch
@@ -0,0 +1,193 @@
+From 5948434bbf95ed9f39aac705c9898f55d9294806 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Thu, 16 Jan 2014 11:49:05 +0100
+Subject: [PATCH] builder: small refactor of the list output
+
+Switch from a boolean for the short/long list output to labels for the
+actual format. Also, split the output of each list format to an own
+function for easier maintaineance.
+
+(cherry picked from commit 91aae893c70b3877b31803800ba77836fd7a45e8)
+---
+ builder/builder.ml       |  4 +--
+ builder/cmdline.ml       |  9 +++---
+ builder/list_entries.ml  | 82 +++++++++++++++++++++++++++---------------------
+ builder/list_entries.mli |  2 +-
+ 4 files changed, 54 insertions(+), 43 deletions(-)
+
+diff --git a/builder/builder.ml b/builder/builder.ml
+index 0160818..0aaa287 100644
+--- a/builder/builder.ml
++++ b/builder/builder.ml
+@@ -37,7 +37,7 @@ let main () =
+   (* Command line argument parsing - see cmdline.ml. *)
+   let mode, arg,
+     attach, cache, check_signature, curl, debug, delete, delete_on_failure,
+-    edit, firstboot, run, format, gpg, hostname, install, list_long, links,
++    edit, firstboot, run, format, gpg, hostname, install, list_format, links,
+     memsize, mkdirs,
+     network, output, password_crypto, quiet, root_password, scrub,
+     scrub_logfile, size, smp, sources, sync, timezone, update, upload,
+@@ -148,7 +148,7 @@ let main () =
+   let mode =
+     match mode with
+     | `List ->                          (* --list *)
+-      List_entries.list_entries ~list_long ~sources index;
++      List_entries.list_entries ~list_format ~sources index;
+       exit 0
+ 
+     | `Print_cache ->                   (* --print-cache *)
+diff --git a/builder/cmdline.ml b/builder/cmdline.ml
+index 67b142a..f199f03 100644
+--- a/builder/cmdline.ml
++++ b/builder/cmdline.ml
+@@ -130,7 +130,8 @@ let parse_cmdline () =
+     links := (target, lns) :: !links
+   in
+ 
+-  let list_long = ref false in
++  let list_format = ref `Short in
++  let list_set_long () = list_format := `Long in
+ 
+   let memsize = ref None in
+   let set_memsize arg = memsize := Some arg in
+@@ -255,7 +256,7 @@ let parse_cmdline () =
+     "--link",    Arg.String add_link,       "target:link.." ^ " " ^ s_"Create symbolic links";
+     "-l",        Arg.Unit list_mode,        " " ^ s_"List available templates";
+     "--list",    Arg.Unit list_mode,        ditto;
+-    "--long",    Arg.Set list_long,         ditto;
++    "--long",    Arg.Unit list_set_long,    " " ^ s_"List available templates, in long textual form";
+     "--no-logfile", Arg.Set scrub_logfile,  " " ^ s_"Scrub build log file";
+     "--long-options", Arg.Unit display_long_options, " " ^ s_"List long options";
+     "-m",        Arg.Int set_memsize,       "mb" ^ " " ^ s_"Set memory size";
+@@ -329,7 +330,7 @@ read the man page virt-builder(1).
+   let gpg = !gpg in
+   let hostname = !hostname in
+   let install = List.rev !install in
+-  let list_long = !list_long in
++  let list_format = !list_format in
+   let links = List.rev !links in
+   let memsize = !memsize in
+   let mkdirs = List.rev !mkdirs in
+@@ -443,7 +444,7 @@ read the man page virt-builder(1).
+ 
+   mode, arg,
+   attach, cache, check_signature, curl, debug, delete, delete_on_failure,
+-  edit, firstboot, run, format, gpg, hostname, install, list_long, links,
++  edit, firstboot, run, format, gpg, hostname, install, list_format, links,
+   memsize, mkdirs,
+   network, output, password_crypto, quiet, root_password, scrub,
+   scrub_logfile, size, smp, sources, sync, timezone, update, upload,
+diff --git a/builder/list_entries.ml b/builder/list_entries.ml
+index 87001c0..97ab201 100644
+--- a/builder/list_entries.ml
++++ b/builder/list_entries.ml
+@@ -21,15 +21,35 @@ open Common_utils
+ 
+ open Printf
+ 
+-let list_entries ?(list_long = false) ~sources index =
+-  if list_long then (
+-    List.iter (
+-      fun (source, fingerprint) ->
+-        printf (f_"Source URI: %s\n") source;
+-        printf (f_"Fingerprint: %s\n") fingerprint;
++let rec list_entries ~list_format ~sources index =
++  match list_format with
++  | `Short -> list_entries_short index
++  | `Long -> list_entries_long ~sources index
++
++and list_entries_short index =
++  List.iter (
++    fun (name, { Index_parser.printable_name = printable_name;
++                 size = size;
++                 compressed_size = compressed_size;
++                 notes = notes;
++                 hidden = hidden }) ->
++      if not hidden then (
++        printf "%-24s" name;
++        (match printable_name with
++        | None -> ()
++        | Some s -> printf " %s" s
++        );
+         printf "\n"
+-    ) sources
+-  );
++      )
++  ) index
++
++and list_entries_long ~sources index =
++  List.iter (
++    fun (source, fingerprint) ->
++      printf (f_"Source URI: %s\n") source;
++      printf (f_"Fingerprint: %s\n") fingerprint;
++      printf "\n"
++  ) sources;
+ 
+   List.iter (
+     fun (name, { Index_parser.printable_name = printable_name;
+@@ -38,33 +58,23 @@ let list_entries ?(list_long = false) ~sources index =
+                  notes = notes;
+                  hidden = hidden }) ->
+       if not hidden then (
+-        if not list_long then (         (* Short *)
+-          printf "%-24s" name;
+-          (match printable_name with
+-          | None -> ()
+-          | Some s -> printf " %s" s
+-          );
+-          printf "\n"
+-        )
+-        else (                          (* Long *)
+-          printf "%-24s %s\n" "os-version:" name;
+-          (match printable_name with
+-          | None -> ()
+-          | Some name -> printf "%-24s %s\n" (s_"Full name:") name;
+-          );
+-          printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
+-          (match compressed_size with
+-          | None -> ()
+-          | Some size ->
+-            printf "%-24s %s\n" (s_"Download size:") (human_size size);
+-          );
+-          (match notes with
+-          | None -> ()
+-          | Some notes ->
+-            printf "\n";
+-            printf (f_"Notes:\n\n%s\n") notes
+-          );
+-          printf "\n"
+-        )
++        printf "%-24s %s\n" "os-version:" name;
++        (match printable_name with
++        | None -> ()
++        | Some name -> printf "%-24s %s\n" (s_"Full name:") name;
++        );
++        printf "%-24s %s\n" (s_"Minimum/default size:") (human_size size);
++        (match compressed_size with
++        | None -> ()
++        | Some size ->
++          printf "%-24s %s\n" (s_"Download size:") (human_size size);
++        );
++        (match notes with
++        | None -> ()
++        | Some notes ->
++          printf "\n";
++          printf (f_"Notes:\n\n%s\n") notes
++        );
++        printf "\n"
+       )
+   ) index
+diff --git a/builder/list_entries.mli b/builder/list_entries.mli
+index d9486b0..41d0bff 100644
+--- a/builder/list_entries.mli
++++ b/builder/list_entries.mli
+@@ -16,4 +16,4 @@
+  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+  *)
+ 
+-val list_entries : ?list_long:bool -> sources:(string * string) list -> Index_parser.index -> unit
++val list_entries : list_format:([ `Short | `Long ]) -> sources:(string * string) list -> Index_parser.index -> unit
+-- 
+1.8.4.2
+
diff --git a/0063-builder-add-list-format.patch b/0063-builder-add-list-format.patch
new file mode 100644
index 0000000..6c5ea43
--- /dev/null
+++ b/0063-builder-add-list-format.patch
@@ -0,0 +1,92 @@
+From 2067ada4285db0b22d5532681ab0d7f8c6f78af0 Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Thu, 16 Jan 2014 12:34:48 +0100
+Subject: [PATCH] builder: add --list-format
+
+Add a --list-format which allows to choose which in format should be the
+output of --list.
+
+(cherry picked from commit e45bfe0d36c9f50143b13921a498f00ee06ca27d)
+---
+ builder/cmdline.ml       | 11 ++++++++++-
+ builder/virt-builder.pod | 24 +++++++++++++++++++++---
+ 2 files changed, 31 insertions(+), 4 deletions(-)
+
+diff --git a/builder/cmdline.ml b/builder/cmdline.ml
+index f199f03..6d6439f 100644
+--- a/builder/cmdline.ml
++++ b/builder/cmdline.ml
+@@ -132,6 +132,13 @@ let parse_cmdline () =
+ 
+   let list_format = ref `Short in
+   let list_set_long () = list_format := `Long in
++  let list_set_format arg =
++    list_format := match arg with
++    | "short" -> `Short
++    | "long" -> `Long
++    | fmt ->
++      eprintf (f_"%s: invalid --list-format type '%s', see the man page.\n") prog fmt;
++      exit 1 in
+ 
+   let memsize = ref None in
+   let set_memsize arg = memsize := Some arg in
+@@ -256,7 +263,9 @@ let parse_cmdline () =
+     "--link",    Arg.String add_link,       "target:link.." ^ " " ^ s_"Create symbolic links";
+     "-l",        Arg.Unit list_mode,        " " ^ s_"List available templates";
+     "--list",    Arg.Unit list_mode,        ditto;
+-    "--long",    Arg.Unit list_set_long,    " " ^ s_"List available templates, in long textual form";
++    "--long",    Arg.Unit list_set_long,    " " ^ s_"Shortcut for --list-format short";
++    "--list-format", Arg.String list_set_format,
++                                            "short|long" ^ " " ^ s_"Set the format for --list (default: short)";
+     "--no-logfile", Arg.Set scrub_logfile,  " " ^ s_"Scrub build log file";
+     "--long-options", Arg.Unit display_long_options, " " ^ s_"List long options";
+     "-m",        Arg.Int set_memsize,       "mb" ^ " " ^ s_"Set memory size";
+diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
+index 9cbfbab..05abcc6 100644
+--- a/builder/virt-builder.pod
++++ b/builder/virt-builder.pod
+@@ -31,7 +31,7 @@ virt-builder - Build virtual machine images quickly
+     [--firstboot SCRIPT] [--firstboot-command 'CMD ARGS ...']
+     [--firstboot-install PKG,[PKG...]]
+ 
+- virt-builder -l|--list [--long]
++ virt-builder -l|--list [--long] [--list-format short|long]
+ 
+  virt-builder --notes os-version
+ 
+@@ -374,12 +374,30 @@ pointing at C<TARGET>.
+ 
+ =item B<--list>
+ 
++=item B<--list --format> format
++
+ =item B<--list --long>
+ 
+ List available templates.
+ 
+-The alternative I<--list --long> form shows lots more details about
+-each operating system option.
++It is possible to choose with I<--format> the output format for the list
++templates:
++
++=over 4
++
++=item B<short>
++
++The default format, prints only the template identifier and, next to it,
++its short description.
++
++=item B<long>
++
++Prints a textual list with the details of the available sources, followed
++by the details of the available templates.
++
++=back
++
++I<--long> is a shorthand for the C<long> format.
+ 
+ See also: I<--source>, I<--notes>, L</CREATING YOUR OWN TEMPLATES>.
+ 
+-- 
+1.8.4.2
+
diff --git a/0064-builder-add-a-JSON-output-for-list.patch b/0064-builder-add-a-JSON-output-for-list.patch
new file mode 100644
index 0000000..e00e590
--- /dev/null
+++ b/0064-builder-add-a-JSON-output-for-list.patch
@@ -0,0 +1,232 @@
+From 1ae52065ca3d8415ea81278224b04269e4221dab Mon Sep 17 00:00:00 2001
+From: Pino Toscano <ptoscano at redhat.com>
+Date: Thu, 16 Jan 2014 14:58:25 +0100
+Subject: [PATCH] builder: add a JSON output for --list
+
+Simple JSON output for sources and templates, to be able to query them
+with no need to parse unstructured outputs like the "--list-format long"
+one.
+
+(cherry picked from commit 5b42351294f4d0ace6960b9f31215f3f97c5259d)
+---
+ builder/cmdline.ml                |  3 +-
+ builder/list_entries.ml           | 60 +++++++++++++++++++++++++++++++++++
+ builder/list_entries.mli          |  2 +-
+ builder/test-virt-builder-list.sh | 67 +++++++++++++++++++++++++++++++++++++++
+ builder/virt-builder.pod          | 12 ++++++-
+ 5 files changed, 141 insertions(+), 3 deletions(-)
+
+diff --git a/builder/cmdline.ml b/builder/cmdline.ml
+index 6d6439f..e3b1484 100644
+--- a/builder/cmdline.ml
++++ b/builder/cmdline.ml
+@@ -136,6 +136,7 @@ let parse_cmdline () =
+     list_format := match arg with
+     | "short" -> `Short
+     | "long" -> `Long
++    | "json" -> `Json
+     | fmt ->
+       eprintf (f_"%s: invalid --list-format type '%s', see the man page.\n") prog fmt;
+       exit 1 in
+@@ -265,7 +266,7 @@ let parse_cmdline () =
+     "--list",    Arg.Unit list_mode,        ditto;
+     "--long",    Arg.Unit list_set_long,    " " ^ s_"Shortcut for --list-format short";
+     "--list-format", Arg.String list_set_format,
+-                                            "short|long" ^ " " ^ s_"Set the format for --list (default: short)";
++                                            "short|long|json" ^ " " ^ s_"Set the format for --list (default: short)";
+     "--no-logfile", Arg.Set scrub_logfile,  " " ^ s_"Scrub build log file";
+     "--long-options", Arg.Unit display_long_options, " " ^ s_"List long options";
+     "-m",        Arg.Int set_memsize,       "mb" ^ " " ^ s_"Set memory size";
+diff --git a/builder/list_entries.ml b/builder/list_entries.ml
+index 97ab201..7369e6c 100644
+--- a/builder/list_entries.ml
++++ b/builder/list_entries.ml
+@@ -25,6 +25,7 @@ let rec list_entries ~list_format ~sources index =
+   match list_format with
+   | `Short -> list_entries_short index
+   | `Long -> list_entries_long ~sources index
++  | `Json -> list_entries_json ~sources index
+ 
+ and list_entries_short index =
+   List.iter (
+@@ -78,3 +79,62 @@ and list_entries_long ~sources index =
+         printf "\n"
+       )
+   ) index
++
++and list_entries_json ~sources index =
++  let trailing_comma index size =
++    if index = size - 1 then "" else "," in
++  let json_string_of_bool b =
++    if b then "true" else "false" in
++  let json_string_escape str =
++    let res = ref "" in
++    for i = 0 to String.length str - 1 do
++      res := !res ^ (match str.[i] with
++        | '"' -> "\\\""
++        | '\\' -> "\\\\"
++        | '\b' -> "\\b"
++        | '\n' -> "\\n"
++        | '\r' -> "\\r"
++        | '\t' -> "\\t"
++        | c -> String.make 1 c)
++    done;
++    !res in
++  let json_optional_printf_string key value =
++    match value with
++    | None -> ()
++    | Some str ->
++      printf "    \"%s\": \"%s\",\n" key (json_string_escape str) in
++  let json_optional_printf_int64 key value =
++    match value with
++    | None -> ()
++    | Some n ->
++      printf "    \"%s\": \"%Ld\",\n" key n in
++
++  printf "{\n";
++  printf "  \"version\": %d,\n" 1;
++  printf "  \"sources\": [\n";
++  iteri (
++    fun i (source, fingerprint) ->
++      printf "  {\n";
++      printf "    \"uri\": \"%s\",\n" source;
++      printf "    \"fingerprint\": \"%s\"\n" fingerprint;
++      printf "  }%s\n" (trailing_comma i (List.length sources))
++  ) sources;
++  printf "  ],\n";
++  printf "  \"templates\": [\n";
++  iteri (
++    fun i (name, { Index_parser.printable_name = printable_name;
++                   size = size;
++                   compressed_size = compressed_size;
++                   notes = notes;
++                   hidden = hidden }) ->
++      printf "  {\n";
++      printf "    \"os-version\": \"%s\",\n" name;
++      json_optional_printf_string "full-name" printable_name;
++      printf "    \"size\": %Ld,\n" size;
++      json_optional_printf_int64 "compressed-size" compressed_size;
++      json_optional_printf_string "notes" notes;
++      printf "    \"hidden\": %s\n" (json_string_of_bool hidden);
++      printf "  }%s\n" (trailing_comma i (List.length index))
++  ) index;
++  printf "  ]\n";
++ printf "}\n"
+diff --git a/builder/list_entries.mli b/builder/list_entries.mli
+index 41d0bff..e7c32f1 100644
+--- a/builder/list_entries.mli
++++ b/builder/list_entries.mli
+@@ -16,4 +16,4 @@
+  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+  *)
+ 
+-val list_entries : list_format:([ `Short | `Long ]) -> sources:(string * string) list -> Index_parser.index -> unit
++val list_entries : list_format:([ `Short | `Long | `Json ]) -> sources:(string * string) list -> Index_parser.index -> unit
+diff --git a/builder/test-virt-builder-list.sh b/builder/test-virt-builder-list.sh
+index 083c035..c3b791f 100755
+--- a/builder/test-virt-builder-list.sh
++++ b/builder/test-virt-builder-list.sh
+@@ -103,3 +103,70 @@ Phony Windows look-alike used for testing." ]; then
+     echo "$long_list"
+     exit 1
+ fi
++
++json_list=$(./virt-builder --no-check-signature --no-cache --list --list-format json)
++
++if [ "$json_list" != "{
++  \"version\": 1,
++  \"sources\": [
++  {
++    \"uri\": \"$VIRT_BUILDER_SOURCE\",
++    \"fingerprint\": \"F777 4FB1 AD07 4A7E 8C87 67EA 9173 8F73 E1B7 68A0\"
++  }
++  ],
++  \"templates\": [
++  {
++    \"os-version\": \"phony-debian\",
++    \"full-name\": \"Phony Debian\",
++    \"size\": 536870912,
++    \"notes\": \"Phony Debian look-alike used for testing.\",
++    \"hidden\": false
++  },
++  {
++    \"os-version\": \"phony-fedora\",
++    \"full-name\": \"Phony Fedora\",
++    \"size\": 1073741824,
++    \"notes\": \"Phony Fedora look-alike used for testing.\",
++    \"hidden\": false
++  },
++  {
++    \"os-version\": \"phony-fedora-qcow2\",
++    \"full-name\": \"Phony Fedora qcow2\",
++    \"size\": 1073741824,
++    \"notes\": \"Phony Fedora look-alike used for testing.\",
++    \"hidden\": false
++  },
++  {
++    \"os-version\": \"phony-fedora-qcow2-uncompressed\",
++    \"full-name\": \"Phony Fedora qcow2 uncompressed\",
++    \"size\": 1073741824,
++    \"notes\": \"Phony Fedora look-alike used for testing.\",
++    \"hidden\": false
++  },
++  {
++    \"os-version\": \"phony-fedora-no-format\",
++    \"full-name\": \"Phony Fedora\",
++    \"size\": 1073741824,
++    \"notes\": \"Phony Fedora look-alike used for testing.\",
++    \"hidden\": false
++  },
++  {
++    \"os-version\": \"phony-ubuntu\",
++    \"full-name\": \"Phony Ubuntu\",
++    \"size\": 536870912,
++    \"notes\": \"Phony Ubuntu look-alike used for testing.\",
++    \"hidden\": false
++  },
++  {
++    \"os-version\": \"phony-windows\",
++    \"full-name\": \"Phony Windows\",
++    \"size\": 536870912,
++    \"notes\": \"Phony Windows look-alike used for testing.\",
++    \"hidden\": false
++  }
++  ]
++}" ]; then
++    echo "$0: unexpected --list --format json output:"
++    echo "$json_list"
++    exit 1
++fi
+diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
+index 05abcc6..ded045b 100644
+--- a/builder/virt-builder.pod
++++ b/builder/virt-builder.pod
+@@ -31,7 +31,7 @@ virt-builder - Build virtual machine images quickly
+     [--firstboot SCRIPT] [--firstboot-command 'CMD ARGS ...']
+     [--firstboot-install PKG,[PKG...]]
+ 
+- virt-builder -l|--list [--long] [--list-format short|long]
++ virt-builder -l|--list [--long] [--list-format short|long|json]
+ 
+  virt-builder --notes os-version
+ 
+@@ -395,6 +395,16 @@ its short description.
+ Prints a textual list with the details of the available sources, followed
+ by the details of the available templates.
+ 
++=item B<json>
++
++Prints a JSON object with the details of the available sources and
++the details of the available templates.
++
++The C<version> key in the main object represents the "compatibility version",
++and it is bumped every time the resulting JSON output is incompatible with
++the previous versions (for example the structure has changed, or non-optional
++keys are no more present).
++
+ =back
+ 
+ I<--long> is a shorthand for the C<long> format.
+-- 
+1.8.4.2
+
diff --git a/0065-builder-Fix-unterminated-I-.-in-man-page.patch b/0065-builder-Fix-unterminated-I-.-in-man-page.patch
new file mode 100644
index 0000000..7cfc8a8
--- /dev/null
+++ b/0065-builder-Fix-unterminated-I-.-in-man-page.patch
@@ -0,0 +1,27 @@
+From 504bc13a693fd95fb2b97f18f4a6400250216145 Mon Sep 17 00:00:00 2001
+From: "Richard W.M. Jones" <rjones at redhat.com>
+Date: Thu, 16 Jan 2014 18:01:20 +0000
+Subject: [PATCH] builder: Fix unterminated I<...> in man page.
+
+Thanks: Lukas Zapletal.
+(cherry picked from commit b3cf877e58cbcc4f6fd5d228028e19c1b294b1ac)
+---
+ builder/virt-builder.pod | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/builder/virt-builder.pod b/builder/virt-builder.pod
+index ded045b..9e433e4 100644
+--- a/builder/virt-builder.pod
++++ b/builder/virt-builder.pod
+@@ -1012,7 +1012,7 @@ Files are deleted (I<--delete>, I<--scrub>).
+ 
+ =item *
+ 
+-Symbolic links are created (I<--link).
++Symbolic links are created (I<--link>).
+ 
+ =item *
+ 
+-- 
+1.8.4.2
+
diff --git a/libguestfs.spec b/libguestfs.spec
index 689e131..1e1f135 100644
--- a/libguestfs.spec
+++ b/libguestfs.spec
@@ -11,8 +11,8 @@
 Summary:       Access and modify virtual machine disk images
 Name:          libguestfs
 Epoch:         1
-Version:       1.24.4
-Release:       3%{?dist}
+Version:       1.24.5
+Release:       1%{?dist}
 License:       LGPLv2+
 
 # Source and patches.
@@ -63,31 +63,33 @@ Patch0035:     0035-builder-Refuse-to-write-to-a-char-device-or-dev-null.patch
 Patch0036:     0036-builder-Remove-blank-line.patch
 Patch0037:     0037-builder-Add-update-option-to-update-template-core-pa.patch
 Patch0038:     0038-launch-libvirt-Don-t-default-to-using-NULL-for-libvi.patch
-Patch0039:     0039-builder-Add-CirrOS-0.3.1-disk-image.patch
-Patch0040:     0040-builder-Note-in-man-page-how-to-specify-size-in-byte.patch
-Patch0041:     0041-builder-Pass-prog-global-program-name-around.patch
-Patch0042:     0042-mllib-Add-library-function-to-run-external-command-a.patch
-Patch0043:     0043-builder-Fix-handling-of-size-parameter.patch
-Patch0044:     0044-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
-Patch0045:     0045-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
-Patch0046:     0046-tests-Add-a-regression-test-for-libvirt-authenticati.patch
-Patch0047:     0047-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
-Patch0048:     0048-builder-docs-Remove-confusing-reference-to-timezone.patch
-Patch0049:     0049-builder-Document-how-to-change-keyboard-layout.patch
-Patch0050:     0050-builder-List-install-packages-in-the-same-order-as-o.patch
-Patch0051:     0051-builder-Add-link-option-for-creating-symbolic-links.patch
-Patch0052:     0052-builder-Document-how-to-change-the-language-locale-o.patch
-Patch0053:     0053-builder-Document-how-to-set-up-local-mirrors-for-per.patch
-Patch0054:     0054-builder-Document-that-SELinux-guests-will-reboot-for.patch
-Patch0055:     0055-builder-Document-how-to-set-Japanese-language-suppor.patch
-Patch0056:     0056-builder-Fix-virt-builder-test.patch
-Patch0057:     0057-builder-website-Add-CirrOS-signature-file-to-EXTRA_D.patch
-Patch0058:     0058-builder-Document-how-to-set-Japanese-in-Debian-7.patch
-Patch0059:     0059-builder-Fix-documentation-for-attach-option.patch
-Patch0060:     0060-builder-Minor-documentation-fix-to-manual-page.patch
-Patch0061:     0061-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
-Patch0062:     0062-builder-For-performance-recommend-using-the-no-sync-.patch
-Patch0063:     0063-builder-planner-Whitespace-change.patch
+Patch0039:     0039-builder-Fix-handling-of-size-parameter.patch
+Patch0040:     0040-libvirt-auth-Provide-a-friendlier-wrapper-around-vir.patch
+Patch0041:     0041-tests-Add-a-regression-test-of-libvirt-authenticatio.patch
+Patch0042:     0042-tests-Add-a-regression-test-for-libvirt-authenticati.patch
+Patch0043:     0043-sysprep-builder-Add-timezone-option-to-set-timezone-.patch
+Patch0044:     0044-builder-Document-how-to-change-keyboard-layout.patch
+Patch0045:     0045-builder-Add-link-option-for-creating-symbolic-links.patch
+Patch0046:     0046-builder-Document-how-to-change-the-language-locale-o.patch
+Patch0047:     0047-builder-Document-how-to-set-up-local-mirrors-for-per.patch
+Patch0048:     0048-builder-Document-how-to-set-Japanese-language-suppor.patch
+Patch0049:     0049-builder-Fix-virt-builder-test.patch
+Patch0050:     0050-builder-Document-how-to-set-Japanese-in-Debian-7.patch
+Patch0051:     0051-builder-Add-no-delete-on-failure-option-to-aid-debug.patch
+Patch0052:     0052-builder-For-performance-recommend-using-the-no-sync-.patch
+Patch0053:     0053-builder-planner-Whitespace-change.patch
+Patch0054:     0054-daemon-xattr-simplify-the-enabling-of-the-linuxxattr.patch
+Patch0055:     0055-daemon-xattr-move-the-listxattrs-code-in-an-own-func.patch
+Patch0056:     0056-daemon-xattr-Remove-unused-variable.patch
+Patch0057:     0057-New-API-copy-attributes.patch
+Patch0058:     0058-Update-generated-files-for-new-copy-attributes-API.patch
+Patch0059:     0059-fish-Add-test-file-attrs.sh-to-EXTRA_DIST.patch
+Patch0060:     0060-builder-edit-fish-use-copy-attributes.patch
+Patch0061:     0061-builder-test-virt-builder-check-some-results.patch
+Patch0062:     0062-builder-small-refactor-of-the-list-output.patch
+Patch0063:     0063-builder-add-list-format.patch
+Patch0064:     0064-builder-add-a-JSON-output-for-list.patch
+Patch0065:     0065-builder-Fix-unterminated-I-.-in-man-page.patch
 # Add any non-git patches here.
 
 # Use git for patch management.
@@ -1079,6 +1081,13 @@ mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/libguestfs
 
 
 %changelog
+* Mon Jan 20 2014 Richard W.M. Jones <rjones at redhat.com> - 1:1.24.5-1
+- New stable branch version 1.24.5.
+- Backport more virt-builder patches from upstream to Fedora 20.
+- Fixes: RHBZ#1044014 RHBZ#1045033 RHBZ#1028660 RHBZ#1055452
+  RHBZ#1053847 RHBZ#660687 RHBZ#1045450 RHBZ#1046509 RHBZ#1025269
+  RHBZ#1044585 RHBZ#1039995 RHBZ#923355 RHBZ#1022431.
+
 * Mon Jan 13 2014 Richard W.M. Jones <rjones at redhat.com> - 1:1.24.4-3
 - Backport more virt-builder patches from upstream to Fedora.
 


More information about the scm-commits mailing list