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

Don't use Bash extended redirect syntax #47

Closed
wants to merge 1 commit into from

Conversation

kou
Copy link

@kou kou commented Jun 4, 2013

"&>PATH" is Bash extended redirect syntax.

See also: http://www.gnu.org/software/bash/manual/bashref.html#Redirecting-Standard-Output-and-Standard-Error

It is not worked well on normal sh such as dash. dash is the /bin/sh
on Debian GNU/Linux. If dash is used for "system", "gem install ..."
is run in background. "system" for background command always returns
true:

% ruby -e 'p system("nonexsitent &")'
true
sh: 1: nonexsitent: not found
% ruby -e 'p system("nonexsitent")'
nil

It means "install_gem" always returns true. It breaks the following
logic in lib/hoe/deps.rb:

install_gem("hoe-#{name}", version, false) or
  install_gem(name, version, false) or
  install_gem(dash_name, version, false) or
  warn "could not install gem for #{name} plugin"

It causes a problem for "kpeg" gem. "hoe-kpeg" gem doesn't
exist. "kpeg" gem should be searched as fallback but it is not
searched. Because install_gem("hoe-#{name}") is not failed.

RDoc depends on "kpeg". So "rake newb" for RDoc is failed.

"&>PATH" is Bash extended redirect syntax.

See also: http://www.gnu.org/software/bash/manual/bashref.html#Redirecting-Standard-Output-and-Standard-Error

It is not worked well on normal sh such as dash. dash is the /bin/sh
on Debian GNU/Linux. If dash is used for "system", "gem install ..."
is run in background. "system" for background command always returns
true:

    % ruby -e 'p system("nonexsitent &")'
    true
    sh: 1: nonexsitent: not found
    % ruby -e 'p system("nonexsitent")'
    nil

It means "install_gem" always returns true. It breaks the following
logic in lib/hoe/deps.rb:

    install_gem("hoe-#{name}", version, false) or
      install_gem(name, version, false) or
      install_gem(dash_name, version, false) or
      warn "could not install gem for #{name} plugin"

It causes a problem for "kpeg" gem. "hoe-kpeg" gem doesn't
exist. "kpeg" gem should be searched as fallback but it is not
searched. Because install_gem("hoe-#{name}") is not failed.

RDoc depends on "kpeg". So "rake newb" for RDoc is failed.
@phiggins
Copy link
Member

phiggins commented Jun 4, 2013

I had this exact problem and never got around to figuring out what it was. Thanks for tracking it down!

@zenspider
Copy link
Member

Brilliant. Thanks!

@zenspider zenspider closed this Jun 5, 2013
@kou kou deleted the do-not-use-bash-syntax branch June 8, 2013 23:20
@seattlerb seattlerb locked and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants