modified the readPkgName function

Change-Id: I074dacb7bddbdbf3af2b24c1e14fa13f9d4418d6