diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2017-04-03 19:16:57 +0100 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2017-04-06 22:48:02 +0100 |
commit | 320490cd00ee651fb41869bc974cd58d572ee784 (patch) | |
tree | e32e1f8de7f2fe01d019c66f6a870995b5f5cddc | |
parent | 6c9260c47f62656e81a9af08121d3e1c592d9f7b (diff) | |
download | meson-320490cd00ee651fb41869bc974cd58d572ee784.zip meson-320490cd00ee651fb41869bc974cd58d572ee784.tar.gz meson-320490cd00ee651fb41869bc974cd58d572ee784.tar.bz2 |
Ignore install as non-existent user or group
'test cases/common/12 data' and 'test cases/common/66 install subdir' both
try to install something as 'root'. This user doesn't exist on Cygwin.
Perhaps we should automatically convert this to some other user, but it's
not clear which. For real projects, it's possibly better for the meson.build
to explicitly handle this...
'test cases/common/12 data' also tries to install something with GID 0.
There's no guarantee this group exists.
-rw-r--r-- | mesonbuild/scripts/meson_install.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/mesonbuild/scripts/meson_install.py b/mesonbuild/scripts/meson_install.py index af84f64..e172032 100644 --- a/mesonbuild/scripts/meson_install.py +++ b/mesonbuild/scripts/meson_install.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import sys, pickle, os, shutil, subprocess, gzip, platform +import sys, pickle, os, shutil, subprocess, gzip, platform, errno from glob import glob from . import depfixer from . import destdir_join @@ -34,6 +34,15 @@ def set_mode(path, mode): except PermissionError as e: msg = '{!r}: Unable to set owner {!r} and group {!r}: {}, ignoring...' print(msg.format(path, mode.owner, mode.group, e.strerror)) + except LookupError as e: + msg = '{!r}: Non-existent owner {!r} or group {!r}: ignoring...' + print(msg.format(path, mode.owner, mode.group)) + except OSError as e: + if e.errno == errno.EINVAL: + msg = '{!r}: Non-existent numeric owner {!r} or group {!r}: ignoring...' + print(msg.format(path, mode.owner, mode.group)) + else: + raise # Must set permissions *after* setting owner/group otherwise the # setuid/setgid bits will get wiped by chmod # NOTE: On Windows you can set read/write perms; the rest are ignored |