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.)
pull/3134/head
Filipe Brandenburger 7 years ago committed by Nirbheek Chauhan
parent 6bab3d40a9
commit 0ccc0e92d1
  1. 2
      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'

Loading…
Cancel
Save