add hashing to web log files
This commit is contained in:
parent
fb58d1a560
commit
79016c197c
4 changed files with 21 additions and 18 deletions
14
Locations.hs
14
Locations.hs
|
@ -19,8 +19,6 @@ module Locations (
|
|||
gitAnnexUnusedLog,
|
||||
gitAnnexJournalDir,
|
||||
isLinkToAnnex,
|
||||
logFile,
|
||||
logFileKey,
|
||||
hashDirMixed,
|
||||
hashDirLower,
|
||||
|
||||
|
@ -115,18 +113,6 @@ gitAnnexJournalDir r = addTrailingPathSeparator $ gitAnnexDir r </> "journal"
|
|||
isLinkToAnnex :: FilePath -> Bool
|
||||
isLinkToAnnex s = ("/.git/" ++ objectDir) `isInfixOf` s
|
||||
|
||||
{- The filename of the log file for a given key. -}
|
||||
logFile :: Key -> String
|
||||
logFile key = hashDirLower key ++ keyFile key ++ ".log"
|
||||
|
||||
{- Converts a log filename into a key. -}
|
||||
logFileKey :: FilePath -> Maybe Key
|
||||
logFileKey file
|
||||
| end == ".log" = readKey beginning
|
||||
| otherwise = Nothing
|
||||
where
|
||||
(beginning, end) = splitAt (length file - 4) file
|
||||
|
||||
{- Converts a key into a filename fragment.
|
||||
-
|
||||
- Escape "/" in the key name, to keep a flat tree of files and avoid
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue