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
d1b6da64
Commit
d1b6da64
authored
Jul 02, 2013
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abuild: whitespace fixes. use longopts for apk
parent
60eb0dc8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
31 deletions
+32
-31
abuild.in
abuild.in
+32
-31
No files found.
abuild.in
View file @
d1b6da64
...
@@ -83,7 +83,7 @@ warning() {
...
@@ -83,7 +83,7 @@ warning() {
}
}
warning2
()
{
warning2
()
{
# ">>> WARNING:
# ">>> WARNING:
printf
" %s
\n
"
"
$1
"
>
&2
printf
" %s
\n
"
"
$1
"
>
&2
}
}
...
@@ -96,7 +96,7 @@ error() {
...
@@ -96,7 +96,7 @@ error() {
}
}
error2
()
{
error2
()
{
# ">>> ERROR:
# ">>> ERROR:
printf
" %s
\n
"
"
$1
"
>
&2
printf
" %s
\n
"
"
$1
"
>
&2
}
}
...
@@ -104,7 +104,7 @@ set_xterm_title() {
...
@@ -104,7 +104,7 @@ set_xterm_title() {
if
[
"
$TERM
"
=
xterm
]
&&
[
-n
"
$USE_COLORS
"
]
;
then
if
[
"
$TERM
"
=
xterm
]
&&
[
-n
"
$USE_COLORS
"
]
;
then
printf
"
\0
33]0;
$1
\0
07"
>
&2
printf
"
\0
33]0;
$1
\0
07"
>
&2
fi
fi
}
}
cleanup
()
{
cleanup
()
{
set_xterm_title
""
set_xterm_title
""
...
@@ -135,7 +135,7 @@ default_sanitycheck() {
...
@@ -135,7 +135,7 @@ default_sanitycheck() {
[
-z
"
${
pkgname
##* *
}
"
]
&&
die
"pkgname contains spaces"
[
-z
"
${
pkgname
##* *
}
"
]
&&
die
"pkgname contains spaces"
[
-z
"
$pkgver
"
]
&&
die
"Missing pkgver in APKBUILD"
[
-z
"
$pkgver
"
]
&&
die
"Missing pkgver in APKBUILD"
if
[
"
$pkgver
"
!=
"volatile"
]
&&
[
-z
"
$nodeps
"
]
;
then
if
[
"
$pkgver
"
!=
"volatile"
]
&&
[
-z
"
$nodeps
"
]
;
then
$APK
version
--check
-
q
"
$pkgver
"
||
\
$APK
version
--check
-
-quiet
"
$pkgver
"
||
\
die
"
$pkgver
is not a valid version"
die
"
$pkgver
is not a valid version"
fi
fi
[
-z
"
$pkgrel
"
]
&&
die
"Missing pkgrel in APKBUILD"
[
-z
"
$pkgrel
"
]
&&
die
"Missing pkgrel in APKBUILD"
...
@@ -189,7 +189,7 @@ default_sanitycheck() {
...
@@ -189,7 +189,7 @@ default_sanitycheck() {
for
i
in
$triggers
;
do
for
i
in
$triggers
;
do
local
f
=
${
i
%=*
}
local
f
=
${
i
%=*
}
local
p
=
${
f
%.trigger
}
local
p
=
${
f
%.trigger
}
[
"
$f
"
=
"
$i
"
]
&&
die
"
$f
: triggers must contain '='"
[
"
$f
"
=
"
$i
"
]
&&
die
"
$f
: triggers must contain '='"
[
"
$p
"
=
"
$f
"
]
&&
die
"
$f
: triggers scripts must have .trigger suffix"
[
"
$p
"
=
"
$f
"
]
&&
die
"
$f
: triggers scripts must have .trigger suffix"
if
!
subpackages_has
"
$p
"
&&
[
"
$p
"
!=
"
$pkgname
"
]
;
then
if
!
subpackages_has
"
$p
"
&&
[
"
$p
"
!=
"
$pkgname
"
]
;
then
die
"
$p
: trigger script does not match pkgname or any subpackage"
die
"
$p
: trigger script does not match pkgname or any subpackage"
...
@@ -431,7 +431,7 @@ default_fetch() {
...
@@ -431,7 +431,7 @@ default_fetch() {
if
is_remote
"
$s
"
;
then
if
is_remote
"
$s
"
;
then
uri_fetch_mirror
"
$s
"
||
return
1
uri_fetch_mirror
"
$s
"
||
return
1
ln
-sf
"
$SRCDEST
/
$(
filename_from_uri
$s
)
"
"
$srcdir
"
/
ln
-sf
"
$SRCDEST
/
$(
filename_from_uri
$s
)
"
"
$srcdir
"
/
else
else
ln
-sf
"
$startdir
/
$s
"
"
$srcdir
/"
ln
-sf
"
$startdir
/
$s
"
"
$srcdir
/"
fi
fi
done
done
...
@@ -453,7 +453,7 @@ initdcheck() {
...
@@ -453,7 +453,7 @@ initdcheck() {
return
1
return
1
;;
;;
esac
esac
done
done
}
}
# unpack the sources
# unpack the sources
...
@@ -637,7 +637,7 @@ postcheck() {
...
@@ -637,7 +637,7 @@ postcheck() {
warning
"World writeable directories found:"
warning
"World writeable directories found:"
echo
"
$i
"
echo
"
$i
"
fi
fi
# check so we dont have any suid root binaries that are not
# check so we dont have any suid root binaries that are not
i
=
$(
find
"
$dir
"
-type
f
-perm
+6000
\
i
=
$(
find
"
$dir
"
-type
f
-perm
+6000
\
| xargs scanelf
--nobanner
--etype
ET_EXEC
\
| xargs scanelf
--nobanner
--etype
ET_EXEC
\
|
sed
"s|ET_EXEC
$dir
|
\t
|"
)
|
sed
"s|ET_EXEC
$dir
|
\t
|"
)
...
@@ -749,7 +749,7 @@ prepare_metafiles() {
...
@@ -749,7 +749,7 @@ prepare_metafiles() {
local
pkg
=
"
$name
-
$pkgver
-r
$pkgrel
.apk"
local
pkg
=
"
$name
-
$pkgver
-r
$pkgrel
.apk"
local
pkginfo
=
"
$controldir
"
/.PKGINFO
local
pkginfo
=
"
$controldir
"
/.PKGINFO
local
sub
local
sub
[
!
-d
"
$dir
"
]
&&
die
"Missing
$dir
"
[
!
-d
"
$dir
"
]
&&
die
"Missing
$dir
"
cd
"
$dir
"
cd
"
$dir
"
mkdir
-p
"
$controldir
"
mkdir
-p
"
$controldir
"
...
@@ -791,7 +791,7 @@ EOF
...
@@ -791,7 +791,7 @@ EOF
fi
fi
done
done
fi
fi
local
last_commit
=
"
$(
git_last_commit
)$(
git_dirty
)
"
local
last_commit
=
"
$(
git_last_commit
)$(
git_dirty
)
"
if
[
-n
"
$last_commit
"
]
;
then
if
[
-n
"
$last_commit
"
]
;
then
echo
"commit =
$last_commit
"
>>
"
$pkginfo
"
echo
"commit =
$last_commit
"
>>
"
$pkginfo
"
...
@@ -900,7 +900,7 @@ prepare_package() {
...
@@ -900,7 +900,7 @@ prepare_package() {
msg
"Preparing
${
subpkgname
:+sub
}
package
${
subpkgname
:-
$pkgname
}
..."
msg
"Preparing
${
subpkgname
:+sub
}
package
${
subpkgname
:-
$pkgname
}
..."
stripbin
stripbin
prepare_metafiles
&&
prepare_tracedeps
||
return
1
prepare_metafiles
&&
prepare_tracedeps
||
return
1
archcheck
archcheck
}
}
pkginfo_val
()
{
pkginfo_val
()
{
...
@@ -970,7 +970,7 @@ trace_apk_deps() {
...
@@ -970,7 +970,7 @@ trace_apk_deps() {
if
[
-f
"
$dir
"
/.rpaths
]
;
then
if
[
-f
"
$dir
"
/.rpaths
]
;
then
local
so_files
=
$(
find_so_files
"
$dir
"
/.rpaths
$missing
)
\
local
so_files
=
$(
find_so_files
"
$dir
"
/.rpaths
$missing
)
\
||
return
1
||
return
1
deppkgs
=
$(
$APK
info
-
q
-W
$so_files
)
||
return
1
deppkgs
=
$(
$APK
info
-
-quiet
--who-owns
$so_files
)
||
return
1
fi
fi
for
found
in
$deppkgs
;
do
for
found
in
$deppkgs
;
do
...
@@ -1146,7 +1146,7 @@ create_apks() {
...
@@ -1146,7 +1146,7 @@ create_apks() {
clean_abuildrepo
()
{
clean_abuildrepo
()
{
local
apk
local
apk
cd
"
$abuildrepo
"
||
return
1
cd
"
$abuildrepo
"
||
return
1
# remove compat symlink
# remove compat symlink
for
d
in
"
$abuildrepo
/
$CARCH
"
;
do
for
d
in
"
$abuildrepo
/
$CARCH
"
;
do
[
-L
"
$d
"
]
&&
rm
"
$d
"
[
-L
"
$d
"
]
&&
rm
"
$d
"
...
@@ -1182,7 +1182,7 @@ build_abuildrepo() {
...
@@ -1182,7 +1182,7 @@ build_abuildrepo() {
update_abuildrepo_index
update_abuildrepo_index
}
}
update_abuildrepo_index
()
{
update_abuildrepo_index
()
{
clean_abuildrepo
clean_abuildrepo
mklinks_abuildrepo
mklinks_abuildrepo
...
@@ -1218,7 +1218,7 @@ default_doc() {
...
@@ -1218,7 +1218,7 @@ default_doc() {
mv
"
$pkgdir
/usr/share/
$i
"
"
$subpkgdir
/usr/share/"
mv
"
$pkgdir
/usr/share/
$i
"
"
$subpkgdir
/usr/share/"
fi
fi
done
done
rm
-f
"
$subpkgdir
/usr/share/info/dir"
rm
-f
"
$subpkgdir
/usr/share/info/dir"
# remove if empty, ignore error (not empty)
# remove if empty, ignore error (not empty)
...
@@ -1240,7 +1240,7 @@ default_dev() {
...
@@ -1240,7 +1240,7 @@ default_dev() {
for
i
in
$origsubpackages
;
do
for
i
in
$origsubpackages
;
do
[
"
${
i
%
:
*
}
"
=
"
$subpkgname
"
]
||
depends
=
"
$depends
${
i
%
:
*
}
"
[
"
${
i
%
:
*
}
"
=
"
$subpkgname
"
]
||
depends
=
"
$depends
${
i
%
:
*
}
"
done
done
cd
"
$pkgdir
"
||
return
0
cd
"
$pkgdir
"
||
return
0
for
i
in
usr/include usr/lib/pkgconfig usr/share/aclocal
\
for
i
in
usr/include usr/lib/pkgconfig usr/share/aclocal
\
usr/share/gettext usr/bin/
*
-config
\
usr/share/gettext usr/bin/
*
-config
\
...
@@ -1325,7 +1325,7 @@ srcpkg() {
...
@@ -1325,7 +1325,7 @@ srcpkg() {
done
done
mkdir
-p
"
$PKGDEST
"
mkdir
-p
"
$PKGDEST
"
msg
"Creating source package
$p
.src.tar.gz..."
msg
"Creating source package
$p
.src.tar.gz..."
(
cd
..
&&
tar
-zcf
"
$PKGDEST
/
$p
.src.tar.gz"
$files
)
(
cd
..
&&
tar
-zcf
"
$PKGDEST
/
$p
.src.tar.gz"
$files
)
}
}
# return true if arch is supported or noarch
# return true if arch is supported or noarch
...
@@ -1368,13 +1368,13 @@ abuildindex_up2date() {
...
@@ -1368,13 +1368,13 @@ abuildindex_up2date() {
# check if index is missing
# check if index is missing
[
-f
"
$idx
"
]
||
return
1
[
-f
"
$idx
"
]
||
return
1
# if link or file is missing, then we need update abuildrepo index
# if link or file is missing, then we need update abuildrepo index
[
-f
"
$file
"
]
||
return
1
[
-f
"
$file
"
]
||
return
1
# if file exists and is newer than index, then we need update index
# if file exists and is newer than index, then we need update index
[
"
$file
"
-nt
"
$idx
"
]
&&
return
1
[
"
$file
"
-nt
"
$idx
"
]
&&
return
1
return
0
return
0
}
}
...
@@ -1434,10 +1434,10 @@ deptrace() {
...
@@ -1434,10 +1434,10 @@ deptrace() {
deps
=
"
$deps
${
i
%%[<>=]*
}
"
deps
=
"
$deps
${
i
%%[<>=]*
}
"
done
done
[
-z
"
$deps
"
]
&&
return
0
[
-z
"
$deps
"
]
&&
return
0
(
depparse_aports
(
depparse_aports
if
[
-z
"
$upgrade
"
]
;
then
if
[
-z
"
$upgrade
"
]
;
then
# list installed pkgs and prefix with 'i '
# list installed pkgs and prefix with 'i '
$APK
info
-
q
|
sort
|
sed
's/^/i /'
$APK
info
-
-quiet
|
sort
|
sed
's/^/i /'
fi
fi
)
|
awk
-v
pkgs
=
"
$deps
"
'
)
|
awk
-v
pkgs
=
"
$deps
"
'
...
@@ -1476,22 +1476,22 @@ builddeps() {
...
@@ -1476,22 +1476,22 @@ builddeps() {
subpackages_has
${
i
%%[<>=]*
}
||
deps
=
"
$deps
$i
"
subpackages_has
${
i
%%[<>=]*
}
||
deps
=
"
$deps
$i
"
done
done
installed_deps
=
$(
$APK
info
-
e
$deps
)
installed_deps
=
$(
$APK
info
-
-installed
$deps
)
# find which deps are missing
# find which deps are missing
for
i
in
$deps
;
do
for
i
in
$deps
;
do
if
[
"
${
i
#\!
}
"
!=
"
$i
"
]
;
then
if
[
"
${
i
#\!
}
"
!=
"
$i
"
]
;
then
$APK
info
-
q
-e
"
${
i
#\!
}
"
\
$APK
info
-
-quiet
--installed
"
${
i
#\!
}
"
\
&&
conflicts
=
"
$conflicts
${
i
#\!
}
"
&&
conflicts
=
"
$conflicts
${
i
#\!
}
"
elif
!
deplist_has
$i
$installed_deps
||
[
-n
"
$upgrade
"
]
;
then
elif
!
deplist_has
$i
$installed_deps
||
[
-n
"
$upgrade
"
]
;
then
missing
=
"
$missing
$i
"
missing
=
"
$missing
$i
"
fi
fi
done
done
if
[
-n
"
$conflicts
"
]
;
then
if
[
-n
"
$conflicts
"
]
;
then
error
"Conflicting package(s) installed:
$conflicts
"
error
"Conflicting package(s) installed:
$conflicts
"
return
1
return
1
fi
fi
if
[
-z
"
$install_deps
"
]
&&
[
-z
"
$recursive
"
]
;
then
if
[
-z
"
$install_deps
"
]
&&
[
-z
"
$recursive
"
]
;
then
# if we dont have any missing deps we are done now
# if we dont have any missing deps we are done now
[
-z
"
$missing
"
]
&&
return
0
[
-z
"
$missing
"
]
&&
return
0
...
@@ -1511,7 +1511,7 @@ builddeps() {
...
@@ -1511,7 +1511,7 @@ builddeps() {
--virtual
.makedepends-
$pkgname
$deps
\
--virtual
.makedepends-
$pkgname
$deps
\
&&
return
0
&&
return
0
fi
fi
[
-z
"
$recursive
"
]
&&
return
1
[
-z
"
$recursive
"
]
&&
return
1
# find dependencies that are installed but missing in repo.
# find dependencies that are installed but missing in repo.
...
@@ -1521,7 +1521,7 @@ builddeps() {
...
@@ -1521,7 +1521,7 @@ builddeps() {
missing
=
"
$missing
$i
"
missing
=
"
$missing
$i
"
fi
fi
done
done
for
i
in
$(
deptrace
$missing
)
;
do
for
i
in
$(
deptrace
$missing
)
;
do
# i = pkg:dir
# i = pkg:dir
local dir
=
${
i
#*
:
}
local dir
=
${
i
#*
:
}
...
@@ -1529,7 +1529,7 @@ builddeps() {
...
@@ -1529,7 +1529,7 @@ builddeps() {
# ignore if dependency is in other repo
# ignore if dependency is in other repo
[
-d
"
$dir
"
]
||
continue
[
-d
"
$dir
"
]
||
continue
# break circular deps
# break circular deps
list_has
$pkg
$ABUILD_VISITED
&&
continue
list_has
$pkg
$ABUILD_VISITED
&&
continue
export
ABUILD_VISITED
=
"
$ABUILD_VISITED
$pkg
"
export
ABUILD_VISITED
=
"
$ABUILD_VISITED
$pkg
"
...
@@ -1538,7 +1538,7 @@ builddeps() {
...
@@ -1538,7 +1538,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
"
\
$SUDO_APK
add
-
-upgrade
--repository
"
$abuildrepo
"
\
$apk_opt_wait
\
$apk_opt_wait
\
--virtual
.makedepends-
$pkgname
$deps
--virtual
.makedepends-
$pkgname
$deps
}
}
...
@@ -1670,7 +1670,8 @@ post_add() {
...
@@ -1670,7 +1670,8 @@ 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
"
$SUDO_APK
add
$apk_opt_wait
--upgrade
"
$pkgf
"
\
||
die
"Failed to install
$1
"
}
}
installdeps
()
{
installdeps
()
{
...
@@ -1766,7 +1767,7 @@ usage() {
...
@@ -1766,7 +1767,7 @@ usage() {
echo
" -k Keep built packages, even if APKBUILD or sources are newer"
echo
" -k Keep built packages, even if APKBUILD or sources are newer"
echo
" -m Disable colors (monochrome)"
echo
" -m Disable colors (monochrome)"
echo
" -p Set package destination directory"
echo
" -p Set package destination directory"
echo
" -P Set PKGDEST to REPODEST/<repo>/
\$
CARCH, where repo is the parents dir name"
echo
" -P Set PKGDEST to REPODEST/<repo>/
\$
CARCH, where repo is the parents dir name"
echo
" -q Quiet"
echo
" -q Quiet"
echo
" -r Install missing dependencies from system repository (using sudo)"
echo
" -r Install missing dependencies from system repository (using sudo)"
echo
" -R Recursively build and install missing dependencies (using sudo)"
echo
" -R Recursively build and install missing dependencies (using sudo)"
...
...
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