Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup-hs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hubert Badocha
ghcup-hs
Commits
de66b926
Verified
Commit
de66b926
authored
4 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Fix upgradeGHCup
parent
fee3984b
No related branches found
Branches containing commit
Tags
0.1.0-pre
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/GHCup.hs
+8
-0
8 additions, 0 deletions
lib/GHCup.hs
with
8 additions
and
0 deletions
lib/GHCup.hs
+
8
−
0
View file @
de66b926
...
...
@@ -53,6 +53,7 @@ import Prelude hiding ( abs
)
import
System.IO.Error
import
System.Posix.FilePath
(
getSearchPath
)
import
System.Posix.Files.ByteString
import
qualified
Data.ByteString
as
B
import
qualified
Data.Map.Strict
as
Map
...
...
@@ -694,6 +695,11 @@ upgradeGHCup dls mtarget = do
tmp
<-
lift
withGHCupTmpDir
let
fn
=
[
rel
|
ghcup
|]
p
<-
liftE
$
download
dli
tmp
(
Just
fn
)
let
fileMode'
=
newFilePerms
`
unionFileModes
`
ownerExecuteMode
`
unionFileModes
`
groupExecuteMode
`
unionFileModes
`
otherExecuteMode
case
mtarget
of
Nothing
->
do
dest
<-
liftIO
$
ghcupBinDir
...
...
@@ -701,11 +707,13 @@ upgradeGHCup dls mtarget = do
handleIO
(
throwE
.
CopyError
.
show
)
$
liftIO
$
copyFile
p
(
dest
</>
fn
)
Overwrite
liftIO
$
setFileMode
(
toFilePath
(
dest
</>
fn
))
fileMode'
Just
fullDest
->
do
liftIO
$
hideError
NoSuchThing
$
deleteFile
fullDest
handleIO
(
throwE
.
CopyError
.
show
)
$
liftIO
$
copyFile
p
fullDest
Overwrite
liftIO
$
setFileMode
(
toFilePath
fullDest
)
fileMode'
pure
latestVer
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment