File tree Expand file tree Collapse file tree
typecode_libmagic_system_provided Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414
1515setup (
1616 name = 'extractcode_7z_system_provided' ,
17- version = '32 .0.0' ,
17+ version = '33 .0.0' ,
1818 license = 'apache-2.0 AND lgpl-2.1 and unrar and brian-gladman-3-clause' ,
1919 description = desc ,
2020 long_description = desc ,
Original file line number Diff line number Diff line change @@ -19,10 +19,10 @@ class SevenzipPaths(LocationProviderPlugin):
1919
2020 def get_like_distro (self ):
2121 info = platform .freedesktop_os_release ()
22- ids = [info ["ID" ]]
23- if " ID_LIKE" in info :
22+ ids = [info ['ID' ]]
23+ if ' ID_LIKE' in info :
2424 # ids are space separated and ordered by precedence
25- ids .extend (info [" ID_LIKE" ].split ())
25+ ids .extend (info [' ID_LIKE' ].split ())
2626 return ids
2727
2828
@@ -46,6 +46,7 @@ def get_locations(self):
4646 lib_dir = '/usr/bin'
4747 lib_7z = path .join (lib_dir , '7z' )
4848 elif any (dist in rpm_based_distro for dist in distribution ):
49+ # 7zip proper is not available on dnf
4950 lib_dir = '/usr/libexec/p7zip'
5051 lib_7z = path .join (lib_dir , '7za' )
5152 else :
Original file line number Diff line number Diff line change 1414
1515setup (
1616 name = 'extractcode_libarchive_system_provided' ,
17- version = '32 .0.0' ,
17+ version = '33 .0.0' ,
1818 license = 'apache-2.0 AND bsd-simplified' ,
1919 description = desc ,
2020 long_description = desc ,
Original file line number Diff line number Diff line change @@ -41,12 +41,16 @@ def get_locations(self):
4141 rpm_based_distro = ['fedora' , 'rhel' ]
4242
4343 if any (dist in debian_based_distro for dist in distribution ):
44- db_dir = '/usr/lib/file'
45- lib_dir = '/usr/lib' if platform .architecture ()[0 ] == '32bit' else '/usr/lib/' + system_arch + '-linux-gnu'
44+ lib_dir = (
45+ '/usr/lib' if platform .architecture ()[0 ] == '32bit'
46+ else f'/usr/lib/{ system_arch } -linux-gnu'
47+ )
4648
4749 elif any (dist in rpm_based_distro for dist in distribution ):
48- db_dir = '/usr/share/misc'
49- lib_dir = '/usr/lib' if platform .architecture ()[0 ] == '32bit' else '/usr/lib64'
50+ lib_dir = (
51+ '/usr/lib' if platform .architecture ()[0 ] == '32bit'
52+ else '/usr/lib64'
53+ )
5054
5155 else :
5256 raise Exception (
Original file line number Diff line number Diff line change 1414
1515setup (
1616 name = 'typecode_libmagic_system_provided' ,
17- version = '32 .0.0' ,
17+ version = '33 .0.0' ,
1818 license = (
1919 'apache-2.0 AND bsd-simplified-darwin AND (bsd-simplified AND public-domain AND '
2020 'bsd-new AND isc AND (bsd-new OR gpl-1.0-plus) AND bsd-original)'
Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ class LibmagicPaths(LocationProviderPlugin):
3232
3333 def get_like_distro (self ):
3434 info = platform .freedesktop_os_release ()
35- ids = [info ["ID" ]]
36- if " ID_LIKE" in info :
35+ ids = [info ['ID' ]]
36+ if ' ID_LIKE' in info :
3737 # ids are space separated and ordered by precedence
38- ids .extend (info [" ID_LIKE" ].split ())
38+ ids .extend (info [' ID_LIKE' ].split ())
3939 return ids
4040
4141 def get_locations (self ):
@@ -53,11 +53,17 @@ def get_locations(self):
5353
5454 if any (dist in debian_based_distro for dist in distribution ):
5555 db_dir = '/usr/lib/file'
56- lib_dir = '/usr/lib' if platform .architecture ()[0 ] == '32bit' else '/usr/lib/' + system_arch + '-linux-gnu'
56+ lib_dir = (
57+ '/usr/lib' if platform .architecture ()[0 ] == '32bit'
58+ else f'/usr/lib/{ system_arch } -linux-gnu'
59+ )
5760
5861 elif any (dist in rpm_based_distro for dist in distribution ):
5962 db_dir = '/usr/share/misc'
60- lib_dir = '/usr/lib' if platform .architecture ()[0 ] == '32bit' else '/usr/lib64'
63+ lib_dir = (
64+ '/usr/lib' if platform .architecture ()[0 ] == '32bit'
65+ else '/usr/lib64'
66+ )
6167
6268 else :
6369 raise Exception ('Unsupported system: {}' .format (distribution ))
@@ -100,5 +106,5 @@ def get_locations(self):
100106 'typecode.libmagic.libdir' : lib_dir ,
101107 'typecode.libmagic.dll' : dll_loc ,
102108 'typecode.libmagic.db' : magicdb_loc ,
103- }
109+ }
104110 return locations
You can’t perform that action at this time.
0 commit comments