diff --git a/scripts/installer/install.py b/scripts/installer/install.py index cb0c880..40342cb 100644 --- a/scripts/installer/install.py +++ b/scripts/installer/install.py @@ -163,7 +163,7 @@ def bundle(args): for origin in sources: if origin.is_symlink() or not origin.is_file(): fail(f'Bundle input must be a regular file: {origin}') - if rule['mode'] == '0755' and not os.access(origin, os.X_OK): + if rule['source'].startswith('target/release/') and not os.access(origin, os.X_OK): fail(f'Bundle input is not executable: {origin}') item = record(rule, origin.name) diff --git a/scripts/tests/test_portal_install.py b/scripts/tests/test_portal_install.py index 526d4ee..0dabf39 100644 --- a/scripts/tests/test_portal_install.py +++ b/scripts/tests/test_portal_install.py @@ -36,7 +36,7 @@ class InstallerTest(unittest.TestCase): target = cls.source / path.relative_to(REPO) target.parent.mkdir(parents=True, exist_ok=True) target.write_bytes(b'#!/bin/sh\nexit 0\n' if rule['source'].startswith('target/release/') else path.read_bytes()) - target.chmod(int(rule['mode'], 8)) + target.chmod(0o755 if rule['source'].startswith('target/release/') else path.stat().st_mode & 0o777) cls.bundles = [] for name in ('first', 'second'): @@ -106,6 +106,11 @@ m.main() return result + def test_launcher_permissions_are_assigned_when_bundling(self): + self.assertEqual((self.source / 'packaging/ferese-session').stat().st_mode & 0o111, 0) + for name in ('ferese-session', 'ferese-session-shell', 'ferese-screenshot'): + self.assertEqual((self.bundles[0] / name).stat().st_mode & 0o777, 0o755) + def test_fresh_upgrade_and_rollback_restore_all_integration(self): self.install() first = [(self.root / path).read_bytes() for path in (PORTAL, UNIT, DESKTOP)]