RPM Community Forums

Mailing List Message of <rpm-devel>

Re: rpm5 incompatibility with old rpm: globs no longer include dangling symlinks + proposed popt alias patch

From: devzero2000 <pinto.elia@gmail.com>
Date: Wed 25 Jun 2008 - 16:21:23 CEST
Message-ID: <b086760e0806250721u3fac2718h8eed7765963ea4d4@mail.gmail.com>
####
# ... the patch on the end of this mail
####

What is more, the resulting "broken" package isn't installable by default
because a failed linktos deps.
e.g. (with another example package )

#rpm -Uvh /home/machbuild/rpmbuild/RPMS/simplest-1.0-1.noarch.rpm
error: Failed dependencies:
        /etc/ls is needed by simplest-1.0-1.noarch

In the SPEC was :

#
%install
rm -rf $RPM_BUILD_ROOT

mkdir -p $RPM_BUILD_ROOT/etc
touch $RPM_BUILD_ROOT/etc/%{name}
ln -s ls $RPM_BUILD_ROOT/etc/%{name}-ls # <- dandling simlink
#

#rpm -qp --qf '[%{FILELINKTOS}\n]'
/home/machbuild/rpmbuild/RPMS/simplest-1.0-1.noarch.rpm

ls


But if you know what are you doing:

#echo "/etc/ls" >/etc/rpm/sysinfo/Filelinktos

#rpm -Uvh --test /home/machbuild/rpmbuild/RPMS/simplest-1.0-1.noarch.rpm
Preparing...                ###########################################
[100%]


Best Regards

PS

PATCH

Thank very much Bero for having drawn my attention to the subject: so i can
post a simple patch. I thinks that it can be useful for doing correctly


rpm -Va --orphadirs > /etc/rpm/sysinfo/Dirnames
rpm  -Va --danglinglinks >/etc/rpm/sysinfo/Filelinktos

whenever exists broken package around and i can't repair them. If also you
think as me, please commit that i don't can now.

####################
Changelog:

fix: popt alias --orphandirs catch also dangling link
add: port alias ----danglinglinks

##################

rpm     alias --orphandirs --nofiles \
          --pipe "set $(grep '^/' | sort -u) ; [ -d  \"$1\" ] && echo \"$1\"
" \
        --POPTdesc=$"display directories needed, but not provided, by
packages"


rpm     alias --danglinglinks  --nofiles  \
             --pipe "grep '^/' | sort -u" \
        --POPTdesc=$"display link needed, but not provided, by packages"

###############################################


On Wed, Jun 25, 2008 at 2:17 PM, Jeff Johnson <n3npq@mac.com> wrote:

>
> On Jun 25, 2008, at 8:00 AM, Bernhard Rosenkränzer wrote:
>
>  In older rpm versions, this spec fragment would cause %_bindir/someapp to
>> be
>> included:
>>
>> %install
>> make install
>> # consolehelper comes from a different package, therefore the symlink
>> # being created here is dangling
>> ln -s consolehelper $RPM_BUILD_ROOT%_bindir/someapp
>>
>> %files
>> %_bindir/*
>>
>>
>> In 5.1.4 (and probably older rpm5 versions), the dangling symlink is
>> omitted
>> and listed in "warning: Installed (but unpackaged) file(s) found".
>> Probably an lstat() somewhere was changed to stat()...
>>
>> Listing %_bindir/someapp explicitly still packages it.
>>
>> Is this an intentional change (because dangling symlinks can be rather
>> unwanted), or a bug?
>>
>>
> RPM uses internal glob to maintain compatibility, not for portability.
>
> The incompatibility was introduced several years ago when glibc, not rpm,
> changed.
>
> 73 de
> Jeff______________________________________________________________________
>
> RPM Package Manager                                    http://rpm5.org
> Developer Communication List                        rpm-devel@rpm5.org
>
Received on Wed Jun 25 16:21:25 2008
Driven by Jeff Johnson and the RPM project team.
Hosted by OpenPKG and Ralf S. Engelschall.
Powered by FreeBSD and OpenPKG.