FS#66541 - add option to "pick" files from one split package to another

Attached to Project: Pacman
Opened by nathan (ndowens) - Tuesday, 05 May 2020, 01:42 GMT
Last edited by Allan McRae (Allan) - Wednesday, 22 February 2023, 06:47 GMT
Task Type Feature Request
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Low
Priority Normal
Reported Version 5.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

Wasn't sure which category to add this, if this belongs elsewhere please move.

I am wondering if the following function could become part of PKGBUILD/makepkg natively. I found it in another PKGBUILD and it is nice to use to allow split pkgs to move dirs/files easily into other package-*(){}
example say we want to move usr/share/docs into package_pkg-doc()
package() {
....
cd "$pkgdir"
pick docs usr/share/docs
}

package_pkg-doc() {
...
mv docs/* "$pkgdir"
}
pick() {
local p="$1" f d; shift
for f; do
d="$srcdir/$p/${f#$pkgdir/}"
mkdir -p "$(dirname "$d")"
mv "$f" "$d"
rmdir -p --ignore-fail-on-non-empty "$(dirname "$f")"
done
}
This task depends upon

Closed by  Allan McRae (Allan)
Wednesday, 22 February 2023, 06:47 GMT
Reason for closing:  None
Additional comments about closing:  Tracked at https://gitlab.archlinux.org/pacman/pacm an/-/issues/16
Comment by Allan McRae (Allan) - Tuesday, 05 May 2020, 02:00 GMT
I'm sure there is another bug about this... but this is the approach that would be accpeted.

build() {
...
}

package() {
make DESTDIR=$pkgdir install
}

package_foo() {
filelist=(usr/share/docs/*)
}

package_bar() {
filelist=(usr/bin/*)
}

Followed by a warning for any files left over in the temporary area from the original package() function.
Comment by nathan (ndowens) - Tuesday, 05 May 2020, 03:05 GMT
@Allan Ah sorry if this is possibly a duplicate. The one that would be accepted looks nice. I look forward to this being implemented :D
Comment by Eli Schwartz (eschwartz) - Tuesday, 05 May 2020, 03:08 GMT
  • Field changed: Summary ([pacman] PKGBUILD → add option to "pick" files from one split package to another)
Useful description is useful.

Loading...