merge from installedports_patch

 e4149505f70f4dc3b6acc7932c5efffa61a095fa a1lu
TODO solve same name+version mismatches

 TODO for matches with obsolate version-tag in port
 parsing (e.g. perl-threaded)
fix regex pattern

 ex_name = r'(^\w.+-)' -> ex_name = r'(^\w.+)\-'
 ex_name_version = r'(^\w.+-)(\d).\d*' -> ex_name_version = r'(^\w.+)-(\d).\d*'
typos, codingstyle and add modeline