diff --git a/Annex/DirHashes.hs b/Annex/DirHashes.hs index 5910479c83..b150b44f2a 100644 --- a/Annex/DirHashes.hs +++ b/Annex/DirHashes.hs @@ -2,7 +2,7 @@ - - Copyright 2010-2017 Joey Hess - - - Licensed under the GNU AGPL version 3 or higher. + - Licensed under the GNU GPL version 3 or higher. -} module Annex.DirHashes ( @@ -17,8 +17,6 @@ module Annex.DirHashes ( display_32bits_as_dir ) where -import Data.Bits -import Data.Word import Data.Default import qualified Data.ByteArray @@ -27,6 +25,7 @@ import Key import Types.GitConfig import Types.Difference import Utility.Hash +import Utility.MD5 type Hasher = Key -> FilePath @@ -78,21 +77,3 @@ hashDirMixed n k = hashDirs n 2 $ take 4 $ concatMap display_32bits_as_dir $ (shiftL b4 24 .|. shiftL b3 16 .|. shiftL b2 8 .|. b1) : encodeWord32 rest encodeWord32 _ = [] - -{- modified version of display_32bits_as_hex from Data.Hash.MD5 - - in MissingH - - Copyright (C) 2001 Ian Lynagh - - License: Either BSD or GPL - -} -display_32bits_as_dir :: Word32 -> String -display_32bits_as_dir w = trim $ swap_pairs cs - where - -- Need 32 characters to use. To avoid inaverdently making - -- a real word, use letters that appear less frequently. - chars = ['0'..'9'] ++ "zqjxkmvwgpfZQJXKMVWGPF" - cs = map (\x -> getc $ (shiftR w (6*x)) .&. 31) [0..7] - getc n = chars !! fromIntegral n - swap_pairs (x1:x2:xs) = x2:x1:swap_pairs xs - swap_pairs _ = [] - -- Last 2 will always be 00, so omit. - trim = take 6 diff --git a/CHANGELOG b/CHANGELOG index ebc8c7f73f..56b47edf20 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -20,6 +20,7 @@ git-annex (7.20190709) UNRELEASED; urgency=medium * Windows problems with long filenames should be fixed now, since the Windows build is made with a newer ghc version that works around the problems. + * Corrected some license statements. -- Joey Hess Mon, 08 Jul 2019 08:59:54 -0400 diff --git a/COPYRIGHT b/COPYRIGHT index dd4574cb7e..fd94655fbf 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -13,7 +13,7 @@ License: AGPL-3+ Files: Remote/Ddar.hs Copyright: © 2011 Joey Hess © 2014 Robie Basak -License: AGPL-3+ +License: GPL-3+ Files: Utility/ThreadScheduler.hs Copyright: 2011 Bas van Dijk & Roel van Dijk @@ -36,10 +36,11 @@ Copyright: 2007 Henrik Nyh License: icon-license Free to modify and redistribute with due credit, and obviously free to use. -Files: Annex/DirHashes.hs +Files: Utility/MD5.hs Copyright: 2001 Ian Lynagh - 2010-2015 Joey Hess -License: AGPL-3+ +License: GPL-2 + The full text of version 2 of the GPL is distributed in + /usr/share/common-licenses/GPL-2 on Debian systems. Files: doc/tips/automatically_adding_metadata/pre-commit-annex Copyright: 2014 Joey Hess diff --git a/Remote/Ddar.hs b/Remote/Ddar.hs index 269dd8b0b0..250fd90293 100644 --- a/Remote/Ddar.hs +++ b/Remote/Ddar.hs @@ -3,7 +3,7 @@ - Copyright 2011 Joey Hess - Copyright 2014 Robie Basak - - - Licensed under the GNU AGPL version 3 or higher. + - Licensed under the GNU GPL version 3 or higher. -} module Remote.Ddar (remote) where diff --git a/Utility/MD5.hs b/Utility/MD5.hs new file mode 100644 index 0000000000..d0475bf480 --- /dev/null +++ b/Utility/MD5.hs @@ -0,0 +1,23 @@ +{- modified version of MD5 from http://www.cs.ox.ac.uk/people/ian.lynagh/md5 + - + - Copyright (C) 2001 Ian Lynagh + - License: GPL 2 + -} + +module Utility.MD5 where + +import Data.Bits +import Data.Word + +display_32bits_as_dir :: Word32 -> String +display_32bits_as_dir w = trim $ swap_pairs cs + where + -- Need 32 characters to use. To avoid inaverdently making + -- a real word, use letters that appear less frequently. + chars = ['0'..'9'] ++ "zqjxkmvwgpfZQJXKMVWGPF" + cs = map (\x -> getc $ (shiftR w (6*x)) .&. 31) [0..7] + getc n = chars !! fromIntegral n + swap_pairs (x1:x2:xs) = x2:x1:swap_pairs xs + swap_pairs _ = [] + -- Last 2 will always be 00, so omit. + trim = take 6 diff --git a/git-annex.cabal b/git-annex.cabal index 1bfe94de25..4571255992 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -1056,6 +1056,7 @@ Executable git-annex Utility.Lsof Utility.MagicWormhole Utility.Matcher + Utility.MD5 Utility.Metered Utility.Misc Utility.Monad