-
Notifications
You must be signed in to change notification settings - Fork 113
pacaur line 179: syntax error: invalid arithmetic operator #260
Comments
Thanks. I don't know why the "invalid arithmetic operator" error happens, but it seems something goes wrong prior to this. The output seems to have lot of "package is not present in AUR -- skipping" that shouldn't be displayed at all. Please check the output of "cower -u". Also, have a look at the "/tmp/pacaurtmp-afri/rpc.json" file. Its content should be similar to this. |
This is my /tmp/pacaur-afri/rpc.json:
This is cower -u:
|
These cower and json outputs seem correct. To be honest, I am totally clueless about what's going on. You're the only one that seem affected by this strange behavior, so I guess there is something specific to your setting/machine that prevents pacaur to work as expected. There might also be more than one issues, but let's have a look at the first one to begin. Could you add the following lines in /usr/bin/pacaur, between lines 101 and 102 (just before the for loop)?
Then run "pacaur -Syua", and paste the 3 DEBUG lines that should now appear. Also, do you still have the "packagename is not present in AUR - skipping" warning messages? |
Yes, no change.
|
Thanks. About the 3 DEBUG lines:
In this case, something is completely wrong with the third list. It is the very same as the first one, although the second list isn't empty. It should contain the following instead:
Where did you install these packages from? Also, what is the locale that you are using on your system? This can have an impact on the sort algorithm (although pacaur ensures to use the C locale when using lists comparison to avoid problem here). |
Locale:
I replaced the mate packages with the ones from the official repositories, I used to install them from external repos. But that's not the reason. |
I tried to reproduce this with a minimal bash script but it's not reproducable with this code:
|
Ok, I think I found the issue, someone at stackoverflow suggested there might be additional characters in the variable holding the number. What I did now is basicly:
The output is:
Not fully understanding the output, but could it be possible there is this new line character appended to the number in the variable? Any idea how to fix that? |
I also tried running that number through bc:
This is the output:
Any idea? |
Hi, Sorry for the late answer. I currently don't have access to my main Arch box, but I haven't forgotten you.
My best guest at the moment would be that there is a "ghost" color code which is not interpreted correctly for some reason and that it messes with the json parser code. It's possible that it belongs to the buggy "not present in AUR" warning above. That would actually makes lot of sense. Maybe try to enable (or disable) the Color variable in pacman.conf and see if this has an effect. Edit: In addition, the "\033[K " code corresponds to "Erase to end of line". EDIT2: I talked too fast. I don't think it is the yellow color (which is \e[1;33m, but we have \e[m here). But please check your PS1 if you added some fancy colors in it. |
So, back to business. I tested the first issue (buggy 'skipping' list), and of course I obtain the correct result. My bet is that there is also a ghost invisible character inserted there on your machine. Could you test both the ${foreignpkgs[@]} and ${allaurpkgs[@]} variables with bc and od? If your PS1 is correct and doesn't insert unwanted character to the input, then you'll have to track that ghost character. Check the "getjsonvar()" function, and possibly the content of rpc.json file too. As I'm unable to reproduce this issue, I'm afraid you'll have to do this work yourself. As long as I'm unsure where this ghost character is inserted first, I'm unable to fix this issue. |
Thanks for your time and inputs. I just noticed this is not related with pacaur. I also get this for example compiling some other software. Something is really messed up with my system, inserting special characters everywhere. I'm still totally clueless, but finally I'm sure this is not a pacaur bug. Thanks anyways :) |
You're welcome. I'd still first check your colored PS1 if you have one :) Good luck in tracking this issue. |
It has something to do with grep adding color escape stuff at the end of line, http://unix.stackexchange.com/q/45190/19062 It's really no easy task to track this down and fix this.
|
Hmm, interesting. Here what I have in my
The issue you've encountered might also depends on the terminal you're using. |
Hi,as already reported in AUR comments, I can not update aur packages with the recent versions.
(Currently v4.2.9)
As requested here is the full output of bash -x, the issue is quite down at the end, look out for
invalid arithmetic operator
:The text was updated successfully, but these errors were encountered: