Do real checks against the possible file extensions of a pkgfile
Created by: eli-schwartz
See various discussion around https://lists.archlinux.org/pipermail/arch-projects/2018-February/004746.html and https://lists.archlinux.org/pipermail/arch-projects/2018-February/004748.html
It may make sense to add some version of https://lists.archlinux.org/pipermail/arch-projects/2018-February/004794.html in after the second commit.