func CompareVersions(ver1, ver2 string) int {
	e1, u1, d1 := parseVersion(ver1)
	e2, u2, d2 := parseVersion(ver2)
	r := compareVersionPart(e1, e2)
	if r != 0 {
		return r
	}
	r = compareVersionPart(u1, u2)
	if r != 0 {
		return r
	}
	return compareVersionPart(d1, d2)
}
Using documentation from: http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
CompareVersions compares two package versions
package deb
import (
	"fmt"
	"regexp"
	"strconv"
	"strings"
	"unicode"
)