MantisBT - Buildsystem
View Issue Details
0002653Buildsystem[All Projects] Generalpublic2019-05-18 18:272019-08-01 11:07
ReporterMichael Siegel 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformLinuxOSDevuanOS Version2.0.0/ASCII
Fixed in CI build #
Reported in CI build #
Summary0002653: env.sh: Function names including hyphens cause syntax error in dash
DescriptionAs the shebang (#!/bin/sh) implies, the env.sh script is supposed to work in POSIX shells – or at least in dash, as I've been told on IRC.

However, POSIX doesn't allow for function names to contain hyphens, and neither does dash, at least not up until version 0.5.8, which is the one in Debian's current stable release.

So, these functions should better be named using underscores instead of hyphens.
Steps To Reproduce$ dash
$ ns-apt-get-install() { echo "would do stuff"; }
dash: 1: Syntax error: Bad function name
$ ns_apt_get_install() { echo "would do stuff"; }
$ ns_apt_get_install
would do stuff
$
TagsNo tags attached.
Attached Files

Notes
(0002041)
Daniel Silverstone   
2019-08-01 11:07   
This is a fragment intended to be sourced into an interactive `bash` or `zsh` not `dash`. As such I've removed the shebang and added a comment to that effect.

Issue History
2019-05-18 18:27Michael SiegelNew Issue
2019-08-01 11:07Daniel SilverstoneStatusnew => closed
2019-08-01 11:07Daniel SilverstoneResolutionopen => no change required
2019-08-01 11:07Daniel SilverstoneNote Added: 0002041