summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-01-01 20:50:07 +0000
committerSean Whitton <spwhitton@spwhitton.name>2020-01-01 20:50:07 +0000
commit5a086f664e9efbb25acb0652dc0e10adede61c2e (patch)
tree405ba59aec2689cc0616a2afcc211e4aedf11c06
parenta332433aac213fdece32f9a9e5b5749853770abf (diff)
parenta359c2841a68bb7fe6182fddc8e84abb7a463040 (diff)
downloadgit-repair-5a086f664e9efbb25acb0652dc0e10adede61c2e.tar.gz
Merge remote-tracking branch 'dgit/dgit/sid'
-rw-r--r--Common.hs3
-rw-r--r--Utility/Directory.hs9
-rw-r--r--Utility/QuickCheck.hs7
-rw-r--r--Utility/SystemDirectory.hs16
-rw-r--r--debian/changelog19
-rw-r--r--debian/patches/fix-build-with-quickcheck-2.8.2.patch34
-rw-r--r--debian/patches/patch-common.hs-to-avoid-duplicate-impor.patch27
-rw-r--r--debian/patches/patch-duplicate-arbitrary-instance-out-o.patch20
-rw-r--r--debian/patches/series4
-rw-r--r--debian/patches/split-out-module-to-work-around-badly-na.patch70
10 files changed, 201 insertions, 8 deletions
diff --git a/Common.hs b/Common.hs
index a6c5d54..ab1de4e 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 fae33b5..693e771 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 cd408dd..2009476 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,19 +21,18 @@ 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
arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
-instance Arbitrary EpochTime where
- arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
-
{- Pids are never negative, or 0. -}
instance Arbitrary ProcessID where
arbitrary = arbitrarySizedBoundedIntegral `suchThat` (> 0)
diff --git a/Utility/SystemDirectory.hs b/Utility/SystemDirectory.hs
new file mode 100644
index 0000000..3dd44d1
--- /dev/null
+++ b/Utility/SystemDirectory.hs
@@ -0,0 +1,16 @@
+{- System.Directory without its conflicting isSymbolicLink
+ -
+ - Copyright 2016 Joey Hess <id@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 9b2e1e4..452b5fa 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,22 @@
+git-repair (1.20151215-1.2) unstable; urgency=medium
+
+ * Non-maintainer upload.
+ * Patch duplicate Arbitrary instance of EpochTime out of
+ Utility/QuickCheck.hs (Closes: #897509).
+
+ -- Sean Whitton <spwhitton@spwhitton.name> Sun, 22 Jul 2018 14:33:24 +0800
+
+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 <spwhitton@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 0000000..3e3a0cd
--- /dev/null
+++ b/debian/patches/fix-build-with-quickcheck-2.8.2.patch
@@ -0,0 +1,34 @@
+From: Joey Hess <joeyh@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 0000000..bc8aa27
--- /dev/null
+++ b/debian/patches/patch-common.hs-to-avoid-duplicate-impor.patch
@@ -0,0 +1,27 @@
+From: Sean Whitton <spwhitton@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/patch-duplicate-arbitrary-instance-out-o.patch b/debian/patches/patch-duplicate-arbitrary-instance-out-o.patch
new file mode 100644
index 0000000..1334809
--- /dev/null
+++ b/debian/patches/patch-duplicate-arbitrary-instance-out-o.patch
@@ -0,0 +1,20 @@
+From: Sean Whitton <spwhitton@spwhitton.name>
+Date: Sun, 22 Jul 2018 14:30:36 +0800
+X-Dgit-Generated: 1.20151215-1.2 5e47ead106bebfd076d950934fbe11d9f1ef552c
+Subject: patch duplicate Arbitrary instance out of Utility/QuickCheck.hs
+
+
+---
+
+--- git-repair-1.20151215.orig/Utility/QuickCheck.hs
++++ git-repair-1.20151215/Utility/QuickCheck.hs
+@@ -33,9 +33,6 @@ instance (Arbitrary v, Eq v, Ord v) => A
+ instance Arbitrary POSIXTime where
+ arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
+
+-instance Arbitrary EpochTime where
+- arbitrary = fromInteger <$> nonNegative arbitrarySizedIntegral
+-
+ {- Pids are never negative, or 0. -}
+ instance Arbitrary ProcessID where
+ arbitrary = arbitrarySizedBoundedIntegral `suchThat` (> 0)
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..ae13db9
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1,4 @@
+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
+patch-duplicate-arbitrary-instance-out-o.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 0000000..a8c3cbb
--- /dev/null
+++ b/debian/patches/split-out-module-to-work-around-badly-na.patch
@@ -0,0 +1,70 @@
+From: Joey Hess <joeyh@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 <id@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)