Search /usr/local/lib for p7zip RAR modules. See issue #10
This commit is contained in:
parent
70fdbf8536
commit
e8dc5e853e
|
@ -1,3 +1,9 @@
|
|||
1.6 (released xx.xx.2014)
|
||||
|
||||
* Search /usr/local/lib for p7zip RAR modules.
|
||||
Closes: GH bug #10
|
||||
|
||||
|
||||
1.5 (released 30.3.2014)
|
||||
|
||||
* Fix detection of existing broken symlinks when unpacking.
|
||||
|
|
|
@ -526,12 +526,19 @@ def strtimezone():
|
|||
return "%+04d" % (-zone//3600)
|
||||
|
||||
|
||||
def p7zip_supports_rar ():
|
||||
def p7zip_supports_rar():
|
||||
"""Determine if the RAR codec is installed for 7z program."""
|
||||
if os.name == 'nt':
|
||||
# Assume RAR support is compiled into the binary.
|
||||
return True
|
||||
return os.path.exists('/usr/lib/p7zip/Codecs/Rar29.so')
|
||||
# the subdirectory and codec name
|
||||
codecname = 'p7zip/Codecs/Rar29.so'
|
||||
# search canonical user library dirs
|
||||
for libdir in ('/usr/lib', '/usr/local/lib'):
|
||||
fname = os.path.join(libdir, codecname)
|
||||
if os.path.exists(fname):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
@memoized
|
||||
|
|
Loading…
Reference in New Issue