Simplify the logic for getting library revision number.