Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

./gencontent.sh: line 305: [: -eq: unary operator expected #6

Open
dmaphy opened this issue May 26, 2015 · 3 comments
Open

./gencontent.sh: line 305: [: -eq: unary operator expected #6

dmaphy opened this issue May 26, 2015 · 3 comments
Assignees

Comments

@dmaphy
Copy link
Member

dmaphy commented May 26, 2015

This happens when manually running gencontent.sh:

./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
./gencontent.sh: line 305: [: -eq: unary operator expected
@lpaulsen93
Copy link
Contributor

I don't get that error message on running ./gencontent.sh on my machine (Ubuntu 18.04.02). Line 305 of gencontent.sh just shows a fi. Maybe this issue is outdated and can be closed?

@eht16
Copy link
Member

eht16 commented May 12, 2019

The lines just moved: the old line 305 is now at 308 (see the original at https://github.com/geany/plugins.geany.org/blob/f11c354f1302ab440793cafa3bd23a96de441b9b/gencontent.sh).

The problem probably still exists under certain circumstances:

enrico@endor:~$ [  -eq 0 ]
bash: [: -eq: unary operator expected

That is, ${header_added[${plugin}]} seems to be empty in @dmaphy's case, for whatever reasons.
If I understand the code correctly, $header_added is filled from $RELEASE_PLUGIN_LIST but the access to $header_added happens from the list in $CONTENTDIR}${tag}.
I guess one needs to debug the contents of these lists and to determine whether the above can happen again or not.

@lpaulsen93
Copy link
Contributor

Ok, I could reproduce it at least for one case:

The list in $RELEASE_PLUGIN_LIST is empty in case $SOURCESDIR (set to ${HOME}"/.tmp/geany-plugins/" at the beginning of the script) exists but is an empty directory.

If it is not empty and includes a geany-plugins repository, then everything is fine. If it does not exist then it's created and the geany-plugins repository is cloned into it and then also everything works fine.

@dmaphy would need to tell if that was maybe what happened in his case.

If yes, the issue could be rated as an installation problem or unexpected environment and could therefore be closed as invalid. Or the check of $SOURCESDIR would need to be improved to check if it really includes a geany-plugins repository. But is it worth the hassle?

@dmaphy dmaphy self-assigned this Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants