Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
T C
mkinitcpio
Commits
143a5c73
Commit
143a5c73
authored
Nov 26, 2022
by
T C
Browse files
symlinks in add_file: Use mode from argument, fix link creation
parent
21c32fd3
Pipeline
#40413
failed with stage
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
functions
View file @
143a5c73
...
...
@@ -591,10 +591,12 @@ add_symlink() {
if
[[
-z
"
$target
"
||
"
$name
"
==
"
$target
"
]]
;
then
target
=
"
$(
find
"
$name
"
-prune
-printf
'%l'
)
"
if
[[
-z
$target
]]
;
then
error
'invalid symlink: %s'
"
$name
"
return
1
fi
elif
[[
-L
"
$target
"
]]
;
then
target
=
"
$(
realpath
-eq
--
"
$target
"
)
"
fi
if
[[
-z
"
$target
"
]]
;
then
error
'invalid symlink: %s'
"
$name
"
return
1
fi
add_dir
"
${
name
%/*
}
"
...
...
@@ -641,11 +643,11 @@ add_file() {
if
[[
-L
"
$src
"
]]
;
then
# add the file
srcrealpath
=
"
$(
realpath
--
"
$src
"
)
"
mode
=
"
$(
stat
-c
%a
--
"
$srcrealpath
"
)
"
mode
=
"
$
{
3
:-
$
(
stat
-c
%a
--
"
$srcrealpath
"
)
}
"
add_file
"
$srcrealpath
"
"
$srcrealpath
"
"
$mode
"
[[
-d
"
${
BUILDROOT
}${
dest
%/*
}
"
]]
||
install
-d
--
"
${
BUILDROOT
}${
dest
%/*
}
"
# create the symlink
add_symlink
"
$
src
"
"
$dest
"
add_symlink
"
$
dest
"
"
$src
"
else
command install
-Dm
$mode
"
$src
"
"
$BUILDROOT$dest
"
fi
...
...
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