Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
alpine-conf
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
18
Issues
18
List
Boards
Labels
Service Desk
Milestones
Merge Requests
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alpine
alpine-conf
Commits
b4ddb7ef
Commit
b4ddb7ef
authored
Apr 23, 2014
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
setup-apkcache: add support for $ROOT
parent
651f5f32
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
9 deletions
+13
-9
setup-apkcache.in
setup-apkcache.in
+13
-9
No files found.
setup-apkcache.in
View file @
b4ddb7ef
...
...
@@ -13,7 +13,7 @@ Setup apk caching.
If DIR is not specified user will be asked for location.
options:
-h Show this help
-h Show this help
__EOF__
exit
1
}
...
...
@@ -25,8 +25,11 @@ is_mounted() {
find_fstab_mount_point
()
{
local dir
=
"
$1
"
local
res
=
if
!
[
-r
"
${
ROOT
}
"
etc/fstab
]
;
then
return
fi
while
[
-n
"
$dir
"
]
;
do
res
=
$(
awk
"
\$
2 ==
\"
$dir
\"
{print
\$
2}"
/
etc/fstab
)
res
=
$(
awk
"
\$
2 ==
\"
$dir
\"
{print
\$
2}"
"
${
ROOT
}
"
etc/fstab
)
if
[
-n
"
$res
"
]
;
then
echo
$res
return
...
...
@@ -102,12 +105,12 @@ shift $(( $OPTIND - 1 ))
# try auto detetect what we suggest
suggestion
=
if
[
-L
/
etc/apk/cache
]
;
then
suggestion
=
$(
readlink
/
etc/apk/cache
)
if
[
-L
"
${
ROOT
}
"
etc/apk/cache
]
;
then
suggestion
=
$(
readlink
"
${
ROOT
}
"
etc/apk/cache
)
fi
if
[
-z
"
$suggestion
"
]
&&
[
-f
/
etc/lbu/lbu.conf
]
;
then
.
/
etc/lbu/lbu.conf
if
[
-z
"
$suggestion
"
]
&&
[
-f
"
${
ROOT
}
"
etc/lbu/lbu.conf
]
;
then
.
"
${
ROOT
}
"
etc/lbu/lbu.conf
if
[
-n
"
$LBU_MEDIA
"
]
;
then
suggestion
=
/media/
$LBU_MEDIA
/cache
fi
...
...
@@ -152,10 +155,11 @@ elif is_mounted_ro $mount; then
fi
mkdir
-p
$cachedir
if
[
-L
/
etc/apk/cache
]
;
then
rm
-f
/
etc/apk/cache
if
[
-L
"
${
ROOT
}
"
etc/apk/cache
]
;
then
rm
-f
"
${
ROOT
}
"
etc/apk/cache
fi
ln
-s
$cachedir
/etc/apk/cache
mkdir
-p
"
${
ROOT
}
"
etc/apk
ln
-s
$cachedir
"
${
ROOT
}
"
etc/apk/cache
case
"
$cleanup
"
in
umount
)
umount
$mount
;;
...
...
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