Control: tags 826389 + patch Control: tags 826389 + pending Dear maintainer,
I've prepared an NMU for git-repair (versioned as 1.20151215-1.1) and uploaded it to unstable. Regards. -- Sean Whitton
diff --git a/Common.hs b/Common.hs index a6c5d5488..ab1de4e62 100644 --- a/Common.hs +++ b/Common.hs @@ -13,7 +13,6 @@ import Data.String.Utils as X hiding (join) import Data.Monoid as X import System.FilePath as X -import System.Directory as X import System.IO as X hiding (FilePath) #ifndef mingw32_HOST_OS import System.Posix.IO as X hiding (createPipe) @@ -25,7 +24,7 @@ import Utility.Exception as X import Utility.SafeCommand as X import Utility.Process as X import Utility.Path as X -import Utility.Directory as X +import Utility.Directory as X hiding (getFileSize) import Utility.Monad as X import Utility.Data as X import Utility.Applicative as X diff --git a/Utility/Directory.hs b/Utility/Directory.hs index fae33b5c2..693e77131 100644 --- a/Utility/Directory.hs +++ b/Utility/Directory.hs @@ -8,10 +8,12 @@ {-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-tabs #-} -module Utility.Directory where +module Utility.Directory ( + module Utility.Directory, + module Utility.SystemDirectory +) where import System.IO.Error -import System.Directory import Control.Monad import System.FilePath import Control.Applicative @@ -28,6 +30,7 @@ import Utility.SafeCommand import Control.Monad.IfElse #endif +import Utility.SystemDirectory import Utility.PosixFiles import Utility.Tmp import Utility.Exception @@ -134,11 +137,13 @@ moveFile src dest = tryIO (rename src dest) >>= onrename _ <- tryIO $ removeFile tmp throwM e' +#ifndef mingw32_HOST_OS isdir f = do r <- tryIO $ getFileStatus f case r of (Left _) -> return False (Right s) -> return $ isDirectory s +#endif {- Removes a file, which may or may not exist, and does not have to - be a regular file. diff --git a/Utility/QuickCheck.hs b/Utility/QuickCheck.hs index cd408ddc9..8db03f4cd 100644 --- a/Utility/QuickCheck.hs +++ b/Utility/QuickCheck.hs @@ -6,7 +6,7 @@ -} {-# OPTIONS_GHC -fno-warn-orphans #-} -{-# LANGUAGE TypeSynonymInstances #-} +{-# LANGUAGE TypeSynonymInstances, CPP #-} module Utility.QuickCheck ( module X @@ -21,11 +21,13 @@ import qualified Data.Set as S import Control.Applicative import Prelude +#if ! MIN_VERSION_QuickCheck(2,8,2) instance (Arbitrary k, Arbitrary v, Eq k, Ord k) => Arbitrary (M.Map k v) where arbitrary = M.fromList <$> arbitrary instance (Arbitrary v, Eq v, Ord v) => Arbitrary (S.Set v) where arbitrary = S.fromList <$> arbitrary +#endif {- Times before the epoch are excluded. -} instance Arbitrary POSIXTime where diff --git a/Utility/SystemDirectory.hs b/Utility/SystemDirectory.hs new file mode 100644 index 000000000..3dd44d199 --- /dev/null +++ b/Utility/SystemDirectory.hs @@ -0,0 +1,16 @@ +{- System.Directory without its conflicting isSymbolicLink + - + - Copyright 2016 Joey Hess <i...@joeyh.name> + - + - License: BSD-2-clause + -} + +-- Disable warnings because only some versions of System.Directory export +-- isSymbolicLink. +{-# OPTIONS_GHC -fno-warn-tabs -w #-} + +module Utility.SystemDirectory ( + module System.Directory +) where + +import System.Directory hiding (isSymbolicLink) diff --git a/debian/changelog b/debian/changelog index 9b2e1e496..5b83dffef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,14 @@ +git-repair (1.20151215-1.1) unstable; urgency=medium + + * Non-maintainer upload. + * Cherry pick upstream commit to add MIN_VERSION preprocessor guards to + some instances defined in Utility.QuickCheck (Closes: #826389). + * Cherry pick upstream commit to avoid duplicate import errors in + Utility.Directory. + * Patch Common.hs to avoid duplicate import errors. + + -- Sean Whitton <spwhit...@spwhitton.name> Tue, 25 Jul 2017 17:27:22 -0700 + git-repair (1.20151215-1) unstable; urgency=medium * Package 1.20151215-1 diff --git a/debian/patches/fix-build-with-quickcheck-2.8.2.patch b/debian/patches/fix-build-with-quickcheck-2.8.2.patch new file mode 100644 index 000000000..3e3a0cd2e --- /dev/null +++ b/debian/patches/fix-build-with-quickcheck-2.8.2.patch @@ -0,0 +1,34 @@ +From: Joey Hess <jo...@joeyh.name> +Date: Sun, 24 Jan 2016 14:15:00 -0400 +X-Dgit-Generated: 1.20151215-1.1 1ecd24cc076b15e085529d41e5a873e334f75167 +Subject: Fix build with QuickCheck 2.8.2 + +It added some instances I had also implemented. + +--- + +--- git-repair-1.20151215.orig/Utility/QuickCheck.hs ++++ git-repair-1.20151215/Utility/QuickCheck.hs +@@ -6,7 +6,7 @@ + -} + + {-# OPTIONS_GHC -fno-warn-orphans #-} +-{-# LANGUAGE TypeSynonymInstances #-} ++{-# LANGUAGE TypeSynonymInstances, CPP #-} + + module Utility.QuickCheck + ( module X +@@ -21,11 +21,13 @@ import qualified Data.Set as S + import Control.Applicative + import Prelude + ++#if ! MIN_VERSION_QuickCheck(2,8,2) + instance (Arbitrary k, Arbitrary v, Eq k, Ord k) => Arbitrary (M.Map k v) where + arbitrary = M.fromList <$> arbitrary + + instance (Arbitrary v, Eq v, Ord v) => Arbitrary (S.Set v) where + arbitrary = S.fromList <$> arbitrary ++#endif + + {- Times before the epoch are excluded. -} + instance Arbitrary POSIXTime where diff --git a/debian/patches/patch-common.hs-to-avoid-duplicate-impor.patch b/debian/patches/patch-common.hs-to-avoid-duplicate-impor.patch new file mode 100644 index 000000000..bc8aa279e --- /dev/null +++ b/debian/patches/patch-common.hs-to-avoid-duplicate-impor.patch @@ -0,0 +1,27 @@ +From: Sean Whitton <spwhit...@spwhitton.name> +Date: Tue, 25 Jul 2017 17:10:10 -0700 +X-Dgit-Generated: 1.20151215-1.1 9d82f181d58f8538247a7efb96d1be16d131c158 +Subject: patch Common.hs to avoid duplicate import errors + + +--- + +--- git-repair-1.20151215.orig/Common.hs ++++ git-repair-1.20151215/Common.hs +@@ -13,7 +13,6 @@ import Data.String.Utils as X hiding (jo + import Data.Monoid as X + + import System.FilePath as X +-import System.Directory as X + import System.IO as X hiding (FilePath) + #ifndef mingw32_HOST_OS + import System.Posix.IO as X hiding (createPipe) +@@ -25,7 +24,7 @@ import Utility.Exception as X + import Utility.SafeCommand as X + import Utility.Process as X + import Utility.Path as X +-import Utility.Directory as X ++import Utility.Directory as X hiding (getFileSize) + import Utility.Monad as X + import Utility.Data as X + import Utility.Applicative as X diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 000000000..965db20bc --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,3 @@ +fix-build-with-quickcheck-2.8.2.patch +split-out-module-to-work-around-badly-na.patch +patch-common.hs-to-avoid-duplicate-impor.patch diff --git a/debian/patches/split-out-module-to-work-around-badly-na.patch b/debian/patches/split-out-module-to-work-around-badly-na.patch new file mode 100644 index 000000000..a8c3cbb5c --- /dev/null +++ b/debian/patches/split-out-module-to-work-around-badly-na.patch @@ -0,0 +1,70 @@ +From: Joey Hess <jo...@joeyh.name> +Date: Sun, 22 May 2016 15:51:31 -0400 +X-Dgit-Generated: 1.20151215-1.1 e306cd8521a88c1cc39c926177a184adf9524886 +Subject: split out module to work around badly named symbol in directory-1.2.6.2 + +Sadly my bug report about this is not going to get fixed it seems, so +I have to drag around a whole added module file just to deal with it. + +https://github.com/haskell/directory/issues/52 + +--- + +--- git-repair-1.20151215.orig/Utility/Directory.hs ++++ git-repair-1.20151215/Utility/Directory.hs +@@ -8,10 +8,12 @@ + {-# LANGUAGE CPP #-} + {-# OPTIONS_GHC -fno-warn-tabs #-} + +-module Utility.Directory where ++module Utility.Directory ( ++ module Utility.Directory, ++ module Utility.SystemDirectory ++) where + + import System.IO.Error +-import System.Directory + import Control.Monad + import System.FilePath + import Control.Applicative +@@ -28,6 +30,7 @@ import Utility.SafeCommand + import Control.Monad.IfElse + #endif + ++import Utility.SystemDirectory + import Utility.PosixFiles + import Utility.Tmp + import Utility.Exception +@@ -134,11 +137,13 @@ moveFile src dest = tryIO (rename src de + _ <- tryIO $ removeFile tmp + throwM e' + ++#ifndef mingw32_HOST_OS + isdir f = do + r <- tryIO $ getFileStatus f + case r of + (Left _) -> return False + (Right s) -> return $ isDirectory s ++#endif + + {- Removes a file, which may or may not exist, and does not have to + - be a regular file. +--- /dev/null ++++ git-repair-1.20151215/Utility/SystemDirectory.hs +@@ -0,0 +1,16 @@ ++{- System.Directory without its conflicting isSymbolicLink ++ - ++ - Copyright 2016 Joey Hess <i...@joeyh.name> ++ - ++ - License: BSD-2-clause ++ -} ++ ++-- Disable warnings because only some versions of System.Directory export ++-- isSymbolicLink. ++{-# OPTIONS_GHC -fno-warn-tabs -w #-} ++ ++module Utility.SystemDirectory ( ++ module System.Directory ++) where ++ ++import System.Directory hiding (isSymbolicLink)
signature.asc
Description: PGP signature