chiark / gitweb /
libgpg-error: workaround no stdout atexit with constructor prior to N (#1017)
[termux-packages] / packages / ranger / ranger-core-actions.py.patch
1 Hard links do not work on Android starting from 6.0.
2
3 diff -u -r ../ranger-1.7.2/ranger/core/actions.py ./ranger/core/actions.py
4 --- ../ranger-1.7.2/ranger/core/actions.py      2015-10-03 19:46:45.000000000 -0400
5 +++ ./ranger/core/actions.py    2015-11-28 17:30:53.302748825 -0500
6 @@ -8,7 +8,7 @@
7  import string
8  import tempfile
9  from os.path import join, isdir, realpath, exists
10 -from os import link, symlink, getcwd, listdir, stat
11 +from os import symlink, getcwd, listdir, stat
12  from inspect import cleandoc
13  from stat import S_IEXEC
14  from hashlib import sha1
15 @@ -1191,7 +1191,7 @@
16          for f in self.copy_buffer:
17              try:
18                  new_name = next_available_filename(f.basename)
19 -                link(f.path, join(getcwd(), new_name))
20 +                symlink(f.path, join(getcwd(), new_name))
21              except Exception as x:
22                  self.notify(x)
23  
24 @@ -1214,7 +1214,7 @@
25          else:
26              if not exists(target_path) \
27              or stat(source_path).st_ino != stat(target_path).st_ino:
28 -                link(source_path,
29 +                symlink(source_path,
30                      next_available_filename(target_path))
31  
32      def paste(self, overwrite=False, append=False):