On a side note, I can't believe that worked. It shouldn't, AFAIK, but localization can do some strange things sometimes. Could be a bug in makepkg or a bug in du.
]]>Locale issue with the output of du, maybe? Try:
export LC_ALL=C size="$(du -sk --apparent-size)" echo "${size%%[^0-9]*}"
[kelevra@Archbox ~]$ export LC_ALL=C
[kelevra@Archbox ~]$ size="$(du -sk --apparent-size)"
[kelevra@Archbox ~]$ echo "${size%%[^0-9]*}"
1991060
export LC_ALL=C
size="$(du -sk --apparent-size)"
echo "${size%%[^0-9]*}"
[kelevra@Archbox ~]$ pacman -Q bash
bash 4.2.045-5
[kelevra@Archbox ~]$ ls -l /usr/bin/bash
-rwxr-xr-x 1 root root 737952 25.8. 15:06 /usr/bin/bash
[kelevra@Archbox ~]$ md5sum /usr/bin/bash
5bb49ecb47509ec3aab01a2d13556088 /usr/bin/bash
Here is the logfile http://pastebin.com/XiQPwL7C
[kelevra@Archbox ~]$ var="one and two"
[kelevra@Archbox ~]$ echo "${var%%two}"
one and
[kelevra@Archbox ~]$ echo -e "first\n120\nthird" | grep "[^0-9]"
first
third
GNU bash, version 4.2.45(2)-release (x86_64-unknown-linux-gnu)
Copyright (C) 2011 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
bash --version
would also be informative.
]]>What about the following:
pacman -Q bash
ls -l /usr/bin/bash
md5sum /usr/bin/bash
Also if you could post the output of "set" in a pastebin-like site that would help:
set > logfille
then upload logfile and link to it here.
And perhaps to narrow down the issue a bit further (to see if it's the bash string function or the regex that is failing):
var="one and two"
echo "${var%%two}"
echo -e "first\n120\nthird" | grep "[^0-9]"
Everything looks right there - so this error is very odd. This is a long shot test, but it seems like the only remaining piece:
size="$(du -sk --apparent-size)" echo "${size%%[^0-9]*}"
If you enter those two lines in a terminal, the result should be to print out just a number. If you get anything else, it may indicate a problem with bash's uses of substring replacement or regexes. Neither of these are even remotely likely, but I can't see what else could lead to this error.
[kelevra@Archbox ~]$ size="$(du -sk --apparent-size)"
[kelevra@Archbox ~]$ echo "${size%%[^0-9]*}"
1989674 .
size="$(du -sk --apparent-size)"
echo "${size%%[^0-9]*}"
If you enter those two lines in a terminal, the result should be to print out just a number. If you get anything else, it may indicate a problem with bash's uses of substring replacement or regexes. Neither of these are even remotely likely, but I can't see what else could lead to this error.
]]>I have just tested makepkg with package-query and encountered no errors.
Please post the output of the following:
sed -n 1816p /usr/bin/makepkg md5sum /usr/bin/makepkg pacman -Q pacman uname -a
While waiting for further replies, try switching mirrors and running "pacman -Syyu".
Here are the replies.
[kelevra@Archbox ~]$ sed -n 1816p /usr/bin/makepkg
size="$(( ${size%%[^0-9]*} * 1024 ))"
[kelevra@Archbox ~]$ md5sum /usr/bin/makepkg
ca9273ce2b30ef53b2704e7c27d39b60 /usr/bin/makepkg
[kelevra@Archbox ~]$ pacman -Q pacman
pacman 4.1.2-4
[kelevra@Archbox ~]$ uname -a
Linux Archbox 3.12.1-1-ARCH #1 SMP PREEMPT Thu Nov 21 08:18:42 CET 2013 x86_64 GNU/Linux
Which du returns, /usr/bin/du
[kelevra@Archbox Templates]$ du -sk --apparent-size
4 .
[kelevra@Archbox Templates]$ head -1816 /usr/bin/makepkg | tail -2
local size="$(/usr/bin/du -sk --apparent-size)"
size="$(( ${size%%[^0-9]*} * 1024 ))"
karol, read my edit.
Ooops, I wrote my reply and then just inserted the quote w/o looking.
]]>Kelevra891 wrote:==> Creating package "package-query"...
/usr/bin/makepkg: line 1816: 79 . * 1024 : syntax error: invalid arithmetic operator (error token is ". * 1024 ")There is somehow an extra '.' on that line in your makepkg which is not in the makepkg from the repos.
Edit: I didn't see the space after the '.' and so my suspicion is now with the output of du, as per Trilby's post.
$ du -sk --apparent-size
4538305 .
Maybe the dot came from 'du'.
]]>Please post the output of the following:
sed -n 1816p /usr/bin/makepkg
md5sum /usr/bin/makepkg
pacman -Q pacman
uname -a
While waiting for further replies, try switching mirrors and running "pacman -Syyu".
]]>==> Creating package "package-query"...
/usr/bin/makepkg: line 1816: 79 . * 1024 : syntax error: invalid arithmetic operator (error token is ". * 1024 ")
There is somehow an extra '.' on that line in your makepkg which is not in the makepkg from the repos.
Edit: I didn't see the space after the '.' and so my suspicion is now with the output of du, as per Trilby's post.
]]>