3 # build/znc-1.8.1-2.fc33.src.rpm.rpms
4 which readelf >/dev/null
7 if [ "$rpms" = "$srcrpm" ];then
8 echo >&2 "$rpms is not *.rpms"
11 if [ "$srcrpm" != "${srcrpm%.dt5.rpm}" ];then
12 # The non-.dt5.rpm run will handle both.
16 test -e $srcrpm.dt5.rpm.rpms
17 test ! -e $srcrpm.dtneeded
18 test ! -e $srcrpm.rpms.d
19 t=/tmp/dtneededsizerpms.$$
22 pushd $srcrpm.rpms.d >/dev/null
23 rpmsbase=../../`basename $srcrpm`
24 dwzrpms=$rpmsbase.rpms
25 dtrpms=$rpmsbase.dt5.rpm.rpms
28 if [ -z "$(find $dwzrpms $dtrpms -maxdepth 1 -type f)" ];then
36 for i in $1/*-debuginfo*.rpm;do
44 mkdir dwz;(cd dwz;extract $dwzrpms)
45 mkdir dt;(cd dt;extract $dtrpms)
46 dwzcommonname="$(find dwz/usr/lib/debug/.dwz/ -type f 2>/dev/null || :)"
47 if [ -z "$dwzcommonname" ];then
48 dwzcommonname="nodwzcommon"
51 dwzcommon="$(find "$dwzcommonname" -maxdepth 0 -printf "%s")"
52 echo >>$t "$dwzcommonname isdwzcommon $dwzcommon NA"
55 for i in `find -type f -name "*.debug*"`;do
56 dwz=$(find $i -maxdepth 0 -printf "%s")
57 dt=$(find ../dt/$i -maxdepth 0 -printf "%s")
58 if readelf -WS $i 2>/dev/null|fgrep -q .gnu_debugaltlink;then
59 if [ $dwzcommon -eq 0 ];then
60 echo >&2 Excessive .gnu_debugaltlink: $i
64 echo >>$t "$(echo "$i"|sed 's/\.debug$//') $dwzcommonname $dwz $dt"
69 mv $t $srcrpm.dtneeded