|
|
@ -31,14 +31,11 @@ class Install(DistUtilsExtra.auto.install_auto):
|
|
|
|
|
|
|
|
|
|
|
|
def ensure_polkit_prefix(self):
|
|
|
|
def ensure_polkit_prefix(self):
|
|
|
|
"""Make sure the policy file uses the right prefix."""
|
|
|
|
"""Make sure the policy file uses the right prefix."""
|
|
|
|
policy_path = os.path.join(
|
|
|
|
|
|
|
|
self.install_data,
|
|
|
|
|
|
|
|
'share/polkit-1/actions/org.key-mapper.policy'
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
executable = os.path.join(self.install_data, 'bin/key-mapper-gtk')
|
|
|
|
executable = os.path.join(self.install_data, 'bin/key-mapper-gtk')
|
|
|
|
assert os.path.exists(executable)
|
|
|
|
assert os.path.exists(executable)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
policy_path = '/usr/share/polkit-1/actions/org.key-mapper.policy'
|
|
|
|
|
|
|
|
|
|
|
|
with open(policy_path, 'r') as f:
|
|
|
|
with open(policy_path, 'r') as f:
|
|
|
|
contents = f.read()
|
|
|
|
contents = f.read()
|
|
|
|
if not '{executable}' in contents:
|
|
|
|
if not '{executable}' in contents:
|
|
|
|