Problem #1: If you start the wrapper script /usr/bin/azureus without any arguments it complains about not being able to find a missing file. This is because the last line in the wrapper has a "$1" at the end, which makes Azureus think that someone passed a parameter even if there wasn't one passed. Solution: Replacing the last line with the following lines fixes the problem, it doesn't complain about a missing file if you don't have any arguments, and if you put one argument it will open that torrent: if [ -n "$1" ]; then java -cp $(java-config -p systray4j,azureus-bin 2>/dev/null) -Djava.library.path="${AZDIR}" org.gudy.azureus2.ui.swt.Main "$1" else java -cp $(java-config -p systray4j,azureus-bin 2>/dev/null) -Djava.library.path="${AZDIR}" org.gudy.azureus2.ui.swt.Main fi Problem #2: Since it uses $1 it will only be able to open one torrent at a time, but I think azureus can handle open multiple files from the command-line, so the wrapper script should be able to handle it too. partial solution: Replacing "$1" with $@ passes on all the arguments of the wrapper script to azureus, but this won't work with filenames that have spaces in them since it will think that its a new file when it encounters a space. You can't just put "$@" because then it will think that all filenames is one big filename with lots of spaces in it. Maybe you could loop trought the arguments in some way and add correct parenthesis, but I'm not really sure how to tackle this. Problem #3: Azureus/the wrapper script can't handle relative paths for some reason, you have to specify the full path to the torrents. I don't have a solution for this.
Seems like the line wrapping cut out my lines, the -Djava lines are supposed to be on the lines above them
(In reply to comment #0) > You can't just put > "$@" because then it will think that all filenames is one big filename with > lots of spaces in it. Maybe you could loop trought the arguments in some way > and add correct parenthesis, but I'm not really sure how to tackle this. Actually bash handles "${@}" specially. From man bash: @ Expands to the positional parameters, starting from one. When the expansion occurs within double quotes, each parameter expands to a separate word. That is, "$@" is equivalent to "$1" "$2" ... When there are no positional parameters, "$@" and $@ expand to nothing (i.e., they are removed). > > Problem #3: > Azureus/the wrapper script can't handle relative paths for some reason, you > have to specify the full path to the torrents. I don't have a solution for > this. > Try dev-java/azureus-2.3.0.6 which has a wrapper script that fixes problems 1 and 2. Problem three seems like an upstream issue but could be fixed by 2.3.0.6. It will be a while before I get azureus-2.3.0.6 marked stable so I will probably have to roll out a new release of azureus-bin to get the wrapper script fixes to stable sooner but let's see.
Thank you for educating me about the bash thing, its good to know for when scripting in the future. :) I read that azureus-bin is being deprecated in the bug you marked that this depended upon, so I will use net-p2p/azureus in the future. But problem 3 still remains, and its not fixed in 2.3.0.6. I know this because I was actually using 2.3.0.6 (I replaced the .jar file with the new version , worked fine). Should I report this problem to upstream?
(In reply to comment #3) > Thank you for educating me about the bash thing, its good to know for when > scripting in the future. :) > > I read that azureus-bin is being deprecated in the bug you marked that this > depended upon, so I will use net-p2p/azureus in the future. > > But problem 3 still remains, and its not fixed in 2.3.0.6. I know this because > I was actually using 2.3.0.6 (I replaced the .jar file with the new version , > worked fine). Should I report this problem to upstream? > Just tested with an upstream wrapper script and there relative paths work so this is an issue with our wrapper script.
> > Just tested with an upstream wrapper script and there relative paths work so > this is an issue with our wrapper script. > We have cd ${dotazudir} in the wrapper script. It seems that azureus creates a plugins dir to the current directory if I remove this so that is not a solution.
how about something that saves the pwd before you cd into ${dotazudir} and then uses sed to prepend it to the paths of the torrents if the first character isn't a /?
(In reply to comment #6) > how about something that saves the pwd before you cd into ${dotazudir} and then > uses sed to prepend it to the paths of the torrents if the first character > isn't a /? > How about just fixing the plugins directory creation in Azureus code?
I think the wrapper script in 2.4.0.0 should fix your problem: https://svn.gentooexperimental.org/svn/java/gentoo-java-experimental/net-p2p/azureus/
Reading the new azureus-gentoo-2.4.0.0.sh, it should fix all the issues. If you combine that with the ebuild patch I submitted to the azureus 2.4.0.0 bug, then I think we can close this whole chain of bugs.
Hi guys, I noticed that azureus-bin-2.4.0.2 still suffers the "$1" problem mentioned in comment #0. Could someone with write access to the portage tree fix it (to "$@", as suggested in comment #2)? The file is net-p2p/azareus-bin/files/azureus-bin-gentoo.sh . Thanks.
The wrapper script mentioned by Petteri R
The wrapper script mentioned by Petteri Räty is now in portage, with 2.4.0.2.
Here's what I consider to be the only proper solution, that solves the problem completely. simply edit the startup script and remove the "$1" from the end of the last line and yes I've tested it and can now confirm no error message popups.
(In reply to comment #12) > Here's what I consider to be the only proper solution, that solves the problem > completely. > > simply edit the startup script and remove the "$1" from the end of the last > line and yes I've tested it and can now confirm no error message popups. > Actually the correct fix (using "$@") has allready been discussed (see comment #2). It looks like the wrapper script for azureus-bin still hasn't been updated, though.
This has been fixed quite a while in 2.5* for example. I just remove azureus-bin from the tree so can mark this as fixed.