Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/435a1a2b7c0a1a0b6695e76377ccc15d02e22cfe

>---------------------------------------------------------------

commit 435a1a2b7c0a1a0b6695e76377ccc15d02e22cfe
Author: Duncan Coutts <[email protected]>
Date:   Wed Sep 3 23:03:34 2008 +0000

    Only send the base file name when uploading tarballs
    The server should ignore the dir part anyway but there's no
    need to send it in the first place.

>---------------------------------------------------------------

 cabal-install/Distribution/Client/Upload.hs |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/cabal-install/Distribution/Client/Upload.hs 
b/cabal-install/Distribution/Client/Upload.hs
index 159ce99..709f762 100644
--- a/cabal-install/Distribution/Client/Upload.hs
+++ b/cabal-install/Distribution/Client/Upload.hs
@@ -29,7 +29,7 @@ import System.IO        (hFlush, stdin, stdout, hGetEcho, 
hSetEcho
                         ,openBinaryFile, IOMode(ReadMode), hGetContents)
 import Control.Exception (bracket)
 import System.Random    (randomRIO)
-import System.FilePath  ((</>), takeExtension)
+import System.FilePath  ((</>), takeExtension, takeFileName)
 import qualified System.FilePath.Posix as FilePath.Posix (combine)
 import System.Directory
 import Control.Monad (forM_)
@@ -147,10 +147,11 @@ genBoundary = do i <- randomRIO 
(0x10000000000000,0xFFFFFFFFFFFFFF) :: IO Intege
 
 mkFormData :: FilePath -> String -> [BodyPart]
 mkFormData path pkg = 
-    -- yes, web browsers are that stupid (re quoting)
-    [BodyPart [Header hdrContentDisposition ("form-data; name=package; 
filename=\""++path++"\""),
-               Header HdrContentType "application/x-gzip"] 
-     pkg]
+  -- yes, web browsers are that stupid (re quoting)
+  [BodyPart [Header hdrContentDisposition $
+             "form-data; name=package; filename=\""++takeFileName path++"\"",
+             Header HdrContentType "application/x-gzip"]
+   pkg]
 
 hdrContentDisposition :: HeaderName
 hdrContentDisposition = HdrCustom "Content-disposition"



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to