FS#18394 - makepkg --source fails if install file is in source array
Attached to Project:
Pacman
Opened by Rorschach (Rorschach) - Thursday, 18 February 2010, 23:29 GMT
Last edited by Allan McRae (Allan) - Tuesday, 11 May 2010, 22:58 GMT
Opened by Rorschach (Rorschach) - Thursday, 18 February 2010, 23:29 GMT
Last edited by Allan McRae (Allan) - Tuesday, 11 May 2010, 22:58 GMT
|
Details
Summary and Info:
------------------------ There's a bug in the function create_srcpackage() in the makepkg script. It first adds the install file to the sourcepackage-dir and after that all files in the source array (expect the url-ones..). line 1056ff.: if [ -n "$install" ]; then if [ -f $install ]; then msg2 "$(gettext "Adding install script...")" ln -s "${startdir}/$install" "${srclinks}/${pkgbase}/" else error "$(gettext "Install script %s not found.")" "$install" fi fi [...] local netfile for netfile in "${source[@]}"; do local file=$(get_filename "$netfile") if [ -f "$netfile" ]; then msg2 "$(gettext "Adding %s...")" "$netfile" ln -s "${startdir}/$netfile" "${srclinks}/${pkgbase}" elif [ "$SOURCEONLY" -eq 2 -a -f "$SRCDEST/$file" ]; then msg2 "$(gettext "Adding %s...")" "$file" ln -s "$SRCDEST/$file" "${srclinks}/${pkgbase}/" fi done The problem now is that if we add the .install file to the source-array because we want to have it md5sum checked like every other file, the function tries to link to it a second time with all the other sourcefiles and fails because the symlink has already created before. This results in makepkg aborting. Steps to Reproduce: ------------------------ Create a PKGBUILD which has an install file and specify it in the source array too: [..] install=test.install source=(test.install) [..] and try to create a source-package with makepkg --source. Fix: ------------------------ If we have already successfully created the symlink for the install file it's safe to remove it from the source-array before the source-array is used to symlink all the other files. Patch is attached. |
This task depends upon
Closed by Allan McRae (Allan)
Tuesday, 11 May 2010, 22:58 GMT
Reason for closing: Fixed
Additional comments about closing: In git: http://projects.archlinux.org/pacman.git /commit/?id=64c3255b
Tuesday, 11 May 2010, 22:58 GMT
Reason for closing: Fixed
Additional comments about closing: In git: http://projects.archlinux.org/pacman.git /commit/?id=64c3255b
from man PKGBUILD:
It does not need to be included in the source array (e.g. install=pkgname.install).
So either the documentation needs changed or we need to allow adding the install file to the source array. A fix for this should also consider how we are going to fix creating source packages with install files overrides in split packages.
Some things to think about: We do not checksum PKGBUILDs and install files are really just extensions of the PKGBUILD. If we allow install files to be in the source array, should we also allow changelogs (which are handled like install files in the future)?
could you provide me with an example of what you described here: "A fix for this should also consider how we are going to fix creating source packages with install files overrides in split packages." because I don't understand what you mean and would like to look at this.
And would there be any reason not to include changelogs in the source-array?