diff options
author | Joey Hess <joey@kitenet.net> | 2014-06-18 16:11:20 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2014-06-18 16:11:20 -0400 |
commit | 61a9116ef12aeb2bab13d1c693d71277b7422467 (patch) | |
tree | 36a04fabdb99ccc76b7b7da647d17237ac7def45 | |
parent | d39c8cc0caca403d69ca4fcbd916e8bf5ac2a88d (diff) |
couple bug fixes in build-version code
-rw-r--r-- | Build/DistributionUpdate.hs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Build/DistributionUpdate.hs b/Build/DistributionUpdate.hs index 0c95297e5..c0de4cd58 100644 --- a/Build/DistributionUpdate.hs +++ b/Build/DistributionUpdate.hs @@ -21,6 +21,7 @@ import Git.Command import Data.Default import Data.Time.Clock +import Data.Char -- git-annex distribution signing key (for Joey Hess) signingKey :: String @@ -59,10 +60,10 @@ main = do getbuild :: FilePath -> (URLString, FilePath) -> IO (Maybe (FilePath, Version)) getbuild repodir (url, f) = do bv1 <- getbv - createDirectoryIfMissing True repodir let dest = repodir </> f let tmp = dest ++ ".tmp" nukeFile tmp + createDirectoryIfMissing True (parentDir dest) let oops s = do nukeFile tmp putStrLn $ "*** " ++ s @@ -86,7 +87,8 @@ getbuild repodir (url, f) = do getbv = do bv <- catchDefaultIO "" $ readProcess "curl" [takeDirectory url ++ "build-version"] - return $ if null bv then Nothing else Just bv + return $ if null bv || any (not . versionchar) bv then Nothing else Just bv + versionchar c = isAlphaNum c || c == '.' || c == '-' makeinfos :: [(FilePath, Version)] -> Annex () makeinfos updated = do |