plugins.geany.org icon indicating copy to clipboard operation
plugins.geany.org copied to clipboard

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

Open dmaphy opened this issue 10 years ago • 3 comments

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

dmaphy avatar May 26 '15 13:05 dmaphy

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?

lpaulsen93 avatar May 12 '19 11:05 lpaulsen93

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.

eht16 avatar May 12 '19 12:05 eht16

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?

lpaulsen93 avatar May 12 '19 13:05 lpaulsen93