Make package listing script smarter