Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 567660

Summary: net-proxy/polipo: using dash as default: /lib64/rc/sh/openrc-run.sh: 40: /lib64/rc/sh/openrc-run.sh: [[: not found
Product: Gentoo Linux Reporter: tharvik
Component: Current packagesAssignee: Andrew Savchenko <bircoph>
Status: RESOLVED FIXED    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 526268    

Description tharvik 2015-12-06 18:08:20 UTC
If you switch to use a sh compliant shell (like dash) instead of bash, the init script of polipo fail to correctly run with an error `/lib64/rc/sh/openrc-run.sh: 40: /lib64/rc/sh/openrc-run.sh: [[: not found`.

It happens because using '[[' or ']]' for test is a bash extension, there should not be any issue to replace it with a single '[' and ']'.

Failing currently with 1.1.1 and 1.1.1-r1.

Steps
* emerge dash eselect-sh
* eselect sh set dash
* rc-service polipo start
Comment 1 Andrew Savchenko gentoo-dev 2015-12-06 19:17:22 UTC
Single brackets are much slower then double ones, since single bracket is an external application call and double one is the bash built-in.
Comment 2 tharvik 2015-12-06 20:07:28 UTC
(In reply to Andrew Savchenko from comment #1)
> Single brackets are much slower then double ones, since single bracket is an
> external application call and double one is the bash built-in.

Speed is not really an issue here, is it?
Also, on dash, `type [` shows that it is a shell builtin, maybe it is not the case in every POSIX shell.
Comment 3 Andrew Savchenko gentoo-dev 2015-12-07 12:41:07 UTC
One day OpenRC should support selectible interpreter, so anyone will be happy.
Comment 4 Andrew Savchenko gentoo-dev 2015-12-07 22:59:45 UTC
Oh, forgot to mention that one have to update to polipo-1.1.1-r2 for the fix.