The PkgCopier was written mainly for the purpose of copying a package out of an installer or bundle (think Flash Player), rather than copying a result to a final destination, so there wasn't a consideration for it to look for existing packages first.
It's good you picked up on the 'new_package_request' output variable. Take a look at the StopProcessingIf processor:
https://github.com/autopkg/autopkg/blob/f37212bd9780896c4d4d80af1a13bca1fb1aae6c/Code/autopkglib/StopProcessingIf.py#L29-L35
This processor stops processing the recipe any further if the NSPredicate evaluates to true. This is the same underlying mechanism for Munki's conditional_items in manifests.
StopProcessingIf is the only core AutoPkg processor that implements any conditional logic, which we're pretty wary about encouraging. However, it's still there and works for situations like this.
So, by adding StopProcessingIf before your PkgCopier processor, we can stop this recipe from going any further, and we didn't need to write a custom processor:
https://gist.github.com/timsutton/d834f81feaa4d1190573#file-firefox-ds-plist-L37-L45
Below that recipe file in the gist is the output of me running autopkg a second time to a temporary repo location.
For what it's worth, you could probably also just use the Copier processor here instead, but the result is the same if you're just copying package files.
Tim
> --
> You received this message because you are subscribed to the Google Groups "autopkg-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
autopkg-discu...@googlegroups.com.
> For more options, visit
https://groups.google.com/d/optout.