Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
ghcup
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Haskell
ghcup
Commits
4f345d10
Verified
Commit
4f345d10
authored
5 years ago
by
Julian Ospald
Browse files
Options
Downloads
Patches
Plain Diff
Change implementation of mktempdir
parent
28c8c445
Branches
jospald/mktempdir
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!126
mktempdir
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghcup
+10
-9
10 additions, 9 deletions
ghcup
with
10 additions
and
9 deletions
ghcup
+
10
−
9
View file @
4f345d10
...
@@ -1022,16 +1022,15 @@ download_to_stdout() {
...
@@ -1022,16 +1022,15 @@ download_to_stdout() {
# @FUNCTION: mktempdir
# @FUNCTION: mktempdir
# @DESCRIPTION:
# @DESCRIPTION:
# Makes a temporary directory
, placing the path in $tmp_dir
.
# Makes a temporary directory.
mktempdir
()
{
mktempdir
()
{
if
test
"
${
mydistro
}
"
=
"darwin"
;
then
if
test
"
${
mydistro
}
"
=
"darwin"
;
then
debug_message
"mktemp -d -t ghcup"
debug_message
"mktemp -d -t ghcup"
tmp_dir
=
$(
mktemp
-d
-t
ghcup
)
mktemp
-d
-t
ghcup
else
else
debug_message
"mktemp -d"
debug_message
"mktemp -d"
tmp_dir
=
$(
mktemp
-d
)
mktemp
-d
fi
fi
[
-z
"
${
tmp_dir
}
"
]
&&
die
"Failed to create temporary directory"
}
}
# @FUNCTION: unpack
# @FUNCTION: unpack
...
@@ -1428,7 +1427,8 @@ install_ghc() {
...
@@ -1428,7 +1427,8 @@ install_ghc() {
first_install
=
false
first_install
=
false
fi
fi
mktempdir
tmp_dir
=
$(
mktempdir
)
{
[
-z
"
${
tmp_dir
}
"
]
||
!
[
-d
"
${
tmp_dir
}
"
]
;
}
&&
die
"Failed to create temporary directory"
(
(
if
${
CACHING
}
;
then
if
${
CACHING
}
;
then
if
[
!
-f
"
${
CACHE_LOCATION
}
/
${
download_tarball_name
}
"
]
;
then
if
[
!
-f
"
${
CACHE_LOCATION
}
/
${
download_tarball_name
}
"
]
;
then
...
@@ -1567,8 +1567,7 @@ upgrade() {
...
@@ -1567,8 +1567,7 @@ upgrade() {
status_message
"Updating
${
SCRIPT
}
"
status_message
"Updating
${
SCRIPT
}
"
(
(
mktempdir
edo
cd
"
$(
mktempdir
)
"
edo
cd
"
${
tmp_dir
}
"
download
"
${
SCRIPT_UPDATE_URL
}
"
download
"
${
SCRIPT_UPDATE_URL
}
"
edo
chmod
+x ghcup
edo
chmod
+x ghcup
edo
mv
-f
ghcup
"
${
target_location
}
"
/ghcup
edo
mv
-f
ghcup
"
${
target_location
}
"
/ghcup
...
@@ -1693,7 +1692,8 @@ install_cabal() {
...
@@ -1693,7 +1692,8 @@ install_cabal() {
edo
mkdir
-p
"
${
inst_location
}
"
edo
mkdir
-p
"
${
inst_location
}
"
mktempdir
tmp_dir
=
$(
mktempdir
)
{
[
-z
"
${
tmp_dir
}
"
]
||
!
[
-d
"
${
tmp_dir
}
"
]
;
}
&&
die
"Failed to create temporary directory"
(
(
if
${
CACHING
}
;
then
if
${
CACHING
}
;
then
if
[
!
-f
"
${
CACHE_LOCATION
}
/
${
download_tarball_name
}
"
]
;
then
if
[
!
-f
"
${
CACHE_LOCATION
}
/
${
download_tarball_name
}
"
]
;
then
...
@@ -1754,7 +1754,8 @@ compile_ghc() {
...
@@ -1754,7 +1754,8 @@ compile_ghc() {
fi
fi
status_message
"Compiling GHC for version
${
myghcver
}
from source"
status_message
"Compiling GHC for version
${
myghcver
}
from source"
mktempdir
tmp_dir
=
$(
mktempdir
)
{
[
-z
"
${
tmp_dir
}
"
]
||
!
[
-d
"
${
tmp_dir
}
"
]
;
}
&&
die
"Failed to create temporary directory"
(
(
if
${
CACHING
}
;
then
if
${
CACHING
}
;
then
if
[
!
-f
"
${
CACHE_LOCATION
}
/
${
download_tarball_name
}
"
]
;
then
if
[
!
-f
"
${
CACHE_LOCATION
}
/
${
download_tarball_name
}
"
]
;
then
...
...
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