Drop intermediate zip archive from py_binary output

If you feed a py_binary into a pkg_tar to a pkg_deb, you won't want to
have the deploy_zip intermediate artifact included in the resulting
package.  I'm think this change keeps it as an expected byproduct of
the build, but drops it from the list of files produced by the
y_binary rule.

Also trimmed a superfluous chmod from the final concat action.

--
Change-Id: Ib2bc05c2e43c7329bd9d92ea034f0c613f7fcbc6
Reviewed-on: https://bazel-review.googlesource.com/#/c/2280
MOS_MIGRATED_REVID=109290774
diff --git a/tools/build_rules/py_rules.bzl b/tools/build_rules/py_rules.bzl
index d735b39..cdb2d9b 100644
--- a/tools/build_rules/py_rules.bzl
+++ b/tools/build_rules/py_rules.bzl
@@ -45,7 +45,8 @@
   # of using a nested set. We need to do it this way because Skylark currently
   # does not support actions with non-artifact executables but with an
   # argument list (instead of just a single command)
-  command = ZIP_PATH +" -q " + deploy_zip_nomain.path + " " + " ".join([f.path for f in transitive_sources])
+  command = " ".join([ZIP_PATH, " -q ", deploy_zip_nomain.path,
+                      " ".join([f.path for f in transitive_sources])])
   ctx.action(
       inputs = list(transitive_sources),
       outputs = [ deploy_zip_nomain ],
@@ -77,15 +78,15 @@
   ctx.action(
       inputs = [ deploy_zip, ],
       outputs = [ executable, ],
-      command = "echo '#!/usr/bin/env python' | cat - %s > %s && chmod +x %s" % (
-          deploy_zip.path, executable.path, executable.path))
+      command = "echo '#!/usr/bin/env python' | cat - %s > %s" % (
+          deploy_zip.path, executable.path))
 
   runfiles_files = transitive_sources + [executable]
 
   runfiles = ctx.runfiles(transitive_files = runfiles_files,
                           collect_default = True)
 
-  files_to_build = set([deploy_zip, executable])
+  files_to_build = set([executable])
   return struct(files = files_to_build, runfiles = runfiles)