[Rpm-maint] debugedit fails to list the sources, and rpmbuild create debuginfo subpackages without sources inside.

Guilherme Destefani rpm at destefani.eng.br
Fri Aug 19 21:23:51 UTC 2011


I've found that when %_topdir is defined with a trailing slash, rpmbuild
creates debuginfo subpackages without the sources inside.

With this line inside ~/.rpmmacros:
%_topdir      %(echo $HOME)/rpmbuild/
or something more complex, like this:
%_topdir      %(echo $HOME)/rpmbuild/./../rpmbuild/./

You end up with a debuginfo without the sources inside.

But this works fine:
%_topdir      %(echo $HOME)/rpmbuild

If you want to try for yourself:

[root at localhost ~]# rpmbuild --define="%_topdir /root/rpmbuild/" -ba
~/rpmbuild/SPECS/ed.spec >& /dev/null &&rpm -qpl
/root/rpmbuild/RPMS/i386/ed-debuginfo-1.5-2.i386.rpm
/usr/lib/debug
/usr/lib/debug/bin
/usr/lib/debug/bin/ed.debug
[root at localhost ~]# rpmbuild --define="%_topdir /root/rpmbuild" -ba
~/rpmbuild/SPECS/ed.spec >& /dev/null &&rpm -qpl
/root/rpmbuild/RPMS/i386/ed-debuginfo-1.5-2.i386.rpm
/usr/lib/debug
/usr/lib/debug/bin
/usr/lib/debug/bin/ed.debug
/usr/src/debug/ed-1.5
/usr/src/debug/ed-1.5/buffer.c
/usr/src/debug/ed-1.5/carg_parser.c
/usr/src/debug/ed-1.5/carg_parser.h
/usr/src/debug/ed-1.5/ed.h
/usr/src/debug/ed-1.5/global.c
/usr/src/debug/ed-1.5/io.c
/usr/src/debug/ed-1.5/main.c
/usr/src/debug/ed-1.5/main_loop.c
/usr/src/debug/ed-1.5/regex.c
/usr/src/debug/ed-1.5/signal.c
[root at localhost ~]#

I have tracked down the problem to the debugedit tool. It compares the path
base_dir (-b) provided in the command line with the path that came from the
debug symbols. Since the debug symbols points to absolute paths, it gets
confused if fed with a relative path.
The find-debuginfo.sh use the RPM_BUILD_DIR, and this is not always an
absolute path. I've found that I got a double /:
+ echo /usr/lib/rpm/debugedit -b /home/User/rpmbuild//BUILD -d
/usr/src/debug -i -l /home/User/rpmbuild//BUILD/ed-1.5/debugsources.list
/home/User/rpmbuild/BUILDROOT/ed-1.5-2.fc15.i386/bin/ed
And this triggers the problem.
Some except from find-debuginfo.sh:
    201   echo "extracting debug info from $f"
    202   id=$(/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug
\
    203                               -i -l "$SOURCEFILE" "$f")

I am sending a patch that makes debugedit always use the absolute path. I'm
no sure that this is the best way to do it, since I have not spent enough
time figuring out what debugedit does in detail, but with this patch any
path seems to work now.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20110819/3b035383/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Always-resolve-the-base-dir-into-the-real-path.-Rela.patch
Type: text/x-patch
Size: 973 bytes
Desc: not available
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20110819/3b035383/attachment.bin>


More information about the Rpm-maint mailing list