1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-26 14:46:14 +01:00
This commit is contained in:
Marcus Hüwe 2008-09-18 15:04:42 +00:00
parent 71c49cb369
commit db7c4c4ad5
2 changed files with 3 additions and 1 deletions

View File

@ -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:

View File

@ -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: