Handle both tar.gz and tar.bz2