7af82f5 Properly handle systemd presets in Lua scripts

Authored and Committed by sgallagh 8 years ago
    Properly handle systemd presets in Lua scripts
    
    There were several problems here:
    1) At some point, arg[2] of Lua RPM scripts stopped comparing TRUE
    to "1" and started returning "1.0" in string context. This patch
    changes the comparison to function in numeric context instead.
    
    2) The logic to put the preset file in place and activate its
    differences was incorrectly conflated. The preset file should
    always be put in place, but the presets should only be applied on
    initial installation.
    
    3) The close() on the file descriptor reading the presets happened
    too early.
    
    4) The symlink for the preset was pointing at a typoed directory name
    
    5) Uninstallation was not properly setting the variant to "nonproduct"
    
    Resolves: rhbz#1317721
    
    Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
    
        
file modified
+19 -16