[Hackage] #555: mandir is totally busted (wrong, and ignores --destdir)?

Hackage trac at galois.com
Sat May 23 22:42:01 EDT 2009


#555: mandir is totally busted (wrong, and ignores --destdir)?
----------------------------+-----------------------------------------------
  Reporter:  guest          |        Owner:         
      Type:  defect         |       Status:  new    
  Priority:  normal         |    Milestone:         
 Component:  Cabal library  |      Version:  1.6.0.1
  Severity:  normal         |     Keywords:  mandir 
Difficulty:  unknown        |   Ghcversion:  6.10.1 
  Platform:  Linux          |  
----------------------------+-----------------------------------------------
 Consider the following transcript.  Why is Cabal ignoring --destdir,
 and why does mandir default to \$prefix/share/doc/foo-1 instead of
 \$prefix/share/man?

   $ darcs get http://twb.ath.cx/tmp/tinc
   Finished getting.
   $ darcs check --test --repo tinc
   [...]
   + ./Setup copy --verbose --destdir=/tmp
   [...]
   Creating /usr/local/share/doc/foo-1/man1 (and its parents)
   Setup: /usr/local/share/doc: createDirectory: permission denied
 (Permission denied)
   Test failed!

 In case my dummy repo goes away, it is quite simple:

   == Setup.hs ==
     import Distribution.Simple
     import Distribution.Simple.LocalBuildInfo
     import Distribution.Simple.Setup
     import Distribution.Simple.Utils
     import System.FilePath

     {- Copy ./Setup.hs into $mandir/man1.  $mandir *ought* to be
        $destdir/share/man.  It sure as shit shouldn't be /usr/local if I
        set --destdir=/tmp, and it shouldn't be
        $destdir/share/doc/$package/man. -}
     main :: IO ()
     main = defaultMainWithHooks simpleUserHooks {
              postCopy =
                  \ _ flags pkg lbi ->
                      copyFiles (fromFlag $ copyVerbosity flags)
                                (mandir (absoluteInstallDirs pkg lbi
 NoCopyDest) </> "man1")
                                [(".", "Setup.hs")]}
   == foo.cabal ==
     Name: foo
     version: 1
     Build-Type: Custom
     Cabal-Version: >= 1.6

     Executable Setup
      main-is: Setup.hs
      build-depends: base, filepath, Cabal
     changepref test

   == test ==
     set -ex; ghc -Wall --make Setup; ./Setup configure; ./Setup build;
 ./Setup copy --verbose --destdir=/tmp

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


More information about the cabal-devel mailing list