Commit c3fedda5 authored by Niels Bunkenburg's avatar Niels Bunkenburg

Rename cpm index and package directory #55 #56

parent 1b83bbdb
......@@ -66,8 +66,8 @@ handleUploadNewPackageTarGz userid tarpath = do
createDirectoryIfMissing True ("packages" </> name </> version)
renameDirectory dirname ("packages" </> name </> version)
-- Move tar file to package store
createDirectoryIfMissing True "packagestore"
renameFile tarpath ("packagestore" </> name ++ "-" ++ version ++ ".tar.gz")
createDirectoryIfMissing True ("cpm" </> "PACKAGES")
renameFile tarpath ("cpm" </> "PACKAGES" </> name ++ "-" ++ version ++ ".tar.gz")
if userTrusted user
then updatePackageIndex
else updateStagingPackageIndex
......@@ -107,8 +107,8 @@ importMultiplePackages paths = do
createDirectoryIfMissing True ("packages" </> name </> version)
renameDirectory path ("packages" </> name </> version)
-- Move tar file to package store
createDirectoryIfMissing True "packagestore"
let dest = "packagestore" </> name ++ "-" ++ version ++ ".tar.gz"
createDirectoryIfMissing True ("cpm" </> "PACKAGES")
let dest = "cpm" </> "PACKAGES" </> name ++ "-" ++ version ++ ".tar.gz"
renameFile tarpath dest) x
importOrder xs
......@@ -302,13 +302,15 @@ createTaskAsJSON n v ccs testsuite docu = JObject $ [("name", JString n)] ++
updatePackageIndex :: IO ()
updatePackageIndex = do
paths <- getPackageIndex False
evalCmd "tar" (["-C", "packages", "-czf", "packages.tar.gz"] ++ paths) ""
createDirectoryIfMissing True ("cpm")
evalCmd "tar" (["-C", "packages", "-czf", "cpm" </> "index.tar.gz"] ++ paths) ""
done
updateStagingPackageIndex :: IO ()
updateStagingPackageIndex = do
paths <- getPackageIndex True
evalCmd "tar" (["-C", "packages", "-czf", "packages-staging.tar.gz"] ++ paths) ""
createDirectoryIfMissing True ("cpm")
evalCmd "tar" (["-C", "packages", "-czf", "cpm" </> "index-staging.tar.gz"] ++ paths) ""
done
getPackageIndex :: Bool -> IO [String]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment