Skip to content

Commit

Permalink
Add a file for handling configuration.
Browse files Browse the repository at this point in the history
To begin it just holds the static value for the URL of the index file (and the
filename where it's stored.

Signed-off-by: Magnus Therning <magnus@therning.org>
  • Loading branch information
magthe committed Jul 11, 2015
1 parent a1510f8 commit f83ad05
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cblrepo.cabal
Expand Up @@ -24,7 +24,7 @@ executable cblrepo
hs-source-dirs: src
main-is: Main.hs
other-modules: PkgDB Add BumpPkgs BuildPkgs Update Versions Upgrades ListPkgs PkgBuild OldPkgDB ConvertDB Remove Extract
Util.Translation Util.Cabal Util.HackageIndex Util.Misc Util.Dist
Util.Translation Util.Cabal Util.HackageIndex Util.Misc Util.Dist Util.Cfg
build-depends: base ==4.8.*, filepath ==1.4.*,
directory ==1.2.*, Cabal ==1.22.*, transformers ==0.4.*,
bytestring ==0.10.*, tar ==0.4.*, zlib ==0.5.*, mtl ==2.2.*,
Expand Down
1 change: 1 addition & 0 deletions src/Update.hs
Expand Up @@ -17,6 +17,7 @@
module Update where

import Util.Misc
import Util.Cfg

import Control.Monad.Reader
import System.FilePath
Expand Down
21 changes: 21 additions & 0 deletions src/Util/Cfg.hs
@@ -0,0 +1,21 @@
{-
- Copyright 2015 Per Magnus Therning
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-}

module Util.Cfg
where

indexUrl = "http://hackage.fpcomplete.com/00-index.tar.gz"
indexFileName = "index.tar.gz"
1 change: 1 addition & 0 deletions src/Util/HackageIndex.hs
Expand Up @@ -19,6 +19,7 @@ module Util.HackageIndex

import Util.Misc
import Util.Dist
import Util.Cfg

import qualified Codec.Archive.Tar as Tar
import qualified Codec.Compression.GZip as GZip
Expand Down
3 changes: 0 additions & 3 deletions src/Util/Misc.hs
Expand Up @@ -59,9 +59,6 @@ ghcDefVersion = Version [7, 10, 1] []
ghcVersionDep :: Version -> Int -> String
ghcVersionDep ghcVer ghcRel = "ghc=" ++ display ghcVer ++ "-" ++ show ghcRel

indexUrl = "http://hackage.fpcomplete.com/00-index.tar.gz"
indexFileName = "index.tar.gz"

-- {{{1 command line parser helpers
readPkgNVersion :: ReadP (String, Version)
readPkgNVersion = do
Expand Down

0 comments on commit f83ad05

Please sign in to comment.