Parse package list in a function.