Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#15323 - makepkg doesn't work with source files with '%' or space in their names

Attached to Project: Pacman
Opened by Davorin Učakar (phantom) - Tuesday, 30 June 2009, 18:42 GMT
Last edited by Allan McRae (Allan) - Thursday, 16 July 2009, 02:56 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

If a souce file name has space in it's name, bsdtar treats it as two separate parameters.
If it has '%' in file name, a printf used to print makepkg progress expects additional parameters and build fails, too.

Example: try to build a package with source like:
http://opendesktop.org/CONTENT/content-files/50534-fedora%20core%206%20inverse.tar.gz or
http://opendesktop.org/CONTENT/content-files/50534-fedora core 6 inverse.tar.gz
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 16 July 2009, 02:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  in git - commits 104daa16, caa0f220, 68c10690
Comment by Allan McRae (Allan) - Wednesday, 01 July 2009, 03:18 GMT
Does it work if you escape those characters? i.e. \%
Comment by Dan McGee (toofishes) - Wednesday, 01 July 2009, 07:27 GMT
We need to be more careful when creating our cmd in the extract_sources() function- we don't quote the $file variable there, so spaces will definitely break things. Attached is a patch to fix the spaces issue.
Comment by Dan McGee (toofishes) - Wednesday, 01 July 2009, 07:34 GMT
And the second part, not too hard at all. Fix cases with escape sequences in filenames.
Comment by Davorin Učakar (phantom) - Wednesday, 01 July 2009, 10:20 GMT
@Allan: nope, I doesn't work with any possible combination of {doublequote,singlequote,no quote}x{%20,space}x{no escape,escape before %20 or spaces}
(where 'x' is cartesian product :)). Every time it fails either downloading, bsdtar or printf.
I haven't tried Dan's patches yet.
Comment by Allan McRae (Allan) - Wednesday, 01 July 2009, 13:09 GMT
Signoff on both patches.
Comment by Allan McRae (Allan) - Saturday, 11 July 2009, 11:25 GMT
Looking into this further, those patches fix the case with "%20" but not with raw spaces. That still fails on download. But manually wget the file with spaces in its name and it extracts fine.
Comment by Allan McRae (Allan) - Saturday, 11 July 2009, 13:19 GMT
I can partially fix the spaces in file names issue by adding escaped quotes around the file name and url when generating the dlcmd command in download sources. Only problem is I end up with this:

dlcmd="/usr/bin/wget -c -t 3 --waitretry=3 -O \"50534-fedora core 6 inverse.tar.gz.part\" \"http://opendesktop.org/CONTENT/content-files/50534-fedora core 6 inverse.tar.gz\""

$dlcmd || return $?

Doing an "echo $dlcmd" and copying and pasting the output works, but the line running $dlcmd fails. wget trys downloading multiple files, splitting at the spaces.
Comment by Allan McRae (Allan) - Saturday, 11 July 2009, 15:11 GMT
bah... eval...

The attached patch complete the fixes needed for this bug. All patches are on my working branch.

Loading...