[Hackage] #391: Installing cabal: ./bootstrap.sh: pushd: not found (probably because of /bin/sh)

Hackage trac at galois.com
Fri Nov 7 06:30:42 EST 2008

#391: Installing cabal: ./bootstrap.sh: pushd: not found (probably because of
  Reporter:  guest                |        Owner:         
      Type:  defect               |       Status:  new    
  Priority:  normal               |    Milestone:         
 Component:  cabal-install tool   |      Version:
  Severity:  normal               |     Keywords:         
Difficulty:  very easy (<1 hour)  |   Ghcversion:  6.8.3  
  Platform:                       |  
 On Ubuntu, trying to install cabal using the "Quick Installation on Unix"
 instructions at [http://hackage.haskell.org/trac/hackage/wiki/CabalInstall
 here] says
 Setup: At least the following dependencies are missing:
     Cabal >=1.4&&<1.5, HTTP >=3000&&<3002, zlib >=0.4
 ./bootstrap.sh: 24: popd: not found
 ./bootstrap.sh: 27: pushd: not found
 and so on.

 The reason is that bootstrap.sh has a "#!/bin/sh" shebang line, and
 pushd/popd are Bash extensions, not POSIX shell features, and Ubuntu uses
 dash, not bash, as /bin/sh (by default).

 The fix is to make bootstrap.sh either not use Bash-specific extensions,
 or (easier) make the top line of bootstrap.sh say "#!/bin/bash" instead of

 [It might be wise to make the same change in all other files that use Bash
 extensions; the tool "checkbashims" might be useful here.]

Ticket URL: <http://hackage.haskell.org/trac/hackage/ticket/391>
Hackage <http://haskell.org/cabal/>
Hackage: Cabal and related projects

More information about the cabal-devel mailing list