summaryrefslogtreecommitdiff
path: root/snap/pre/pack_installers
diff options
context:
space:
mode:
Diffstat (limited to 'snap/pre/pack_installers')
-rwxr-xr-xsnap/pre/pack_installers9
1 files changed, 6 insertions, 3 deletions
diff --git a/snap/pre/pack_installers b/snap/pre/pack_installers
index a893574..827d16e 100755
--- a/snap/pre/pack_installers
+++ b/snap/pre/pack_installers
@@ -34,6 +34,7 @@ with open(INSTALL, 'w') as install:
install.write('# It is generated automatically\n')
install.write('# by the script at "snap/pre/pack_installers"\n')
install.write('import subprocess\n')
+ install.write('import os\n')
install.write('from base64 import decodestring as decode\n')
install.write("""
POLKIT = {polkit}
@@ -47,9 +48,11 @@ with open('/etc/os-release') as f:
release = f.read()
# this is a workaround for the fact that debian does not place snap desktop entries in a system+wide path.
if 'ID=debian' in release:
- cmd = 'ln -s /snap/{app_name}/current/snap/gui/{app_name}.desktop /usr/share/applications/'
- subprocess.run(cmd.split(' '))
- subprocess.run(['update-desktop-database'])
+ desktop_path = "/usr/share/applications/{app_name}.desktop"
+ if os.path.exists(desktop_path):
+ os.remove(desktop_path)
+ os.symlink("/snap/{app_name}/current/snap/gui/{app_name}.desktop", desktop_path)
+ subprocess.call(['update-desktop-database'])
""".format(
polkit=b64_polkit,
polkit_file=POLKIT_FILE,