Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion filters/80-elf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
##filter/elf.sh: ELF-related filters
##@copyright GPL-2.0+

# Executable and libraries can only exist in following directories in AOSC OS package
# ref: AOSC OS Package Styling Manual (https://wiki.aosc.io/developer/packaging/package-styling-manual/)
# Filesystem Hierarchy Standard 3.0 (https://refspecs.linuxfoundation.org/FHS_3.0/fhs/index.html)
BIN_DIRS=(
Comment thread
MingcongBai marked this conversation as resolved.
opt/
usr/bin/
usr/lib/
usr/libexec/
usr/local/bin/
usr/local/lib/
usr/local/libexec/
)

filter_elf() {
local _opts=()
if ! bool "$ABSTRIP"; then
Expand All @@ -13,7 +26,8 @@ filter_elf() {
fi

local _elf_path=()
for i in "$PKGDIR"/{opt/*/*/,opt/*/,usr/,}{lib{,64,exec},{s,}bin}/; do
for p in "${BIN_DIRS[@]}"; do
i="$PKGDIR"/"$p"
if [ -d "$i" ]; then
_elf_path+=("$i")
fi
Expand Down
24 changes: 24 additions & 0 deletions filters/81-pdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash
##filter/pdb.sh: Move or delete Program Database file
##@copyright GPL-2.0+

filter_pdb() {
for p in ${BIN_DIRS[@]}; do
i="$PKGDIR"/"$p"
if [ -d "$i" ]; then
for f in `find $i -type f -name "*.pdb"`; do
if bool "$ABSPLITDBG"; then
path="${f#"$PKGDIR"}"
abinfo "Saving Program Database file $f ..."
mkdir -p `dirname "$SYMDIR"/"$path"`
mv "$f" "$SYMDIR"/"$path"
elif bool "$ABSTRIP"; then
abinfo "Dropping Program Database file $f ..."
rm "$f"
fi
done
fi
done
}

ab_register_filter pdb
Loading