|
|
@ -1596,6 +1596,7 @@ class _file(_error):
|
|
|
|
self.nameFileConfig = os.path.abspath(nameFileConfig)
|
|
|
|
self.nameFileConfig = os.path.abspath(nameFileConfig)
|
|
|
|
self.nameFileTemplate = os.path.abspath(nameFileTemplate)
|
|
|
|
self.nameFileTemplate = os.path.abspath(nameFileTemplate)
|
|
|
|
self.F_TEMPL = self.openTemplFile(self.nameFileTemplate)
|
|
|
|
self.F_TEMPL = self.openTemplFile(self.nameFileTemplate)
|
|
|
|
|
|
|
|
copy_stat = not os.path.exists(self.nameFileConfig)
|
|
|
|
if (not self.executeType and
|
|
|
|
if (not self.executeType and
|
|
|
|
typeFormat not in HParams.Formats.Executable):
|
|
|
|
typeFormat not in HParams.Formats.Executable):
|
|
|
|
self.F_CONF = self.__openConfFile(self.nameFileConfig)
|
|
|
|
self.F_CONF = self.__openConfFile(self.nameFileConfig)
|
|
|
@ -1606,11 +1607,25 @@ class _file(_error):
|
|
|
|
self.nameFileConfig)
|
|
|
|
self.nameFileConfig)
|
|
|
|
if newBuffer is None:
|
|
|
|
if newBuffer is None:
|
|
|
|
self.textConfig = readFile(origConfigName)
|
|
|
|
self.textConfig = readFile(origConfigName)
|
|
|
|
|
|
|
|
if copy_stat:
|
|
|
|
|
|
|
|
self.copy_mod_own(origConfigName, self.nameFileConfig)
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.textConfig = newBuffer
|
|
|
|
self.textConfig = newBuffer
|
|
|
|
else:
|
|
|
|
else:
|
|
|
|
self.textConfig = self.F_CONF.read()
|
|
|
|
self.textConfig = self.F_CONF.read()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def copy_mod_own(self, source, target):
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
statdata = os.stat(source)
|
|
|
|
|
|
|
|
statdata_old = os.stat(target)
|
|
|
|
|
|
|
|
if statdata.st_mode != statdata_old.st_mode:
|
|
|
|
|
|
|
|
os.chmod(target, statdata.st_mode)
|
|
|
|
|
|
|
|
if (statdata.st_uid != statdata_old.st_uid or
|
|
|
|
|
|
|
|
statdata.st_gid != statdata_old.st_gid):
|
|
|
|
|
|
|
|
os.chown(target, statdata.st_uid, statdata.st_gid)
|
|
|
|
|
|
|
|
except OSError:
|
|
|
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
def __del__(self):
|
|
|
|
def __del__(self):
|
|
|
|
self.closeFiles()
|
|
|
|
self.closeFiles()
|
|
|
|
|
|
|
|
|
|
|
@ -4578,6 +4593,7 @@ gettext -d cl_template "$*"
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
open(filename, 'w').write(
|
|
|
|
open(filename, 'w').write(
|
|
|
|
readFile(cfgs[filename][0][1]))
|
|
|
|
readFile(cfgs[filename][0][1]))
|
|
|
|
|
|
|
|
self.copy_mod_own(cfgs[filename][0][1], filename)
|
|
|
|
except Exception as e:
|
|
|
|
except Exception as e:
|
|
|
|
self.printERROR(str(e))
|
|
|
|
self.printERROR(str(e))
|
|
|
|
self.printWARNING(
|
|
|
|
self.printWARNING(
|
|
|
|