AU: Delta Diff Generator

Adds a class that can take two root filesystem image and generate a
delta between them. Currently it's not very well tested, but this will
improve once the diff applicator is written.

Also, an executable to run the generator.

Other changes:
- Stop leaking loop devices in unittests
- extent mapper: support sparse files, ability to get FS block size
- AppendBlockToExtents support sparse files
- subprocess more verbose on errors
- add WriteAll to utils (WriteAll avoids short-write() returns)
- mkstemp wrapper for ease of use
- VectorIndexOf, finds index of an element in a vector

Review URL: http://codereview.chromium.org/891002
diff --git a/graph_types.h b/graph_types.h
index afb7f64..109616a 100644
--- a/graph_types.h
+++ b/graph_types.h
@@ -7,6 +7,7 @@
 
 #include <map>
 #include <set>
+#include <string>
 #include <utility>
 #include <vector>
 #include "base/basictypes.h"
@@ -22,7 +23,7 @@
 };
 
 struct Vertex {
-  Vertex() : index(-1), lowlink(-1), op(NULL) {}
+  Vertex() : index(-1), lowlink(-1) {}
   typedef std::map<std::vector<Vertex>::size_type, EdgeProperties> EdgeMap;
   EdgeMap out_edges;
 
@@ -38,7 +39,8 @@
   std::vector<Vertex>::size_type lowlink;
 
   // Other Vertex properties:
-  DeltaArchiveManifest_InstallOperation* op;
+  DeltaArchiveManifest_InstallOperation op;
+  std::string file_name;
 
   typedef std::vector<Vertex>::size_type Index;
   static const Vertex::Index kInvalidIndex = -1;
@@ -48,6 +50,8 @@
 
 typedef std::pair<Vertex::Index, Vertex::Index> Edge;
 
+const uint64 kSparseHole = kuint64max;
+
 }  // namespace chromeos_update_engine
 
 #endif  // CHROMEOS_PLATFORM_UPDATE_ENGINE_GRAPH_TYPES_H__