I also highly recommend to use the available solutions for the problem. Other distributions also have dpkg in their repositories. If you want to support different repositories, can't you just add a repository type and use a specificic compare function per type?