Skip to content

Revert "Simplified method for picking out shared libraries from syste… #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
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
17 changes: 12 additions & 5 deletions packaging/packager
Original file line number Diff line number Diff line change
Expand Up @@ -56,36 +56,43 @@ if ! type zip > /dev/null 2>&1; then
exit 1
fi

function find_so_files() {
function pluck_so_files() {
sed -E '/\.so$|\.so\.[0-9]+$/!d'
}

function package_libc_alpine() {
# -F matches a fixed string rather than a regex (grep that comes with busybox doesn't know --fixed-strings)
if grep -F "Alpine Linux" < /etc/os-release > /dev/null; then
if type apk > /dev/null 2>&1; then
apk info --contents musl 2>/dev/null | find_so_files | sed 's/^/\//'
apk info --contents musl 2>/dev/null | pluck_so_files | sed 's/^/\//'
fi
fi
}

function package_libc_pacman() {
if grep --extended-regexp "Arch Linux|Manjaro Linux" < /etc/os-release > /dev/null 2>&1; then
if type pacman > /dev/null 2>&1; then
pacman --query --list --quiet glibc | find_so_files
pacman --query --list --quiet glibc | pluck_so_files
fi
fi
}

function package_libc_dpkg() {
if type dpkg-query > /dev/null 2>&1; then
dpkg-query --listfiles libc6:$(dpkg --print-architecture) | find_so_files
architecture=$(dpkg --print-architecture)
if [[ $(dpkg-query --listfiles libc6:$architecture | wc -l) -gt 0 ]]; then
dpkg-query --listfiles libc6:$architecture | pluck_so_files
fi
fi
}

function package_libc_rpm() {
arch=$(uname -m)

if type rpm > /dev/null 2>&1; then
rpm --query --list glibc.$(uname -m) | find_so_files
if [[ $(rpm --query --list glibc.$arch | wc -l) -gt 1 ]]; then
rpm --query --list glibc.$arch | pluck_so_files
fi
fi
}

Expand Down