kou opened a new issue, #55495:
URL: https://github.com/apache/arrow/issues/55495
### Describe the enhancement requested
`dev/tasks/linux-packages/apt/build.sh` copies the source archive to
`${PACKAGE}_${VERSION}.orig.tar.gz`, extracts it, and then `pushd`s into
`${PACKAGE}-${VERSION}/`:
https://github.com/apache/arrow/blob/1287cd468464fb983952d068035a60b5500606cd/dev/tasks/linux-packages/apt/build.sh#L99-L110
This means `build.sh` has to know the top-level directory name used in each
source archive. That is why it has the `~dev` and `~rc` special cases.
`dpkg-source` doesn't need this. `Dpkg::Source::Archive::extract()` extracts
an archive into a temporary directory. If the archive contains exactly one
top-level directory, it renames that directory to the destination, whatever its
name is. Otherwise, it uses the temporary directory itself as the destination.
For example, `dpkg-source -b` and `dpkg-source -x` work with a
`hello_1.0~rc1.orig.tar.gz` whose top-level directory is `weird-top-dir/`.
We can follow the same behavior in `build.sh`:
1. Extract `${PACKAGE}_${VERSION}.orig.tar.gz` into a temporary directory.
2. If the temporary directory contains exactly one directory, rename it to
`${PACKAGE}-${VERSION}`. Otherwise, rename the temporary directory itself to
`${PACKAGE}-${VERSION}`.
3. Remove the `case "${VERSION}"` block.
With this change, `build.sh` no longer depends on how each package names the
top-level directory in its source archive.
### Component(s)
Packaging
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]