mirror of
https://github.com/fastogt/pyfastogt
synced 2025-03-09 23:38:55 +00:00
force symlink
This commit is contained in:
parent
607e77b2d0
commit
2a838e7a31
2 changed files with 15 additions and 4 deletions
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import platform
|
||||
import re
|
||||
import subprocess
|
||||
from abc import ABCMeta, abstractmethod
|
||||
|
||||
|
@ -116,9 +115,9 @@ class LinuxPlatforms(SupportedPlatforms):
|
|||
def __init__(self):
|
||||
SupportedPlatforms.__init__(self, 'linux', [Architecture('x86_64', 64, '/usr/local'),
|
||||
Architecture('i386', 32, '/usr/local'),
|
||||
Architecture('armv7l', 32, '/usr/local'),
|
||||
Architecture('armv6l', 32, '/usr/local')],
|
||||
['DEB', 'RPM', 'TGZ'])
|
||||
Architecture('armv7l', 32, '/usr/local'),
|
||||
Architecture('armv6l', 32, '/usr/local')],
|
||||
['DEB', 'RPM', 'TGZ'])
|
||||
|
||||
def make_platform_by_arch(self, arch, package_types) -> Platform:
|
||||
distr = linux_get_dist()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import errno
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
|
@ -136,3 +137,14 @@ def git_clone(url, current_dir):
|
|||
common_git_clone_init_line = ['git', 'submodule', 'update', '--init', '--recursive']
|
||||
subprocess.call(common_git_clone_init_line)
|
||||
return os.path.join(current_dir, cloned_dir)
|
||||
|
||||
|
||||
def symlink_force(target, link_name):
|
||||
try:
|
||||
os.symlink(target, link_name)
|
||||
except OSError as e:
|
||||
if e.errno == errno.EEXIST:
|
||||
os.remove(link_name)
|
||||
os.symlink(target, link_name)
|
||||
else:
|
||||
raise e
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue