What problems does this PR aim to fix? Please add some tests.
1 new commit added
Added a test case that demonstrates expected behavior.
This improvement is targeted for lazy people like me who don't want to manually specify files for upload. I just want the tool to decide which files from the working folder should be uploaded. If file extension is among self.UPLOADEXTS and this file is mentioned in spec file as one of the sources, then let's upload it to the lookaside cache. And ignore files that are not mentioned in spec - it is very unlikely that they are required for the build (this sometimes happens that I have garbage files in the folder - e.g., tarballs of different package versions I was experimenting with).
rebased
One concern is, "binary sources" is too general, and it might be possible to upload unecessary binary files in some cases because we cannot assume what concrete files (not file type) would be generated in package repository. It should be much safer by specifying files to upload explicitly I think.
I agree that "binary sources" is a very general term. However, the patch assumes that "binaries" are files with extensions from UPLOADEXTS array - this approach is already used in rpkg when uploading srpms, see _srpmdetails() function. So with this patch, "upload" and "new_sources" commands get behavior similar to the one already used for importing srpms.
Finally, the old behavior remains in place - one still can explicitly specify files to upload.
rebased onto c97709fed8e76875910c49ba2343733cbd3f97df
rebased onto 29796aaa021934669e90fe0504cbee94540134b3