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
abuild
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Merge Requests
16
Merge Requests
16
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
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
abuild
Commits
237528a2
Commit
237528a2
authored
Nov 07, 2008
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement recursive build and install
note that the package release now include -r again.
parent
56741bed
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
17 deletions
+39
-17
abuild
abuild
+39
-17
No files found.
abuild
View file @
237528a2
...
...
@@ -23,8 +23,7 @@ pkgrel=0
SRCDEST
=
${
SRCDEST
:-
$startdir
}
PKGDEST
=
${
PKGDEST
:-
$startdir
}
default_cmds
=
"sanitycheck makedepcheck clean fetch md5check unpack rootpkg"
all_cmds
=
"checksum fetch unpack rootpkg build package cleancache clean srcpkg"
default_cmds
=
"sanitycheck builddeps clean fetch md5check unpack rootpkg"
# functions
msg
()
{
...
...
@@ -66,18 +65,6 @@ sanitycheck() {
return
0
}
# check if we have needed packages to build this thing
makedepcheck
()
{
local
i
local
missing
=
for
i
in
$makedepends
;
do
apk_info
-e
$i
||
missing
=
"
$missing
$i
"
done
[
-z
"
$missing
"
]
&&
return
0
warning
"Missing makedepends:
$missing
"
return
1
}
md5check
()
{
if
[
-z
"
$source
"
]
;
then
return
0
...
...
@@ -203,7 +190,7 @@ package_apk() {
local
name
=
${
subpkgname
:-
$pkgname
}
[
-z
"
${
name
##* *
}
"
]
&&
die
"package name contains spaces"
local dir
=
${
subpkgdir
:-
$pkgdir
}
local
pkg
=
"
$name
-
$pkgver
-
$pkgrel
.apk"
local
pkg
=
"
$name
-
$pkgver
-
r
$pkgrel
.apk"
[
!
-d
"
$dir
"
]
&&
die
"Missing
$dir
"
cd
"
$dir
"
...
...
@@ -218,7 +205,7 @@ package_apk() {
echo
"#
$(
date
-u
)
"
>>
.PKGINFO
cat
>>
.PKGINFO
<<
EOF
pkgname =
$name
pkgver =
$pkgver
-
$pkgrel
pkgver =
$pkgver
-
r
$pkgrel
pkgdesc =
$pkgdesc
url =
$url
builddate =
$builddate
...
...
@@ -342,12 +329,46 @@ up2date() {
return
0
}
# note: this must run in a subshell
find_aport
()
{
local
i
cd
../..
for
i
in
*
/
*
/APKBUILD
;
do
.
$i
local
j
for
j
in
$pkgname
$subpackages
;
do
if
[
"
${
j
%%
:
*
}
"
=
"
$1
"
]
;
then
echo
"
$PWD
/
${
i
%/APKBUILD
}
/
$1
-
$pkgver
-r
$pkgrel
.apk"
return
0
fi
done
done
return
1
}
# recursively build and install dependencies
builddeps
()
{
local
dep pkg
for
dep
in
$depends
$makedepends
;
do
apk_info
-e
$dep
&&
continue
[
-z
"
$recursive
"
]
&&
die
"Missing dependency
$dep
. Use -r to build recursively"
# sudo apk_add $dep && continue
pkg
=
$(
find_aport
$dep
)
||
die
"failed to find dependency
$dep
"
# recursively build deps
msg
"entering
${
pkg
%/*
}
"
cd
${
pkg
%/*
}
$0
-r
||
return
1
sudo
apk_add
$pkg
done
}
usage
()
{
echo
"
$(
basename
$0
)
$myver
"
echo
"usage:
$0
[options] [cmd] ..."
echo
"Options:"
echo
" -h Show this help"
echo
" -f Force specified cmd, even if they are already done"
echo
" -r Recursively build and install dependencies (using sudo)"
echo
" -q Quiet"
echo
""
echo
"Commands:"
...
...
@@ -379,11 +400,12 @@ checksum() {
APKBUILD
=
"
${
APKBUILD
:-
./APKBUILD
}
"
while
getopts
"hfq"
opt
;
do
while
getopts
"hfq
r
"
opt
;
do
case
$opt
in
'h'
)
usage
;;
'f'
)
force
=
1
;;
'q'
)
quiet
=
1
;;
'r'
)
recursive
=
1
;;
esac
done
shift
$((
$OPTIND
-
1
))
...
...
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