mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2025-01-12 10:00:53 +00:00
newapkbuild: fix empty function regression
Since the obsolete 'cd "$builddir"' statements have been removed in [1],
build(), check() and package() can generate empty functions if no build
system is specified or if there is no default for the given build
system. newapkbuild will then fail, as it tries to parse the script it
generated:
$ cd /home/pmos && newapkbuild test
/usr/bin/abuild: /home/pmos/test/APKBUILD: line 18: syntax error: unexpected "}"
$ cat test/APKBUILD
...
build() {
}
...
Fix this by placing ":" in functions that would be empty.
[1]: f83d19ce79
This commit is contained in:
parent
8d092443d9
commit
635a699365
@ -104,6 +104,13 @@ build_python() {
|
||||
__EOF__
|
||||
}
|
||||
|
||||
build_empty() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
# Replace with proper build command(s)
|
||||
:
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_make() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
make check
|
||||
@ -116,6 +123,13 @@ check_python() {
|
||||
__EOF__
|
||||
}
|
||||
|
||||
check_empty() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
# Replace with proper check command(s)
|
||||
:
|
||||
__EOF__
|
||||
}
|
||||
|
||||
# Package sections
|
||||
package_make() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
@ -146,6 +160,13 @@ package_python() {
|
||||
__EOF__
|
||||
}
|
||||
|
||||
package_empty() {
|
||||
cat >>APKBUILD<<__EOF__
|
||||
# Replace with proper package command(s)
|
||||
:
|
||||
__EOF__
|
||||
}
|
||||
|
||||
# Create new aport from templates
|
||||
newaport() {
|
||||
local newname="${1##*/}"
|
||||
@ -281,6 +302,8 @@ __EOF__
|
||||
build_perl;;
|
||||
python)
|
||||
build_python;;
|
||||
*)
|
||||
build_empty;;
|
||||
esac
|
||||
|
||||
cat >>APKBUILD<<__EOF__
|
||||
@ -298,6 +321,8 @@ __EOF__
|
||||
check_make;;
|
||||
python)
|
||||
check_python;;
|
||||
*)
|
||||
check_empty;;
|
||||
esac
|
||||
|
||||
cat >>APKBUILD<<__EOF__
|
||||
@ -321,6 +346,8 @@ __EOF__
|
||||
package_perl;;
|
||||
python)
|
||||
package_python;;
|
||||
*)
|
||||
package_empty;;
|
||||
esac
|
||||
|
||||
if [ -n "$cpinitd" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user