image_signing: set_lsb_release: simplify file rewriting

Collapse the 4 sudo calls & temporary file into a single call.
This is a bit easier to read and is faster as a result.

We can also hoist the selinux restore to do it only once at the
end if we modified the file.

BUG=None on an image still works

Change-Id: I300cf47d017d159d762a62fe2aab789ce391f89a
Signed-off-by: Mike Frysinger <>
Reviewed-by: George Engelbrecht <>
1 file changed