From 426053cb6cf7bd8e0ac821124f6b4c339dde8e68 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 28 Jul 2019 14:27:33 -0400 Subject: [PATCH] Corrected some license statements In 40ecf58d4ba33453f5c2eb077c780c7db278975d I changed the license of code I wrote from GPL to AGPL. But, two files containing code I wrote combined with code by others were updated to say their license is AGPL, while in fact part of it was (the code I wrote) but part remained under the original license (the code written by others). Remote/Ddar.hs is now changed entirely back to GPL 3. Annex/DirHashes.hs stays AGPL, but I broke out Utility/MD5.hs with the code not written by me, and corrected its license statement to GPL-2, which is the actual version of the GPL included with the code in its original distribution at http://www.cs.ox.ac.uk/people/ian.lynagh/md5/ --- Annex/DirHashes.hs | 23 ++--------------------- CHANGELOG | 1 + COPYRIGHT | 9 +++++---- Remote/Ddar.hs | 2 +- Utility/MD5.hs | 23 +++++++++++++++++++++++ git-annex.cabal | 1 + 6 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 Utility/MD5.hs 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