Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
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
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Adélie Linux
abuild
Commits
5a9827a1
Commit
5a9827a1
authored
Nov 06, 2008
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
implement basic sanity check of APKBUILD
parent
45ff2bfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
14 deletions
+40
-14
abuild
abuild
+40
-14
No files found.
abuild
View file @
5a9827a1
...
...
@@ -23,7 +23,7 @@ pkgrel=0
SRCDEST
=
${
SRCDEST
:-
$startdir
}
PKGDEST
=
${
PKGDEST
:-
$startdir
}
default_cmds
=
"
checkdeps clean fetch checkmd5
unpack rootpkg"
default_cmds
=
"
makedepcheck clean fetch md5check
unpack rootpkg"
all_cmds
=
"checksum fetch unpack rootpkg build package cleancache clean srcpkg"
# functions
...
...
@@ -43,8 +43,27 @@ die() {
exit
1
}
# check if apkbuild is basicly sane
sanitycheck
()
{
[
-z
"
$pkgname
"
]
&&
die
"Missing pkgname in APKBUILD"
[
-z
"
${
pkgname
##* *
}
"
]
&&
die
"pkgname contains spaces"
[
-z
"
$pkgver
"
]
&&
die
"Missing pkgver in APKBUILD"
[
"
${
pkgver
##[0-9]
}
"
!=
"
$pkgver
"
]
&&
\
die
"pkgver does not start with a digit"
[
-z
"
$pkgrel
"
]
&&
warning
"Missing pkgrel in APKBUILD. Using pkgrel=0"
[
-z
"
$pkgdesc
"
]
&&
die
"Missing pkgdesc in APKBUILD"
[
-z
"
$url
"
]
&&
die
"Missing url in APKBUILD"
[
-z
"
$license
"
]
&&
die
"Missing license in APKBULID"
# common spelling errors
[
-n
"
$depend
"
]
&&
die
"APKBUILD contains 'depend'. It should be depends"
[
-n
"
$makedepend
"
]
&&
die
"APKBUILD contains 'makedepend'. It should be makedepends"
return
0
}
# check if we have needed packages to build this thing
checkdeps
()
{
makedepcheck
()
{
local
i
local
missing
=
for
i
in
$makedepends
;
do
...
...
@@ -55,13 +74,17 @@ checkdeps() {
return
1
}
checkmd5
()
{
md5check
()
{
if
[
-z
"
$source
"
]
;
then
return
0
fi
if
[
-z
"
$md5sums
"
]
;
then
die
"Use 'abuild checksum >>
$APKBUILD
' to generate a checksum"
fi
if
[
"
$(
echo
$source
|
wc
-l
)
"
-ne
"
$(
echo
$md5sums
|
wc
-l
)
"
]
;
then
die
"Number of md5sums does not correspond to number of sources"
fi
cd
"
$srcdir
"
&&
echo
"
$md5sums
"
|
md5sum
-c
}
...
...
@@ -161,6 +184,7 @@ subpkg() {
}
package_apk
()
{
[
-z
"
${
pkgname
##* *
}
"
]
&&
die
"pkgname contains spaces"
local dir
=
${
subpkgdir
:-
$pkgdir
}
local
p
=
"
$pkgname
-
$pkgver
"
[
"
$pkgrel
"
-ne
0
]
&&
p
=
"
$p
-r
$pkgrel
"
...
...
@@ -325,17 +349,19 @@ usage() {
echo
" -q Quiet"
echo
""
echo
"Commands:"
echo
" checksum Generate checksum to be included in
$APKBUILD
"
echo
" fetch Fetch sources to
\$
SRCDEST and verify checksums"
echo
" unpack Unpack sources to
\$
srcdir"
echo
" build Compile and install package into
\$
pkgdir"
echo
" package Create package in
\$
PKGDEST"
echo
" rootpkg Run '
$0
build package' as fakeroot"
echo
" clean Remove temp build and install dirs"
echo
" cleanpkg Remove already built binary and source package"
echo
" cleancache Remove downloaded files from
\$
SRCDEST"
echo
" srcpkg Make a source package"
echo
" up2date Compare target and sources dates"
echo
" checksum Generate checksum to be included in
$APKBUILD
"
echo
" fetch Fetch sources to
\$
SRCDEST and verify checksums"
echo
" sanitycheck Basic sanity check of APKBUILD"
echo
" md5check Check md5sums"
echo
" unpack Unpack sources to
\$
srcdir"
echo
" build Compile and install package into
\$
pkgdir"
echo
" package Create package in
\$
PKGDEST"
echo
" rootpkg Run '
$0
build package' as fakeroot"
echo
" clean Remove temp build and install dirs"
echo
" cleanpkg Remove already built binary and source package"
echo
" cleancache Remove downloaded files from
\$
SRCDEST"
echo
" srcpkg Make a source package"
echo
" up2date Compare target and sources dates"
echo
""
exit
0
}
...
...
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