mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 18:46:17 +01:00
- fixed #427118
This commit is contained in:
parent
71c49cb369
commit
db7c4c4ad5
@ -168,6 +168,8 @@ class OptionLine(Line):
|
|||||||
def format(self, line):
|
def format(self, line):
|
||||||
mo = ConfigParser.ConfigParser.OPTCRE.match(line.strip())
|
mo = ConfigParser.ConfigParser.OPTCRE.match(line.strip())
|
||||||
key, val = mo.group('option', 'value')
|
key, val = mo.group('option', 'value')
|
||||||
|
# escape all occurrences of '%' otherwise string formatting will fail
|
||||||
|
line = line.replace('%', '%%')
|
||||||
self.frmt = line.replace(key.strip(), '%s', 1)
|
self.frmt = line.replace(key.strip(), '%s', 1)
|
||||||
pos = val.find(' ;')
|
pos = val.find(' ;')
|
||||||
if pos >= 0:
|
if pos >= 0:
|
||||||
|
@ -264,7 +264,7 @@ def write_initial_config(conffile, entries, custom_template = ''):
|
|||||||
try:
|
try:
|
||||||
try:
|
try:
|
||||||
os.chmod(conffile, 0600)
|
os.chmod(conffile, 0600)
|
||||||
cp.write(file)
|
cp.write(file, True)
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
raise oscerr.OscIOError(e, 'cannot write configfile \'s\'' % conffile)
|
raise oscerr.OscIOError(e, 'cannot write configfile \'s\'' % conffile)
|
||||||
finally:
|
finally:
|
||||||
|
Loading…
Reference in New Issue
Block a user