FS#22174 - Cannot use pkgname variable in split package function

Attached to Project: Pacman
Opened by Dan McGee (toofishes) - Tuesday, 21 December 2010, 16:11 GMT
Last edited by Allan McRae (Allan) - Thursday, 30 December 2010, 01:39 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version git
Due in Version 3.5.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
Found using makepkg-git, but probably broken in 3.4.x as well.

Steps to Reproduce:
* Build attached PKGBUILD
* `bsdtar tf` two made packages, note same file in both: usr/share/licenses/testpkg1/LICENSE
* Expected: testpkg1 license in one package, testpkg2 license in the other. Found as the root cause of  FS#22173 ; see http://projects.archlinux.org/svntogit/packages.git/tree/postgresql/trunk/PKGBUILD?id=c514cfde29afe4ebba130caf156496efc8ea5b35#n84 for actual broken PKGBUILD.
   PKGBUILD (0.4 KiB)
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 30 December 2010, 01:39 GMT
Reason for closing:  Fixed
Additional comments about closing:  http://projects.archlinux.org/users/alla n/pacman.git/commit/?id=eb939554
Comment by Allan McRae (Allan) - Tuesday, 21 December 2010, 16:20 GMT
I looked into this once and was sure I opened a bug report when I did not get around to fixing it... guess I never did.

We loop over the package_*() functions using the pkgname array. So to fix this, we need to take a "backup" copy of this array, loop over that overwriting pkgname with the current value as we and then restore pkgname at the end. This is probably a three line fix now we have a "run_split_packaging" function...
Comment by Dan McGee (toofishes) - Tuesday, 21 December 2010, 16:28 GMT
Yeah I forgot to mention that referring to the variable as a non-array is just returning the first one in the list, so this makes some sense. It would be great to fix this if it is as easy as you think it might be now; otherwise we should at least document this restriction somewhere.
Comment by Allan McRae (Allan) - Saturday, 25 December 2010, 03:13 GMT

Loading...