Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
bc32262d
Commit
bc32262d
authored
May 16, 2017
by
Zhen Zhang
Committed by
Andrey Mokhov
May 16, 2017
Browse files
Add copyFileUntracked (
#313
)
parent
4952e802
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Rules/Libffi.hs
View file @
bc32262d
...
...
@@ -39,7 +39,7 @@ configureEnvironment = do
libffiRules
::
Rules
()
libffiRules
=
do
libffiDependencies
&%>
\
_
->
do
(
libffiLibrary
:
libffiDependencies
)
&%>
\
_
->
do
useSystemFfi
<-
flag
UseSystemFfi
if
useSystemFfi
then
do
...
...
@@ -57,7 +57,7 @@ libffiRules = do
ways
<-
interpretInContext
libffiContext
(
getLibraryWays
<>
getRtsWays
)
forM_
(
nubOrd
ways
)
$
\
way
->
copyFile
libffiLibrary
=<<
rtsLibffiLibrary
way
copyFile
Untracked
libffiLibrary
=<<
rtsLibffiLibrary
way
putSuccess
$
"| Successfully built custom library 'libffi'"
...
...
src/Util.hs
View file @
bc32262d
...
...
@@ -3,7 +3,7 @@ module Util (
removeFile
,
copyDirectory
,
copyDirectoryContents
,
createDirectory
,
moveDirectory
,
removeDirectory
,
applyPatch
,
runBuilder
,
runBuilderWith
,
makeExecutable
,
renderProgram
,
renderLibrary
,
Match
(
..
),
builderEnvironment
,
needBuilder
needBuilder
,
copyFileUntracked
)
where
import
qualified
System.Directory.Extra
as
IO
...
...
@@ -94,10 +94,18 @@ copyFile :: FilePath -> FilePath -> Action ()
copyFile
source
target
=
do
need
[
source
]
-- Guarantee source is built before printing progress info.
let
dir
=
takeDirectory
target
unlessM
(
liftIO
$
IO
.
does
Directory
Exist
dir
)
$
createDirectory
dir
liftIO
$
IO
.
create
Directory
IfMissing
True
dir
putProgressInfo
$
renderAction
"Copy file"
source
target
copyFileChanged
source
target
-- Same as copyFile, but not tracking the source as a build dependency
copyFileUntracked
::
FilePath
->
FilePath
->
Action
()
copyFileUntracked
source
target
=
do
let
dir
=
takeDirectory
target
liftIO
$
IO
.
createDirectoryIfMissing
True
dir
putProgressInfo
$
renderAction
"Copy file (Untracked)"
source
target
liftIO
$
IO
.
copyFile
source
target
-- | Move a file; we cannot track the source, because it is moved.
moveFile
::
FilePath
->
FilePath
->
Action
()
moveFile
source
target
=
do
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment