Yedidyah Bar David has posted comments on this change.
Change subject: packaging: setup: enhance line uninstall
......................................................................
Patch Set 6:
(4 comments)
....................................................
File packaging/setup/plugins/ovirt-engine-remove/files/simple.py
Line 88: #should be updated or added
Line 89: if line in replace:
Line 90: line = replace[line]
Line 91: new_content.append(line)
Line 92: new_content.extend(just_add)
You mean for "just_add" - yes. Not used in practice so far. In practice, almost
all file types we might need to edit allow some type of comment, so we can
replace with a comment instead of deleting, and so find this comment and
replace back on cleanup.
There is another issue - what happens with duplicate lines. This isn't
addressed currently specifically - for replacements, the above code will simply
replace all occurrences. In principle this might lead to bugs.
I admit I am not at all very satisfied with this mechanism. Might be better to
use diff/patch or something like that, with its own set of problems... For now,
the above might be good enough, where the only user is ssl.conf.
Line 93:
Line 94: self.environment[otopicons.CoreEnv.MAIN_TRANSACTION].append(
Line 95: filetransaction.FileTransaction(
Line 96: name=filename,
Line 218: comps = name.split('.')
Line 219: if comps[0] == 'line':
Line 220:
Line 221: index = comps[1]
Line 222: # e.g. '00001', '00002', etc
Moved inline
Line 223:
Line 224: line_type = comps[2]
Line 225: # currently 'name' or 'content'
Line 226:
Line 234: action = comps[3]
Line 235: # currently 'added' or 'removed'
Line 236:
Line 237: associated_lines.setdefault(index, {})
Line 238: if len(comps) == 3:
Done
Line 239: associated_lines[index][line_type] = value
Line 240: else:
Line 241:
associated_lines[index].setdefault(line_type, {})
Line 242:
associated_lines[index][line_type][action] = value
Line 237: associated_lines.setdefault(index, {})
Line 238: if len(comps) == 3:
Line 239: associated_lines[index][line_type] = value
Line 240: else:
Line 241:
associated_lines[index].setdefault(line_type, {})
Done. Not sure you'd like my indentation...
Line 242:
associated_lines[index][line_type][action] = value
Line 243:
Line 244: for f in associated_lines.values():
Line 245: aggregated_lines.setdefault(
--
To view, visit http://gerrit.ovirt.org/16768
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I69ab434de8fb675c67ac5d1907879e465e587dbf
Gerrit-PatchSet: 6
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Alex Lourie <[email protected]>
Gerrit-Reviewer: Alon Bar-Lev <[email protected]>
Gerrit-Reviewer: Ofer Schreiber <[email protected]>
Gerrit-Reviewer: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Yedidyah Bar David <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches