Ticket #3130: directory_native.dpatch

File directory_native.dpatch, 6.8 KB (added by shelarcy, 6 years ago)
Line 
1Tue Mar 24 09:18:10 “Œ‹ž (•W€Žž) 2009  shelarcy <[email protected]>
2  * Use System.Win32.copyFile
3
4Tue Mar 24 09:20:40 “Œ‹ž (•W€Žž) 2009  shelarcy <[email protected]>
5  * Use SearchPathW instead of SearchPathA
6
7New patches:
8
9[Use System.Win32.copyFile
10shelarcy <[email protected]>**20090324001810
11 Ignore-this: 9d4758bdf99131698cbfac1dd84cf1bc
12] hunk ./System/Directory.hs 597
13     do readFile fromFPath >>= writeFile toFPath
14        Prelude.catch (copyPermissions fromFPath toFPath)
15                      (\_ -> return ())
16+#elif defined(mingw32_HOST_OS)
17+copyFile fromFPath toFPath =
18+   System.Win32.copyFile fromFPath toFPath False
19 #else
20 copyFile fromFPath toFPath =
21     copy `Prelude.catch` (\exc -> throw $ ioeSetLocation exc "copyFile")
22[Use SearchPathW instead of SearchPathA
23shelarcy <[email protected]>**20090324002040
24 Ignore-this: b3fc99bc3064963ce1fc696dc4569c39
25] {
26hunk ./System/Directory.hs 675
27 findExecutable :: String -> IO (Maybe FilePath)
28 findExecutable binary =
29 #if defined(mingw32_HOST_OS)
30-  withCString binary $ \c_binary ->
31-  withCString ('.':exeExtension) $ \c_ext ->
32+  withCWString binary $ \c_binary ->
33+  withCWString ('.':exeExtension) $ \c_ext ->
34   allocaBytes long_path_size $ \pOutPath ->
35   alloca $ \ppFilePart -> do
36     res <- c_SearchPath nullPtr c_binary c_ext (fromIntegral long_path_size) pOutPath ppFilePart
37hunk ./System/Directory.hs 681
38     if res > 0 && res < fromIntegral long_path_size
39-      then do fpath <- peekCString pOutPath
40+      then do fpath <- peekCWString pOutPath
41               return (Just fpath)
42       else return Nothing
43 
44hunk ./System/Directory.hs 685
45-foreign import stdcall unsafe "SearchPathA"
46-            c_SearchPath :: CString
47-                         -> CString
48-                         -> CString
49+foreign import stdcall unsafe "SearchPathW"
50+            c_SearchPath :: CWString
51+                         -> CWString
52+                         -> CWString
53                          -> CInt
54hunk ./System/Directory.hs 690
55-                         -> CString
56-                         -> Ptr CString
57+                         -> CWString
58+                         -> Ptr CWString
59                          -> IO CInt
60 #else
61  do
62}
63
64Context:
65
66[Since __hscore_R_OK and friends are inline C, use correct .h location.
67[email protected]**20090316113815
68 This patch just adds HsDirectory.h into the foreign imports of these
69 values.  Without it, nhc98 cannot generate correct interfacing code.
70]
71[Stop the copyFile00{1,2} tests tripping over each other
72Ian Lynagh <[email protected]>**20090313211357]
73[FIX #3086: use System.Win32.getTemporaryDirectory
74Simon Marlow <[email protected]>**20090312161408]
75[FIX #2963: Use System.Win32.getCurrentDirectory
76Simon Marlow <[email protected]>**20090311113737]
77[Add config.guess, config.sub and install-sh
78Ian Lynagh <[email protected]>**20090307153847]
79[Fix Hugs build (#ifdef code inclusion was slightly wrong)
80[email protected]**20090218120300]
81[nhc98 now uses more of the code (shared with ghc) here.
82[email protected]**20090206173447]
83[fix this test for the new version of createDirectoryIfMissing (#2808)
84Simon Marlow <[email protected]>**20090204163319
85 - add another race test, for two threads both doing create;cleanup
86 - ignore isDoesNotExistErrors in create
87]
88[Fix createDirectoryIfMissing to not throw if the dir got deleted
89Duncan Coutts <[email protected]>**20081222164105
90 When we call createDirectory and some file system object already exists
91 we have a problem. We need to distinguish if it is a file that already
92 exists or if it is a directory because in the latter case it is not an
93 error. Previously we called doesDirectoryExist however that does not
94 distinguish the dir not existing (due to another thread deleting it)
95 and an ordinary file existing. We now use withFileStatus to throw the
96 original AlreadyExistsError only if a non-directory object exists.
97 So now the only time we should get a spurious exception is if another
98 thread deletes the directory and puts a file in its place between our
99 call to createDirectory and withFileStatus. It should now be safe to
100 race createDirectoryIfMissing with itself or deleteDirectoryRecursive.
101]
102[Alternative implementation of createDirectoryIfMissing
103Duncan Coutts <[email protected]>**20081218144704]
104[Require Cabal version >= 1.6
105Ian Lynagh <[email protected]>**20090122011258]
106[Add "bug-reports" and "source-repository" info to the Cabal file
107Ian Lynagh <[email protected]>**20090121182123]
108[Fix getPermissions001 on Windows
109Ian Lynagh <[email protected]>**20090109182554]
110[Avoid using IOError internals
111Ian Lynagh <[email protected]>**20090104173159]
112[add Windows output
113Simon Marlow <[email protected]>**20081201091839]
114[rename test directory to avoid clash
115Simon Marlow <[email protected]>**20081201092254]
116[avoid race conditions in createDirectoryIfMissing (#2808)
117Simon Marlow <[email protected]>**20081126123659]
118[add test for createDirectoryIfMissing (#2808)
119Simon Marlow <[email protected]>**20081126115606]
120[add some extra_cleans
121Simon Marlow <[email protected]>**20081114104113]
122[make this test more robust to changes in the testsuite driver
123Simon Marlow <[email protected]>**20081112122118]
124[Fix these tests
125Simon Marlow <[email protected]>**20080927133111]
126[Bump version number to 1.0.0.2
127Ian Lynagh <[email protected]>**20080920160029]
128[TAG 6.10 branch has been forked
129Ian Lynagh <[email protected]>**20080919123438]
130[fix typo in extra-source-files
131Ross Paterson <[email protected]>**20080831143921]
132[fix cabal build-depends for nhc98
133[email protected]**20080828104733]
134[add createDirectory (already exists) test
135Simon Marlow <[email protected]>**20080826091719]
136[add extra-source-files
137Ross Paterson <[email protected]>**20080824224413]
138[add category field
139Ross Paterson <[email protected]>**20080824003013]
140[make more use of System.Win32 or System.Posix
141Simon Marlow <[email protected]>**20080821143550]
142[fix #2298: use MoveFileEx() on Windows
143Simon Marlow <[email protected]>**20080820140124]
144[test for renameFile
145Simon Marlow <[email protected]>**20080818155059]
146[import the Haskell 98 module Control.Exception.Base instead
147Ross Paterson <[email protected]>**20080812234553]
148[fixup for change of exception types in nhc98
149[email protected]**20080805155253]
150[Remove uses of catchAny and ignoreExceptions
151Ian Lynagh <[email protected]>**20080803114120]
152[Follow extensible exceptions changes
153Ian Lynagh <[email protected]>**20080623193105]
154[Silence warnings
155Ian Lynagh <[email protected]>**20080703154732]
156[Fix warnings in directory
157Ian Lynagh <[email protected]>**20080620011318]
158[Make currentDirectory001 not conflict with other tests running in parallel
159Ian Lynagh <[email protected]>**20080611180844]
160[TAG 2008-05-28
161Ian Lynagh <[email protected]>**20080528004320]
162Patch bundle hash:
163626857ca56dea612d6f1d4e60380026cb0ad207b