Commit d66a5ee4 authored by Natanael Copa's avatar Natanael Copa

abuild: run postcheck for subpackages as well

parent 92af0b86
...@@ -536,6 +536,25 @@ get_split_func() { ...@@ -536,6 +536,25 @@ get_split_func() {
echo $func echo $func
} }
postcheck() {
local dir="$1" name="$2" i=
msg "Running postcheck for $name"
# look for *.la files
i=$(find "$dir" -name '*.la' | sed "s|^$dir|\t|")
if [ -n "$i" ] && ! options_has "libtool"; then
error "Libtool archives (*.la) files found and \$options has no 'libtool' flag:"
echo "$i"
return 1
fi
# check directory permissions
i=$(find "$dir" -type d -perm -777 | sed "s|^$dir|\t|")
if [ -n "$i" ]; then
warning "World writeable directories found:"
echo "$i"
fi
return 0
}
prepare_subpackages() { prepare_subpackages() {
local i local i
cd "$startdir" cd "$startdir"
...@@ -543,27 +562,17 @@ prepare_subpackages() { ...@@ -543,27 +562,17 @@ prepare_subpackages() {
local func=$(get_split_func $i) local func=$(get_split_func $i)
# call abuild recursively, setting subpkg{dir,name} # call abuild recursively, setting subpkg{dir,name}
msg "Running split function $func..." msg "Running split function $func..."
subpkgdir="$pkgbasedir/${i%:*}" subpkgname="${i%:*}" \ local dir="$pkgbasedir/${i%:*}" name="${i%:*}"
subpkgdir="$dir" subpkgname="$name" \
$0 $func prepare_package || return 1 $0 $func prepare_package || return 1
postcheck "$dir" "$name" || return 1
done done
# post check postcheck "$pkgdir" "$pkgname" || return 1
i=$(find "$pkgdir" -name '*.la' | sed "s|^$pkgdir|\t|")
if [ -n "$i" ] && ! options_has "libtool"; then
error "Libtool archives (*.la) files found and \$options has no 'libtool' flag:"
echo "$i"
return 1
fi
# post check for /usr/share/locale # post check for /usr/share/locale
if [ -d "$pkgdir"/usr/share/locale ]; then if [ -d "$pkgdir"/usr/share/locale ]; then
warning "Found /usr/share/locale" warning "Found /usr/share/locale"
warning2 "Maybe add \$pkgname-lang to subpackages?" warning2 "Maybe add \$pkgname-lang to subpackages?"
fi fi
# check directory permissions
i=$(find "$pkgdir" -type d -perm -777 | sed "s|^$pkgdir|\t|")
if [ -n "$i" ]; then
warning "World writeable directories found:"
echo "$i"
fi
} }
default_lang() { default_lang() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment