File: add_symlink.py

package info (click to toggle)
cinnamon 6.4.13-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 13,304 kB
  • sloc: javascript: 54,298; ansic: 51,499; python: 21,971; xml: 2,803; sh: 96; makefile: 27; perl: 13
file content (18 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3

import os
import subprocess

link_path = os.path.join('etc', 'xdg', 'menus', 'cinnamon-applications-merged')
dest = os.environ.get('DESTDIR')

if dest:
    link_path = os.path.join(dest, link_path)
else:
    link_path = os.path.join('/', link_path)

if os.path.lexists(link_path):
    print('%s already exists, skipping symlink creation' % link_path)
else:
    print('adding symlink %s...' % link_path)
    subprocess.call(['ln', '-s', 'applications-merged', link_path])