packages feed

dl-fedora 0.7.1 → 0.7.2

raw patch · 3 files changed

+29/−11 lines, 3 files

Files

CHANGELOG.md view
@@ -1,5 +1,8 @@ # Changelog +## 0.7.2 (2019-10-29)+- add stage release target (useful just prior to release)+ ## 0.7.1 (2019-09-25) - print datestamp beside filesize - show directory correctly with ~/
Main.hs view
@@ -1,18 +1,22 @@ {-# LANGUAGE CPP #-} +#if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,13,0))+#else import Control.Applicative ((<|>) #if (defined(MIN_VERSION_base) && MIN_VERSION_base(4,8,0)) #else   , (<$>), (<*>) #endif   )+import Data.Semigroup ((<>))+#endif+ import Control.Monad (when, unless)  import qualified Data.ByteString.Char8 as B import Data.Char (isDigit, toLower, toUpper) import Data.List import Data.Maybe-import Data.Semigroup ((<>)) import qualified Data.Text as T import Data.Time.LocalTime (utcToLocalZonedTime) @@ -83,7 +87,7 @@ main = do   let pdoc = Just $ P.vcat              [ P.text "Tool for downloading Fedora iso file images.",-               P.text ("RELEASE = " <> intercalate ", " ["rawhide", "respin", "test", "or release number"]),+               P.text ("RELEASE = " <> intercalate ", " ["release number", "respin", "rawhide", "test", "or stage"]),                P.text "EDITION = " <> P.lbrace <> P.align (P.fillCat (P.punctuate P.comma (map (P.text . map toLower . show) [(minBound :: FedoraEdition)..maxBound])) <> P.rbrace),                P.text "",                P.text "See <https://fedoraproject.org/wiki/Infrastructure/MirrorManager>",@@ -223,12 +227,13 @@       case tgtrel of         "respin" -> return ("alt/live-respins", Nothing)         "rawhide" -> return ("fedora/linux/development/rawhide" </> subdir, Just "Rawhide")-        "test" -> checkTestRel mgr subdir-        rel | all isDigit rel -> checkReleased mgr rel subdir+        "test" -> testRelease mgr subdir+        "stage" -> stageRelease mgr subdir+        rel | all isDigit rel -> released mgr rel subdir         _ -> error' "Unknown release" -    checkTestRel :: Manager -> FilePath -> IO (FilePath, Maybe String)-    checkTestRel mgr subdir = do+    testRelease :: Manager -> FilePath -> IO (FilePath, Maybe String)+    testRelease mgr subdir = do       let path = "fedora/linux" </> "releases/test"           url = dlFpo </> path       -- use http-directory-0.1.6 removeTrailing@@ -236,8 +241,17 @@       let mrel = listToMaybe rels       return (path </> fromMaybe (error' ("test release not found in " <> url)) mrel </> subdir, mrel) -    checkReleased :: Manager -> FilePath -> FilePath -> IO (FilePath, Maybe String)-    checkReleased mgr rel subdir = do+    stageRelease :: Manager -> FilePath -> IO (FilePath, Maybe String)+    stageRelease mgr subdir = do+      let path = "alt/stage"+          url = dlFpo </> path+      -- use http-directory-0.1.6 removeTrailing+      rels <- reverse . map (T.unpack . T.dropWhileEnd (== '/')) <$> httpDirectory mgr url+      let mrel = listToMaybe rels+      return (path </> fromMaybe (error' ("staged release not found in " <> url)) mrel </> subdir, takeWhile (/= '_') <$> mrel)++    released :: Manager -> FilePath -> FilePath -> IO (FilePath, Maybe String)+    released mgr rel subdir = do       let dir = "fedora/linux/releases"           url = dlFpo </> dir       exists <- httpExists mgr $ url </> rel
dl-fedora.cabal view
@@ -1,6 +1,6 @@ cabal-version:       1.18 name:                dl-fedora-version:             0.7.1+version:             0.7.2 synopsis:            Fedora image download tool description:         Tool to download Fedora iso and image files -- can change to GPL-3.0-or-later with Cabal-2.2@@ -15,8 +15,9 @@ build-type:          Simple extra-doc-files:     README.md                    , CHANGELOG.md-tested-with:         GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.4, GHC == 8.6.5,-                     GHC == 7.10.3+tested-with:         GHC == 8.8.1, GHC == 8.6.5, GHC == 8.4.4, GHC == 8.2.2,+                     GHC == 8.0.2, GHC == 7.10.3, GHC == 7.8.4, GHC == 7.6.3,+                     GHC == 7.4.2  source-repository head   type:     git