After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 584581 - common/mkiconlinks.sh: uses bashism in a shell script
common/mkiconlinks.sh: uses bashism in a shell script
Status: RESOLVED DUPLICATE of bug 550927
Product: gnome-themes
Classification: Deprecated
Component: General
HEAD
Other FreeBSD
: Normal normal
: ---
Assigned To: GNOME Themes Maintainers
GNOME Themes Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-06-02 03:57 UTC by David Adam
Modified: 2009-07-16 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
avoid use of bashism (521 bytes, patch)
2009-06-18 06:51 UTC, David Adam
none Details | Review

Description David Adam 2009-06-02 03:57:48 UTC
mkiconlinks is declared as a shell script (#!/bin/sh), but uses substring expansion in the following line:
  if [ ! "${NEXTLINE:0:1}" == '#' ]; then

Substring expansion is a feature not found in POSIX implementations of sh(1), and thus fails on systems where /bin/sh is not /bin/bash (or cousins).

https://wiki.ubuntu.com/DashAsBinSh#${...} explains the problem, although their solution uses awk where cut would suffice. Something like
  if [ ! $(echo "$NEXTLINE" | cut -b 1} == '#' ]; then
should work.
Comment 1 David Adam 2009-06-18 06:51:28 UTC
Created attachment 136898 [details] [review]
avoid use of bashism

Tested and working, my comment above had a typo.
Comment 2 Mikel Olasagasti 2009-07-15 21:31:47 UTC
Gentoo is using similar patch since 2.24.3

-	if [ ! "${NEXTLINE:0:1}" == '#' ]; then
+	if ! echo ${NEXTLINE} | grep -q "^#" ; then

http://bugs.gentoo.org/show_bug.cgi?id=256337
Comment 3 David Adam 2009-07-16 14:22:24 UTC

*** This bug has been marked as a duplicate of 550927 ***