File tree 8 files changed +44
-7
lines changed
cabal-testsuite/PackageTests/Regression/T6125
8 files changed +44
-7
lines changed Original file line number Diff line number Diff line change 34
34
* Uniformly provide 'Semigroup' instances for ` base < 4.9 ` via ` semigroups ` package
35
35
* Setting ` debug-info ` now implies ` library-stripping: False ` and
36
36
`executable-stripping: False) ([ #2702 ] ( https://github.com/haskell/cabal/issues/2702 ) )
37
+ * ` Setup.hs copy ` and ` install ` now work in the presence of
38
+ ` data-files ` that use ` ** ` syntax
39
+ ([ #6125 ] ( https://github.com/haskell/cabal/issues/6125 ) ).
37
40
38
41
----
39
42
Original file line number Diff line number Diff line change @@ -223,17 +223,17 @@ copyComponent _ _ _ (CTest _) _ _ = return ()
223
223
--
224
224
installDataFiles :: Verbosity -> PackageDescription -> FilePath -> IO ()
225
225
installDataFiles verbosity pkg_descr destDataDir =
226
- flip traverse_ (dataFiles pkg_descr) $ \ file -> do
226
+ flip traverse_ (dataFiles pkg_descr) $ \ glob -> do
227
227
let srcDataDirRaw = dataDir pkg_descr
228
228
srcDataDir = if null srcDataDirRaw
229
229
then " ."
230
230
else srcDataDirRaw
231
- files <- matchDirFileGlob verbosity (specVersion pkg_descr) srcDataDir file
232
- let dir = takeDirectory file
233
- createDirectoryIfMissingVerbose verbosity True (destDataDir </> dir)
234
- sequence_ [ installOrdinaryFile verbosity (srcDataDir </> file')
235
- (destDataDir </> file' )
236
- | file' <- files ]
231
+ files <- matchDirFileGlob verbosity (specVersion pkg_descr) srcDataDir glob
232
+ for_ files $ \ file' -> do
233
+ let src = srcDataDir </> file'
234
+ dst = destDataDir </> file'
235
+ createDirectoryIfMissingVerbose verbosity True (takeDirectory dst )
236
+ installOrdinaryFile verbosity src dst
237
237
238
238
-- | Install the files listed in install-includes for a library
239
239
--
Original file line number Diff line number Diff line change
1
+ main = return ()
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html> Some random data.
Original file line number Diff line number Diff line change
1
+ cabal-version : 2.4
2
+ name : myprog
3
+ version : 0
4
+ data-files : data/**/*.html
5
+
6
+ executable myprog
7
+ build-depends : base
8
+ main-is : Main.hs
9
+ default-language : Haskell2010
Original file line number Diff line number Diff line change
1
+ # Setup configure
2
+ Resolving dependencies...
3
+ Configuring myprog-0...
4
+ # Setup build
5
+ Preprocessing executable 'myprog' for myprog-0..
6
+ Building executable 'myprog' for myprog-0..
7
+ # Setup copy
8
+ Installing executable myprog in <PATH>
9
+ Warning: The directory <ROOT>/setup.cabal.dist/usr/bin is not in the system search path.
Original file line number Diff line number Diff line change
1
+ # Setup configure
2
+ Configuring myprog-0...
3
+ # Setup build
4
+ Preprocessing executable 'myprog' for myprog-0..
5
+ Building executable 'myprog' for myprog-0..
6
+ # Setup copy
7
+ Installing executable myprog in <PATH>
8
+ Warning: The directory <ROOT>/setup.dist/usr/bin is not in the system search path.
Original file line number Diff line number Diff line change
1
+ import Test.Cabal.Prelude
2
+ main = setupAndCabalTest $ do
3
+ withPackageDb $ do
4
+ setup " configure" []
5
+ setup " build" [" myprog" ]
6
+ setup " copy" [" myprog" ]
You can’t perform that action at this time.
0 commit comments