Allow specifying extract directory for archives
default_unpack
expects that the files in archives live in a subdirectory, which is the case for most archives that we use. But once in a while, there are archives where the there is not single directory that contains everything. When such an archive is extracted, the files are directly extracted to $srcdir
.
The issue is that default_unpack
is not extensible. You have to completely reimplement it if you want to change its behavior and you cannot use default_unpack
for some sources and custom logic for others. See for example this commit, where default_unpack
has been copied almost verbatim, with just a few changes to extract the files in a dedicated subdirectory.
The direct solution to this problem would be a possibility to specify a subdirectory to extract the archive in.
A more general solution would involve breaking up default_unpack
into more reusable components that can be reused or hookpoints.