[pacman-dev] [PATCH 2/2] Allow wildcards in PURGE_TARGETS to match any type of file except for directories.

Allan McRae allan at archlinux.org
Tue Jun 12 08:15:09 EDT 2012

On 12/06/12 16:09, Jeremy Huntwork wrote:
> On Tuesday, June 12, 2012 at 1:48 AM, Allan McRae wrote:
>> Am I missing something here? How does that differ from the plain "rm -f
>> ${pt}"?
> It matches subdirectories, too, which may or may not be what is really intended.
> If pattern = "dir1/dir2/*.txt" then:
> The rm -rf method will match *.txf files in dir1/dir2
> The find method will in addition match "dir1/dir2/dir3/*.txt", which may or may not be what is intended.

I'd say definitely not what is intended.

> After playing with this for some time, it seems to me that using PURGE_TARGETS only for the contents of a split package is backwards. PURGE_TARGETS may be useful for specifying file patterns (like *.la) that one may not want at all, anywhere (in any package). But I don't think it's useful as describing what should be in the final split package. In situations where you have more than 2 split packages, you'll need to specify certain patterns more than once. Not to mention that there is duplication of effort - 'make install' is run more than once and files are installed and removed from disk more than is necessary.

PURGE_TARGETS has absolutely nothing to do with package splitting. It is
all about removing files that multiple packages want to include to avoid
conflicts, or performing common removals (such as *.la - although we
have a specific option just for that).

> I would much prefer that the package is built with the idea that 'make install' (or equivalent) is done once and that the packaging tool has an overall view of what files are, or are not included in individual packages - such that it can easily keep track of duplicate files added to packages (error: pkg1 has /bin/file1 and so does pkg1-sub1!) or what files were not packaged at all.

Well then...  use rpm.

Or more constructively, that is not the design of package splitting in
pacman.  It was primarily designed for packages that have multiple
install targets in their makefiles and so you run "make install-foo"
"make install-bar" etc.

But saying that, I have had this in my ideas file for quite some time:
 - Implementing more generic splitting approach for things like the
headers splitting:
You do a "make install" in the package() function and each package_foo()
subpackage function has an array that holds a list of files (including
wildcards) to move from the temporary directory into the sub-package.
Warnings are printed for any file that is left over.

So if you really need that and implement it, I would be amenable to
including it.


More information about the pacman-dev mailing list