| 1 |
#!/bin/sh |
| 2 |
set -e |
| 3 |
|
| 4 |
cleanup_biarch_dirs() { |
| 5 |
dpkg --compare-versions "$2" lt "36~" || return 0 |
| 6 |
|
| 7 |
# bootstrapping or earlier conversions may have created empty biarch |
| 8 |
# directories and links. glibc 2.35-4 or later will create them if needed, |
| 9 |
# so clean up the unused (and unowned) ones |
| 10 |
local arch_directories="/lib64 /lib32 /libo32 /libx32" |
| 11 |
for dir in $arch_directories; do |
| 12 |
[ -e "$DPKG_ROOT$dir" ] || continue |
| 13 |
if ! dpkg-query -S $dir >/dev/null 2>&1; then |
| 14 |
rm -v "$DPKG_ROOT$dir" |
| 15 |
if [ -e "$DPKG_ROOT/usr$dir" ] && ! dpkg-query -S /usr$dir >/dev/null 2>&1 ; then |
| 16 |
rmdir --ignore-fail-on-non-empty -v "$DPKG_ROOT/usr$dir" |
| 17 |
fi |
| 18 |
fi |
| 19 |
done |
| 20 |
} |
| 21 |
|
| 22 |
case "$1" in |
| 23 |
configure) |
| 24 |
cleanup_biarch_dirs |
| 25 |
;; |
| 26 |
esac |
| 27 |
|
| 28 |
#DEBHELPER# |