[Git][haskell-team/DHG_packages][master] fix haskell-yi-core
Marcel Fourné (@mfourne)
gitlab at salsa.debian.org
Sat Oct 28 15:45:20 BST 2023
Marcel Fourné pushed to branch master at Debian Haskell Group / DHG_packages
Commits:
59d61ff2 by Marcel Fourné at 2023-10-28T16:44:43+02:00
fix haskell-yi-core
- - - - -
4 changed files:
- p/haskell-yi-core/debian/changelog
- − p/haskell-yi-core/debian/patches/0001-add-nomonadfaildesugaring.patch
- + p/haskell-yi-core/debian/patches/0002-update-for-unix-compat-0.7.patch
- p/haskell-yi-core/debian/patches/series
Changes:
=====================================
p/haskell-yi-core/debian/changelog
=====================================
@@ -1,8 +1,13 @@
-haskell-yi-core (0.19.2-3) UNRELEASED; urgency=medium
+haskell-yi-core (0.19.2-3) unstable; urgency=medium
+ [ Ilias Tsitsimpis ]
* Declare compliance with Debian policy 4.6.2
- -- Ilias Tsitsimpis <iliastsi at debian.org> Sun, 27 Aug 2023 12:35:01 +0300
+ [ Marcel Fourné ]
+ * add 0002-update-for-unix-compat-0.7.patch, applied upstream (Closes: #1053633)
+ * remove 0001-add-nomonadfaildesugaring.patch (Closes: #1054848, #1053714)
+
+ -- Marcel Fourné <email at marcelfourne.de> Sat, 28 Oct 2023 16:24:20 +0200
haskell-yi-core (0.19.2-2) unstable; urgency=medium
=====================================
p/haskell-yi-core/debian/patches/0001-add-nomonadfaildesugaring.patch deleted
=====================================
@@ -1,29 +0,0 @@
---- a/yi-core.cabal
-+++ b/yi-core.cabal
-@@ -21,7 +21,7 @@
- library
- hs-source-dirs:
- src
-- ghc-options: -Wall -ferror-spans -Wall -fno-warn-orphans -ferror-spans
-+ ghc-options: -Wall -ferror-spans -Wall -fno-warn-orphans -ferror-spans -XNoMonadFailDesugaring
- build-depends:
- base >= 4.8 && < 5
- , array
-@@ -143,7 +143,7 @@
- main-is: Spec.hs
- hs-source-dirs:
- test
-- ghc-options: -Wall -ferror-spans
-+ ghc-options: -Wall -ferror-spans -XNoMonadFailDesugaring
- build-depends:
- base >= 4.8 && < 5
- , yi-rope >= 0.10
-@@ -167,7 +167,7 @@
- main-is: Bench.hs
- hs-source-dirs:
- bench
-- ghc-options: -Wall -ferror-spans -Wall -ferror-spans -rtsopts
-+ ghc-options: -Wall -ferror-spans -Wall -ferror-spans -rtsopts -XNoMonadFailDesugaring
- build-depends:
- base >= 4.8 && < 5
- , yi-core
=====================================
p/haskell-yi-core/debian/patches/0002-update-for-unix-compat-0.7.patch
=====================================
@@ -0,0 +1,97 @@
+From c1c665772b815b9be427a8056fde40df4a5efb04 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Marcel=20Fourn=C3=A9?= <haskell at marcelfourne.de>
+Date: Sat, 18 Mar 2023 17:01:38 +0100
+Subject: [PATCH] update for unix-compat 0.7: System.PosixCompat.User is gone.
+ Previous behaviour of it was erroring out for mingw32_HOST_OS or using
+ System.Posix.User anyway, so let's do that directly ourselves.
+
+---
+ yi-core/src/System/FriendlyPath.hs | 11 ++++++++++-
+ yi-core/src/Yi/Dired.hs | 10 ++++++++--
+ 2 files changed, 18 insertions(+), 3 deletions(-)
+
+diff --git a/src/System/FriendlyPath.hs b/src/System/FriendlyPath.hs
+index d028cc45..20c330b8 100644
+--- a/src/System/FriendlyPath.hs
++++ b/src/System/FriendlyPath.hs
+@@ -1,3 +1,5 @@
++{-# LANGUAGE CPP #-}
++
+ module System.FriendlyPath
+ ( userToCanonPath
+ , expandTilda
+@@ -7,7 +9,9 @@ module System.FriendlyPath
+ import System.CanonicalizePath (canonicalizePath)
+ import System.Directory (getHomeDirectory)
+ import System.FilePath (isAbsolute, normalise, pathSeparator)
+-import System.PosixCompat.User (getUserEntryForName, homeDirectory)
++#ifndef mingw32_HOST_OS
++import System.Posix.User (getUserEntryForName, homeDirectory)
++#endif
+
+
+ -- canonicalizePath follows symlinks, and does not work if the directory does not exist.
+@@ -20,10 +24,15 @@ userToCanonPath f = canonicalizePath =<< expandTilda f
+ expandTilda :: String -> IO FilePath
+ expandTilda ('~':path)
+ | null path || (head path == pathSeparator) = (++ path) <$> getHomeDirectory
++#ifndef mingw32_HOST_OS
+ -- Home directory of another user, e.g. ~root/
+ | otherwise = let username = takeWhile (/= pathSeparator) path
+ dirname = drop (length username) path
+ in (normalise . (++ dirname) . homeDirectory) <$> getUserEntryForName username
++#else
++ -- unix-compat no longer helps
++ | otherwise = ioError $ mkIOError illegalOperationErrorType "Tilda expansion only supported under Unix" Nothing Nothing
++#endif
+ expandTilda path = return path
+
+ -- | Is a user-friendly path absolute?
+diff --git a/src/Yi/Dired.hs b/src/Yi/Dired.hs
+index 4cfaf507..331da36c 100644
+--- a/src/Yi/Dired.hs
++++ b/src/Yi/Dired.hs
+@@ -89,11 +89,13 @@ import System.PosixCompat.Files (FileStatus, fileExist, fileGroup,
+ readSymbolicLink, removeLink, rename,
+ unionFileModes)
+ import System.PosixCompat.Types (FileMode, GroupID, UserID)
+-import System.PosixCompat.User (GroupEntry, GroupEntry (..),
++#ifndef mingw32_HOST_OS
++import System.Posix.User (GroupEntry, GroupEntry (..),
+ UserEntry (..), getAllGroupEntries,
+ getAllUserEntries,
+ getGroupEntryForID,
+ getUserEntryForID, groupID, userID)
++#endif
+ import Text.Printf (printf)
+ import Yi.Buffer
+ import Yi.Config (modeTable)
+@@ -665,6 +667,7 @@ diredScanDir dir = do
+ -> DiredEntries
+ -> FilePath
+ -> IO DiredEntries
++#ifndef mingw32_HOST_OS
+ lineForFile d m f = do
+ let fp = d </> f
+ fileStatus <- getSymbolicLinkStatus fp
+@@ -709,7 +712,6 @@ diredScanDir dir = do
+ , sizeInBytes = sz
+ , modificationTimeString = modTimeStr}
+
+-
+ -- | Needed on Mac OS X 10.4
+ scanForUid :: UserID -> [UserEntry] -> UserEntry
+ scanForUid uid entries = fromMaybe missingEntry $
+@@ -724,6 +726,10 @@ scanForGid gid entries = fromMaybe missingEntry $
+ where
+ missingEntry = GroupEntry "?" mempty gid mempty
+
++#else
++ -- has been the default for Windows anyway, so just directly do it without unix-compat
++ lineForFile _ m f = return $ M.insert (R.fromString f) DiredNoInfo m
++#endif
+
+ modeString :: FileMode -> R.YiString
+ modeString fm = ""
+--
+2.42.0
=====================================
p/haskell-yi-core/debian/patches/series
=====================================
@@ -1,2 +1,3 @@
0001-add-nomonadfaildesugaring.patch
yi-PR-1127
+0002-update-for-unix-compat-0.7.patch
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/59d61ff2a4ce7d81d221822122fc97a2ee003702
--
View it on GitLab: https://salsa.debian.org/haskell-team/DHG_packages/-/commit/59d61ff2a4ce7d81d221822122fc97a2ee003702
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-haskell-commits/attachments/20231028/95a385e9/attachment-0001.htm>
More information about the Pkg-haskell-commits
mailing list