Extract debian version calculation into a function

Change-Id: Ib16f0fb819639ef85526c1be65268c5a762773c7
Merge "Extract debian version calculation into a function"