Исправления для magic file и версии

develop
Mike Hiretsky 10 years ago
parent a080c88717
commit 105978466b

@ -260,7 +260,7 @@ class DistributiveRepository:
def getDistributiveByFile(self,filename):
"""Get Distributive object by filename"""
# MAGIC_COMPRESS 0x000004 Check inside compressed files
tf = typeFile(magic=0x6)
tf = typeFile(magic=0x6|0x20)
ftype = tf.getMType(filename)
if "block special" in ftype:
return IsoDistributive(filename)
@ -1228,7 +1228,7 @@ class IsoDistributive(Distributive):
def _mountIso(self,file,directory):
if self.file != self.mdirectory:
self._makeDirectory(directory)
tf = typeFile(magic=0x6)
tf = typeFile(magic=0x6|0x20)
ftype = tf.getMType(file)
if "block special" in ftype:
mopts = ""

@ -32,13 +32,16 @@ from types import StringType
import tarfile
try:
from magic import open as type_file, MAGIC_NONE as MAGIC_NONE
from magic import (open as type_file, MAGIC_NONE as MAGIC_NONE,
MAGIC_CONTINUE)
except ImportError:
try:
from magic import open as type_file, NONE as MAGIC_NONE
from magic import (open as type_file, NONE as MAGIC_NONE,
CONTINUE as MAGIC_CONTINUE)
except:
type_file = None
MAGIC_NONE = None
MAGIC_CONTINUE = None
import cl_lang
tr = cl_lang.lang()
@ -99,7 +102,7 @@ class proxy_type_file:
if processFile.success():
return processFile.read().rstrip()
else:
processFile = process("file","-bz",filename)
processFile = process("file","-bkz",filename)
if processFile.success():
return processFile.read().rstrip()
return None

@ -543,7 +543,7 @@ class varsShare:
gentooFile = path.join(systemroot,"etc/gentoo-release")
systemVersion = ""
flagGentoo = False
reVer=re.compile("^(\d+\.)*\d$",re.S)
reVer=re.compile("^(\d+\.)*\d+$",re.S)
if path.exists(gentooFile):
gentooLink = path.join(systemroot,"etc/make.profile")
if path.islink(gentooLink):

Loading…
Cancel
Save