Default version to "dev" if no pkg is available
(cherry picked from commit b4ebce1577785e4f496dbe3b1b5a4fc6b79bf9e4)