mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-26 14:46:14 +01:00
- fixed #427118
This commit is contained in:
parent
71c49cb369
commit
db7c4c4ad5
@ -168,6 +168,8 @@ class OptionLine(Line):
|
||||
def format(self, line):
|
||||
mo = ConfigParser.ConfigParser.OPTCRE.match(line.strip())
|
||||
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)
|
||||
pos = val.find(' ;')
|
||||
if pos >= 0:
|
||||
|
@ -264,7 +264,7 @@ def write_initial_config(conffile, entries, custom_template = ''):
|
||||
try:
|
||||
try:
|
||||
os.chmod(conffile, 0600)
|
||||
cp.write(file)
|
||||
cp.write(file, True)
|
||||
except IOError, e:
|
||||
raise oscerr.OscIOError(e, 'cannot write configfile \'s\'' % conffile)
|
||||
finally:
|
||||
|
Loading…
Reference in New Issue
Block a user