gugod / gugod/App-perlbrew

(PATCH) Install script says it needs /bin/sh but actually requires bash

Open
#511 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Perl
Stars
735
Forks
231
PR merge metrics
No merged PRs in 30d

Description

The install script at http://install.perlbrew.pl starts with
#!/bin/sh
but actually requires bash. It could start with
#!/usr/bin/env bash
However, there is no good reason to require bash, so the following patch makes the install script work using /bin/sh. BTW, the script contains no version info; this patch is against what was downloaded on 5/16/2016:

--- index.html 2016-05-17 01:13:06.860722448 +0000
+++ index.html.NEW 2016-05-17 01:44:53.409322430 +0000
@@ -1,10 +1,12 @@
#!/bin/sh

-if [ "x${PERLBREWURL}" == "x" ]; then
+set -e -u # die if something fails or an undef variable referenced
+
+if [ "x${PERLBREWURL:-}" = "x" ]; then
PERLBREWURL=https://raw.githubusercontent.com/gugod/App-perlbrew/master/perlbrew
fi

-if [ -z "$TMPDIR" ]; then
+if [ -z "${TMPDIR:-}" ]; then
if [ -d "/tmp" ]; then
TMPDIR="/tmp"
else

Contributor guide

Open the contributing guide

Research direction

Start with the install script at http://install.perlbrew.pl and compare it with the supplied patch, focusing on /bin/sh compatibility and unset variables. Verify that the script runs under /bin/sh without requiring bash and that its existing installation behavior is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl, shell
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.