File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Distribution/Server/Features Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,15 @@ serveLegacyGets = msum
7272 movedPermanently (" /package/" ++ display (packageId :: PackageId )) $
7373 toResponse " "
7474 ]
75+ , dir " package" $ path $ \ fileName -> methodSP GET $
76+ case Posix. splitExtension fileName of
77+ (fileName', " .gz" ) -> case Posix. splitExtension fileName' of
78+ (packageStr, " .tar" ) -> case simpleParse packageStr of
79+ Just pkgid ->
80+ movedPermanently (packageTarball pkgid) $ toResponse " "
81+ _ -> mzero
82+ _ -> mzero
83+ _ -> mzero
7584 ]
7685 where
7786 -- HTTP 301 is suitable for permanently redirecting pages
@@ -127,11 +136,12 @@ serveArchiveTree = msum
127136 ]
128137 ]
129138 where
130- packageTarball :: PackageId -> String
131- packageTarball pkgid = " /package/" ++ display pkgid ++ " /" ++ display pkgid ++ " .tar.gz"
132-
133139 docPath pkgid file = " /package/" ++ display pkgid ++ " /" ++ " doc/" ++ file
134140
135141 cabalPath pkgid = " /package/" ++ display pkgid ++ " /"
136142 ++ display (packageName pkgid) ++ " .cabal"
137143
144+ packageTarball :: PackageId -> String
145+ packageTarball pkgid = " /package/" ++ display pkgid
146+ ++ " /" ++ display pkgid ++ " .tar.gz"
147+
You can’t perform that action at this time.
0 commit comments