From 0ccc0e92d114a281ba99fd668f36e69670a0af68 Mon Sep 17 00:00:00 2001
From: Filipe Brandenburger <filbranden@google.com>
Date: Wed, 25 Apr 2018 00:25:51 -0700
Subject: [PATCH] Check mode of file, not subdirectory, in install_subdir.

When using an install_mode in install_subdir(), that should apply to the
files and not to the directory tree.

Otherwise, an install_mode not including the executable bit will make
the tree inaccessible, since directories need it to be traversed.

If the mode needs to be applied to both files and directories, then
install_subdir() is only useful to install files with the executable bit
set, which is not really that useful...

So default to just using the umask for the directories and applying
install_mode to the files only.

This can be reviewed in the future, possibly by adding a separate
install_dir_mode attribute, or perhaps adding an optional fourth field
to FileMode with the mode for directories (this is similar to how RPM
handles specifying mode of directory trees recursively added to the
package.)
---
 run_unittests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/run_unittests.py b/run_unittests.py
index ec10833b4..061e40e10 100755
--- a/run_unittests.py
+++ b/run_unittests.py
@@ -2778,7 +2778,7 @@ class LinuxlikeTests(BasePlatformTests):
         self.init(testdir)
         self.install()
 
-        f = os.path.join(self.installdir, 'usr', 'share', 'sub1')
+        f = os.path.join(self.installdir, 'usr', 'share', 'sub1', 'second.dat')
         statf = os.stat(f)
         found_mode = stat.filemode(statf.st_mode)
         want_mode = 'rwxr-x--t'