Make sure that only the first pkg rquery command updates the local copies of the files - use the "-U" flag to skip this step for all the subsequent rquery commands.