[FIX] Optware.sh PATH Bug....

Discussions and howtos on the installation and the use of Optware/Ipkg on all QNAP Series products. For those wonders, Ipkg in the other words - Install hundreds of Linux software applications with one line of command.

[FIX] Optware.sh PATH Bug....

Postby efaden » Tue Dec 08, 2009 8:31 pm

Not sure if this has been discussed before, but I found an odd bug in Optware.sh....

Code: Select all
LINE 51: ... /bin/echo "export PATH=$PATH":/opt/bin:/opt/sbin >> /etc


I believe it should read
Code: Select all
LINE 51: ... /bin/echo "export PATH=\$PATH":/opt/bin:/opt/sbin >> /etc

(Notice... \$PATH)

The first yields export PATH=<OLD STUFF><NEW STUFF> etc
The second yields export PATH=$PATH:<NEW STUFF>

What is happening to me is that when Optware.sh gets run PATH is missing some stuff... so basically the result is that /etc/profile now has a line

export PATH = <MORE STUFF> at the top

and export PATH=<OLD STUFF><NEW STUFF> at the bottom, but <OLD STUFF> doesn't have everything <MORE STUFF> Does... not sure if that makes sense.
efaden
Cadet
 
Posts: 29
Joined: Sun Nov 22, 2009 6:42 am
NAS Model: TS-439 Pro

Re: [FIX] Optware.sh PATH Bug....

Postby Jim DeLaHunt » Tue Apr 20, 2010 12:35 am

I see this too, in my /etc/init.d/Optware.sh from firmware 3.2.5 build 0409T.

The path definition at the top is:
Code: Select all
export PATH=\
/bin:\
/sbin:\
/usr/bin:\
/usr/sbin:\
/usr/bin/X11:\
/usr/local/sbin

While the path definition at the bottom is:
Code: Select all
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/bin:/opt/sbin

The result is that /usr/bin/X11 and /usr/local/sbin don't get into the final PATH. On my device there is no /usr/bin/X11, but there is a /usr/local/sbin, containing zip, unrar, 7z, dhcpd, and others. I'm not sure what the significance of this is, but it does seem to be an odd pattern.

--Jim DeLaHunt, Vancouver, Canada. Multilingual Joomla & Drupal website consultant.
Jim DeLaHunt
Cadet
 
Posts: 14
Joined: Tue Apr 06, 2010 1:41 pm
NAS Model: TS-219P


Return to Optware / IPKG Modz

Who is online

Users browsing this forum: No registered users and 2 guests