You are not logged in.

#1 2013-11-27 01:10:12

Kelevra891
Member
Registered: 2013-11-27
Posts: 5

Makepkg error.

When I try to install aur packages with makepkg i get error
==> Creating package "package-query"...
/usr/bin/makepkg: line 1816: 79    . * 1024 : syntax error: invalid arithmetic operator (error token is ". * 1024 ")

It doesn't create the pkg file so I cant install packages with pacman.

I have tried several different packages from aur. System is up to date.

Thank you.

Offline

#2 2013-11-27 01:39:25

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Makepkg error.

What does `which du` return?  If it gives a result, go to a small directory (any dir will do, but small will be faster) and run the following command and report the output:

du -sk --apparent-size

EDIT: I'm not sure how helpful these will actually be - if du was not there, you would get a different error.  The only thing that should lead to the results you see is if makepkg was modified.  Post the output of the following:

head -1816 /usr/bin/makepkg | tail -2

Last edited by Trilby (2013-11-27 01:43:52)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#3 2013-11-27 01:40:46

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Makepkg error.

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.


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#4 2013-11-27 01:43:05

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Makepkg 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".


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#5 2013-11-27 01:45:11

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Makepkg error.

fsckd wrote:
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'.

Offline

#6 2013-11-27 01:47:01

fsckd
Forum Fellow
Registered: 2009-06-15
Posts: 4,173

Re: Makepkg error.

karol, read my edit. tongue


aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies

Offline

#7 2013-11-27 02:26:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Makepkg error.

fsckd wrote:

karol, read my edit. tongue

Ooops, I wrote my reply and then just inserted the quote w/o looking.

Offline

#8 2013-11-27 12:42:33

Kelevra891
Member
Registered: 2013-11-27
Posts: 5

Re: Makepkg error.

Xyne wrote:

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 ))"

Last edited by Kelevra891 (2013-11-27 12:45:48)

Offline

#9 2013-11-27 13:39:24

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Makepkg error.

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.

Last edited by Trilby (2013-11-27 13:42:02)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#10 2013-11-28 10:25:28

Kelevra891
Member
Registered: 2013-11-27
Posts: 5

Re: Makepkg error.

Trilby wrote:

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	.

Offline

#11 2013-11-28 12:24:31

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Makepkg error.

Well there's the problem - now the questions is *how* or why that could happen.

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]"

Last edited by Trilby (2013-11-28 12:30:58)


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#12 2013-11-28 20:01:53

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Makepkg error.

The output of

bash --version

would also be informative.


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#13 2013-12-02 05:37:29

Kelevra891
Member
Registered: 2013-11-27
Posts: 5

Re: Makepkg error.

[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.

Offline

#14 2013-12-02 06:53:43

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Makepkg error.

Locale issue with the output of du, maybe? Try:

export LC_ALL=C
size="$(du -sk --apparent-size)"
echo "${size%%[^0-9]*}"

Offline

#15 2013-12-02 10:49:55

Kelevra891
Member
Registered: 2013-11-27
Posts: 5

Re: Makepkg error.

Scimmia wrote:

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

Offline

#16 2013-12-02 13:01:45

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: Makepkg error.

Huh, is this a makepkg bug?  It does export LC_ALL itself in most functions, but it doesn't look like it does before running the lines on 1815-1816.  It's an easy enough temporary hack to get it working, just put "LC_ALL=C" on line 1814.  But this will get overwritten with the next update.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#17 2013-12-02 13:37:05

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,463

Re: Makepkg error.

Yep, file a bug report in the Arch bugtracker then fix it locally as Trilby said. I would suggest putting a link to this thread in the bug report.

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.

Offline

Board footer

Powered by FluxBB