Fix GenerateIndex for gsutil directories by stripping colon off directory names.

The gsutil ls -L will recursively list the contents of a directory.
Subdirectories are listed with a ':' after them like this: 'subdir/:' with their
contents listed under it. When recursing gsutil will fail on directories that
end with '/:'. This CL strips the colon from that output.

Also looked into:
gsutil ls -r (and -R) dir: still puts the colon at the end
gsutil ls -L dir/** (for flat listing): does not list sub directories at all;
 only shows the files.

Review URL:

git-svn-id: svn:// 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ b/
index a130c20..1e8032a 100755
--- a/
+++ b/
@@ -184,6 +184,7 @@
   assert p.returncode == 0
   objects = str(p_stdout).splitlines()
   objects = [o for o in objects if posixpath.basename(o) != GENERATED_INDEX]
+  objects = [path.rstrip(':') for path in objects]
   # Find common prefixes.
   directories = set()
   for o in objects: