FAQ Search Today's Posts Mark Forums Read

» Linux Archive
Home
New Posts
Search
FAQ


Go Back   Linux Archive > 64 Studio > 64 Studio Developer

 
 
LinkBack Thread Tools
 
Old 04-25-2008, 11:05 AM
"64 Studio"
 
Default #417: bashism in "#!/bin/sh" scripts (rtirq, 64studio-skel, 64studio-themes, others?)

#417: bashism in "#!/bin/sh" scripts (rtirq, 64studio-skel, 64studio-themes,
others?)
------------------------------+---------------------------------------------
Reporter: emarsk@gmail.com | Owner: free
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version:
Severity: normal | Keywords:
------------------------------+---------------------------------------------
/etc/init.d/rtirq (from package rtirq) is a "#!/bin/sh" script, but uses a
bash-only "function" syntax, not supported by dash ('fuction foo ()'
instead of 'foo ()').

FIX:
{{{
sed -i "s/^function //" /etc/init.d/rtirq
}}}

Similarly, upgrading gave me these two errors, caused by bashism ('[
"$blah" == "" ]' instead of '[ "$blah" = "" ]' in postinst scripts):
{{{
Setting up 64studio-skel (2.1~pre14) ...
[: 38: ==: unexpected operator

Setting up 64studio-themes (2.1~pre14) ...
[: 48: ==: unexpected operator
}}}

FIX:[[BR]]
in each deb package:
{{{
sed -i "s/==/=/" debian/postinst
}}}

RATIONALE:[[BR]]
Scripts that use "#!bin/sh" must be POSIX compliant and they should be
tested with dash, which is lighter and faster than bash (and thus a better
choice as a script interpreter), and POSIX compliant as opposed to
bash.[[BR]]
If a script 'really' needs some bash-only syntax it should use
"#!/bin/bash", otherwise it's better to stick with dash syntax (which of
course is bash-compatible as it's a subset).[[BR]]
It should be noted that debconf, when installing dash, asks whether to
link it to /bin/sh or not, of course expecting that no script breaks the
aforementioned rule.

Slán

-- Emanuele --

--
Ticket URL: <http://trac.64studio.com/64studio/ticket/417>
64 Studio <>
_______________________________________________
64studio-devel mailing list
64studio-devel@64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-devel
 
Old 04-29-2008, 10:32 AM
"64 Studio"
 
Default #417: bashism in "#!/bin/sh" scripts (rtirq, 64studio-skel, 64studio-themes, others?)

#417: bashism in "#!/bin/sh" scripts (rtirq, 64studio-skel, 64studio-themes,
others?)
------------------------------+---------------------------------------------
Reporter: emarsk@gmail.com | Owner: free
Type: defect | Status: new
Priority: normal | Milestone: 2.2
Component: build | Version: 2.0
Severity: normal | Resolution:
Keywords: |
------------------------------+---------------------------------------------
Changes (by daniel@64studio.com):

* version: => 2.0
* milestone: => 2.2

--
Ticket URL: <http://trac.64studio.com/64studio/ticket/417#comment:1>
64 Studio <>
_______________________________________________
64studio-devel mailing list
64studio-devel@64studio.com
http://lists.64studio.com/mailman/listinfo/64studio-devel
 

Thread Tools




All times are GMT. The time now is 11:54 PM.

VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org