Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
69ded881
Commit
69ded881
authored
Feb 04, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Treat symlinks as new files
parent
d9bce45d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
magic_mask.sh
scripts/magic_mask.sh
+8
-5
No files found.
scripts/magic_mask.sh
View file @
69ded881
...
...
@@ -95,10 +95,12 @@ travel() {
mktouch
"
$MOUNTINFO
/
$1
"
"
$TRAVEL_ROOT
"
else
for
ITEM
in
*
;
do
if
[
!
-e
"/
$1
/
$ITEM
"
]
;
then
# New item found
# This means it an empty folder (shouldn't happen, but better to be safe)
[
"
$ITEM
"
=
"*"
]
&&
return
;
# Target not found or target/file is a symlink
if
[
!
-e
"/
$1
/
$ITEM
"
-o
-L
"/
$1
/
$ITEM
"
-o
-L
"
$ITEM
"
]
;
then
# If we are in a higher level, delete the lower levels
rm
-rf
"
$MOUNTINFO
/dummy/
$1
"
rm
-rf
"
$MOUNTINFO
/dummy/
$1
"
2>/dev/null
# Mount the dummy parent
mktouch
"
$MOUNTINFO
/dummy/
$1
"
...
...
@@ -107,7 +109,7 @@ travel() {
mkdir
-p
"
$DUMMDIR
/
$1
/
$ITEM
"
mktouch
"
$MOUNTINFO
/
$1
/
$ITEM
"
"
$TRAVEL_ROOT
"
elif
[
-L
"
$ITEM
"
]
;
then
#
Symlinks are small, copy them
#
Copy symlinks
mkdir
-p
"
$DUMMDIR
/
$1
"
2>/dev/null
cp
-afc
"
$ITEM
"
$"DUMMDIR/
$1
/
$ITEM
"
else
...
...
@@ -138,7 +140,8 @@ clone_dummy() {
# Need to clone deeper
mkdir
-p
"
$DUMMDIR$REAL
"
(
clone_dummy
"
$REAL
"
)
else
elif
[
!
-f
"
$DUMMDIR$REAL
"
]
;
then
# It's not the file to be added/replaced, clone it
if
[
-L
"
$ITEM
"
]
;
then
# Copy original symlink
cp
-afc
"
$ITEM
"
"
$DUMMDIR$REAL
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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