updatemetadata script now accepts either a list of pids or a query