a86f885 Reverse the order by which variables are populated

Authored and Committed by Denton Liu 2 years ago
    Reverse the order by which variables are populated
    
    On Arch Linux, when asking for the description, we get it:
    
    	$ ./lsb_release -d
    	Description:    Arch Linux
    
    But when we ask for the codename of the release as well, the description
    is set to "(none)".
    
    	$ ./lsb_release -d -c
    	Description:    (none)
    	Codename:       n/a
    
    This happens because when we request the codename, in GetDistribInfo(),
    we trigger the InitDistribInfo() logic when -c is given. This overrides
    the DISTRIB_DESCRIPTION variable that has been parsed from
    /etc/lsb-release.
    
    However, according to lsb_release/src/lsb_release.examples:
    
    	Optional fields are DISTRIB_ID, DISTRIB_RELEASE,
    	DISTRIB_CODENAME, DISTRIB_DESCRIPTION and can be used to
    	override information which is parsed from the
    	"/etc/distrib-release" file.
    
    This means that we're actually invoking GetLSBInfo() and
    GetDistribInfo() in reverse order. We should invoke GetDistribInfo()
    first so that it can be overridden by GetLSBInfo() later. Reverse the
    calling order of these two functions.
    
    Since we've reversed the calling order, GetDistribInfo() will never have
    any of the variables populated when it's called so remove the checks for
    those.
    
        
file modified
+6 -12