Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
abuild
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
alpine
abuild
Commits
c6263bae
Commit
c6263bae
authored
13 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
abuild: remove dependency of sudo
use the abuild-sudo tool instead fixes #951
parent
442e8042
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
abuild.in
+14
-12
14 additions, 12 deletions
abuild.in
with
14 additions
and
12 deletions
abuild.in
+
14
−
12
View file @
c6263bae
...
@@ -18,9 +18,12 @@ abuild_path=$(readlink -f $0)
...
@@ -18,9 +18,12 @@ abuild_path=$(readlink -f $0)
# defaults
# defaults
BUILD_BASE
=
"build-base"
BUILD_BASE
=
"build-base"
SUDO
=
${
SUDO
:-
"sudo"
}
FAKEROOT
=
${
FAKEROOT
:-
"fakeroot"
}
FAKEROOT
=
${
FAKEROOT
:-
"fakeroot"
}
APK
=
${
APK
:-
apk
}
:
${
APK
:
=abuild-apk
}
:
${
ADDUSER
:
=abuild-adduser
}
:
${
ADDGROUP
:
=abuild-addgroup
}
apk_opt_wait
=
"--wait 30"
apk_opt_wait
=
"--wait 30"
# read config
# read config
...
@@ -100,7 +103,7 @@ cleanup() {
...
@@ -100,7 +103,7 @@ cleanup() {
set_xterm_title
""
set_xterm_title
""
if
[
-z
"
$install_after
"
]
&&
[
-n
"
$uninstall_after
"
]
;
then
if
[
-z
"
$install_after
"
]
&&
[
-n
"
$uninstall_after
"
]
;
then
msg
"Uninstalling dependencies..."
msg
"Uninstalling dependencies..."
$SUDO
$APK
del
--quiet
$apk_opt_wait
$uninstall_after
$APK
del
--quiet
$apk_opt_wait
$uninstall_after
fi
fi
if
[
-n
"
$CLEANUP_FILES
"
]
;
then
if
[
-n
"
$CLEANUP_FILES
"
]
;
then
rm
-f
$CLEANUP_FILES
rm
-f
$CLEANUP_FILES
...
@@ -485,13 +488,13 @@ mkusers() {
...
@@ -485,13 +488,13 @@ mkusers() {
if
getent group
$i
>
/dev/null
;
then
if
getent group
$i
>
/dev/null
;
then
gopt
=
"-G
$i
"
gopt
=
"-G
$i
"
fi
fi
$
SUDO
adduser
-S
-D
-H
$gopt
$i
||
return
1
$
ADDUSER
-S
-D
-H
$gopt
$i
||
return
1
fi
fi
done
done
for
i
in
$pkggroups
;
do
for
i
in
$pkggroups
;
do
if
!
getent group
$i
>
/dev/null
;
then
if
!
getent group
$i
>
/dev/null
;
then
msg
"Creating group
$i
"
msg
"Creating group
$i
"
$
SUDO
addgroup
-S
$i
||
return
1
$
ADDGROUP
-S
$i
||
return
1
fi
fi
done
done
}
}
...
@@ -1289,10 +1292,10 @@ builddeps() {
...
@@ -1289,10 +1292,10 @@ builddeps() {
if
[
-n
"
$install_deps
"
]
&&
[
-z
"
$recursive
"
]
&&
[
-n
"
$deps
"
]
;
then
if
[
-n
"
$install_deps
"
]
&&
[
-z
"
$recursive
"
]
&&
[
-n
"
$deps
"
]
;
then
# make a --simluate run first to detect missing deps
# make a --simluate run first to detect missing deps
# apk-tools --virtual is no goot at reporting those.
# apk-tools --virtual is no goot at reporting those.
$SUDO
$APK
add
--repository
"
$abuildrepo
"
\
$APK
add
--repository
"
$abuildrepo
"
\
$apk_opt_wait
\
$apk_opt_wait
\
--simulate
--quiet
$deps
||
return
1
--simulate
--quiet
$deps
||
return
1
$SUDO
$APK
add
--repository
"
$abuildrepo
"
\
$APK
add
--repository
"
$abuildrepo
"
\
$apk_opt_wait
\
$apk_opt_wait
\
--virtual
.makedepends-
$pkgname
$deps
\
--virtual
.makedepends-
$pkgname
$deps
\
&&
return
0
&&
return
0
...
@@ -1324,7 +1327,7 @@ builddeps() {
...
@@ -1324,7 +1327,7 @@ builddeps() {
cd
"
$dir
"
&&
$0
$forceroot
$keep
$quiet
$install_deps
\
cd
"
$dir
"
&&
$0
$forceroot
$keep
$quiet
$install_deps
\
$recursive
$upgrade
$color_opt
abuildindex
||
return
1
$recursive
$upgrade
$color_opt
abuildindex
||
return
1
done
done
$SUDO
$APK
add
-u
--repository
"
$abuildrepo
"
\
$APK
add
-u
--repository
"
$abuildrepo
"
\
$apk_opt_wait
\
$apk_opt_wait
\
--virtual
.makedepends-
$pkgname
$deps
--virtual
.makedepends-
$pkgname
$deps
}
}
...
@@ -1439,18 +1442,18 @@ post_add() {
...
@@ -1439,18 +1442,18 @@ post_add() {
post_add
$i
||
return
1
post_add
$i
||
return
1
fi
fi
done
done
$SUDO
$APK
add
$apk_opt_wait
-u
"
$pkgf
"
||
die
"Failed to install
$1
"
$APK
add
$apk_opt_wait
-u
"
$pkgf
"
||
die
"Failed to install
$1
"
}
}
installdeps
()
{
installdeps
()
{
local
deps i
local
deps i
$SUDO
$APK
add
$apk_opt_wait
--repository
"
$abuildrepo
"
\
$APK
add
$apk_opt_wait
--repository
"
$abuildrepo
"
\
--virtual
.makedepends-
$pkgname
\
--virtual
.makedepends-
$pkgname
\
$makedepends
$makedepends
}
}
uninstalldeps
(){
uninstalldeps
(){
$SUDO
$APK
del
$apk_opt_wait
.makedepends-
$pkgname
$APK
del
$apk_opt_wait
.makedepends-
$pkgname
}
}
all
()
{
all
()
{
...
@@ -1540,7 +1543,6 @@ shift $(( $OPTIND - 1 ))
...
@@ -1540,7 +1543,6 @@ shift $(( $OPTIND - 1 ))
# check so we are not root
# check so we are not root
if
[
"
$(
whoami
)
"
=
"root"
]
&&
[
-z
"
$FAKEROOTKEY
"
]
;
then
if
[
"
$(
whoami
)
"
=
"root"
]
&&
[
-z
"
$FAKEROOTKEY
"
]
;
then
[
-z
"
$forceroot
"
]
&&
die
"Do not run abuild as root"
[
-z
"
$forceroot
"
]
&&
die
"Do not run abuild as root"
SUDO
=
FAKEROOT
=
FAKEROOT
=
fi
fi
...
...
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