mirror of
https://git.proxmox.com/git/proxmox-backup-qemu
synced 2025-08-17 20:05:59 +00:00

mirrors the changes from proxmox-backup commit 198ebc6c86380351662b8b01537f449538ff1e6b [0] [0]: https://git.proxmox.com/?p=proxmox-backup.git;a=commit;h=198ebc6c86380351662b8b01537f449538ff1e6b Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
21 lines
361 B
Bash
Executable File
21 lines
361 B
Bash
Executable File
#!/bin/bash
|
|
|
|
binary=$1
|
|
|
|
exec 3< <(ldd -u "$binary" | grep -oP '[^/:]+$')
|
|
|
|
patchargs=""
|
|
dropped=""
|
|
while read -r dep; do
|
|
dropped="$dep $dropped"
|
|
patchargs="--remove-needed $dep $patchargs"
|
|
done <&3
|
|
exec 3<&-
|
|
|
|
if [[ $dropped == "" ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
echo -e "patchelf '$binary' - removing unused dependencies:\n $dropped"
|
|
patchelf $patchargs $binary
|