FS#15210 - [makepkg] pkgdesc does not get restored properly

Attached to Project: Pacman
Opened by Allan McRae (Allan) - Monday, 22 June 2009, 03:53 GMT
Last edited by Allan McRae (Allan) - Monday, 27 July 2009, 05:02 GMT
Task Type Bug Report
Category makepkg
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.2.2
Due in Version 3.3.0
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Summary and Info:
Reported by Pierre. Using the following PKGBUILD:

pkgbase=test
pkgname=(test1 test2)
pkgdesc="text with spaces"
pkgver=1
pkgrel=1
arch=any

build () {
return 0
}

package_test1() {
echo $pkgdesc
pkgdesc="${pkgdesc} 1"
}

package_test2() {
echo $pkgdesc
}


This gives test2 pkgdesc="text" and not "text with spaces" as expected.
This task depends upon

Closed by  Allan McRae (Allan)
Monday, 27 July 2009, 05:02 GMT
Reason for closing:  Fixed
Additional comments about closing:  597118dd
Comment by Allan McRae (Allan) - Monday, 22 June 2009, 03:54 GMT
Note: simple workaround is to give each split package its own pkgdesc line.
Comment by Allan McRae (Allan) - Friday, 03 July 2009, 16:47 GMT Comment by Pierre Schmitz (Pierre) - Wednesday, 22 July 2009, 22:11 GMT
I am sorry, but this does not seem to work. At first both of the above packages from the example above have "text with spaces" as pkgdesc. But the first package should have "text with spaces 1".

Another problem is that packages where pkgdesc is only defined in the package_*() functions wont have any description at all. Try the following example:

pkgbase=test
pkgname=(test3 test4)
pkgver=1
pkgrel=1
arch=any

build () {
return 0
}

package_test3() {
pkgdesc="blah 3"
}

package_test4() {
pkgdesc="blah 4"
}
Comment by Pierre Schmitz (Pierre) - Wednesday, 22 July 2009, 22:21 GMT
Well, its even worth. It looks like the recent version of makepkg ignores any variable defined in package functions; so all deps etc. are always empty. So this pach might work but we have a regression elsewhere.
Comment by Pierre Schmitz (Pierre) - Wednesday, 22 July 2009, 22:53 GMT
For the record: version 20090708 dos not have the last problem. I tried to check with git log --date-order --follow makepkg.sh.in
, but the commits are not in chronological order.
Comment by Allan McRae (Allan) - Wednesday, 22 July 2009, 23:41 GMT
That puts the problem after the moving of .PKGINFO generation to a function... so I can see nothing that could cause this issue.

Go, go, git-bisect!
Comment by Allan McRae (Allan) - Thursday, 23 July 2009, 00:18 GMT
No bisect necessary... The big clue is nothing defined in install_pkg() gets "saved". That use to happen with logging, which lead me to:

http://projects.archlinux.org/?p=pacman.git;a=commit;h=621aa26e

This completely breaks split packages and has some issues with logging. That patch obviously needs more thought so I will revert it for now.
Comment by Allan McRae (Allan) - Thursday, 23 July 2009, 04:24 GMT
Here is a minimal testcase of the two conflicting issues we are trying to solve... we want the function to stop as soon as there is a failure without a "return 1" and keep the updated variable assignment.

   test.sh (0.6 KiB)
Comment by Dan McGee (toofishes) - Sunday, 26 July 2009, 18:01 GMT
For now, I have reverted the commit of the offending patch in commit 597118ddd756426530c3ed798e71ab9427438fb6, so the issue should not manifest itself in the 3.3 release.
Comment by Allan McRae (Allan) - Monday, 27 July 2009, 05:02 GMT
I'm closing this as fixed in git and will open and new bug for the issue that we were trying to fix with the patch that was reverted.

Loading...