Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-extras update produces warnings on OS X #455

Closed
apjanke opened this issue Oct 2, 2015 · 5 comments · Fixed by #1045
Closed

git-extras update produces warnings on OS X #455

apjanke opened this issue Oct 2, 2015 · 5 comments · Fixed by #1045

Comments

@apjanke
Copy link
Contributor

apjanke commented Oct 2, 2015

git-extras update issues some error messages on OS X, but the upgrade still proceeds.

$ git-extras update
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
expr: syntax error
/tmp/git-extras/bin/git-extras: line 51: [: =: unary operator expected
expr: syntax error
/tmp/git-extras/bin/git-extras: line 52: [: =: unary operator expected
expr: syntax error
/tmp/git-extras/bin/git-extras: line 53: [: =: unary operator expected
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
chdir: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
Setting up 'git-extras'....
... installing bins to /tmp/git-extras/bin
... installing man pages to /tmp/git-extras/share/man/man1

Looks like it's using expr forms that aren't supported by BSD's expr.


  update)
    platform=$(uname -s)
    if [ $(expr substr "$platform" 1 9) = "CYGWIN_NT" ] || \
      [ $(expr substr "$platform" 1 10) = "MINGW32_NT" ] || \
      [ $(expr substr "$platform" 1 10) = "MINGW64_NT" ]

From man expr:

According to the POSIX standard, the use of string arguments length,
substr, index, or match produces undefined results. In this version of
expr, these arguments are treated just as their respective string values.

@a613
Copy link

a613 commented Oct 5, 2015

Seems to work but spits out some errors at the very bottom of the output. Here is the tail end of the output on my Mac (10.10.5):

... installing git-touch
... installing git-undo
... installing git-unlock
cp -f man/git-*.1 /usr/local/share/man/man1
cp -f etc/bash_completion.sh /etc/bash_completion.d/git-extras
... updated git-extras 3.0.0 -> 3.0.0
... updated git-extras 3.0.0 -> 3.0.0
/usr/local/bin/git-extras: line 41: syntax error near unexpected token `}'
/usr/local/bin/git-extras: line 41: `}'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@apjanke @a613 and others