moved check for dist_majrelease to top of function so it resolves on ubuntu/debian as well