[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fedora-perl-devel-list
Subject:    perl-Archive-Extract Sub-packages or RPM Needs Rich Dependencies
From:       Petr Pisar <ppisar () redhat ! com>
Date:       2015-04-30 13:23:03
Message-ID: 20150430132302.GC2142 () dhcp-0-146 ! brq ! redhat ! com
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Dear perl-Archive-Extact users,

in a few days you will receive an update which will install many new packages.
But don't worry, the new packages do not occupy much disk space (not Wall
Street); they do not install any files at all. These are virtual (= dummy,
empty) packages which exist only for the sake of package dependency
resolution.

Archive-Extract is a smart wrapper around various decompressing Perl modules
and other executables which allows you to unpack common archive formats.
Fortunately, there are many modules and tools understanding the same format,
so an user can choose from many options. Unfortunately, RPM (in Fedora) does
not yet support disjunctions between dependencies, so it's not possible to
declare that a package needs `perl(Archive::Tar)' or `tar'. 

(There is a plan to support `perl(Archive::Tar) || tar' like expressions in
the RPM, but that has not yet been fully implemented. See
<https://lists.fedoraproject.org/pipermail/devel/2014-February/195743.html>.)

Therefore the only way how to express this boolean algebra is to take package
managers into account and create virtual packages like this:

Name:       perl-Archive-Extract
Requires:   %{name}-tar

%package tar-tar
Summary:    Tar decompressor for %{name} via tar
Provides:   %{name}-tar
Requires:   tar

%package tar-Archive-Tar
Summary:    Tar decompressor for %{name} via Archive::Tar
Provides:   %{name}-tar
Requires:   perl(Archive::Tar)

This example implements the idea that perl-Archive-Extract requires
Archive::Tar perl module or tar package in order to support extracting tar
balls by creating to virtual packages both providing the same %{name}-tar RPM
symbol which is required by the original perl-Archive-Extract package.

I implemented about 20 such sub-packages into perl-Archive-Extract as
a reaction to a bug report
<https://bugzilla.redhat.com/show_bug.cgi?id=1217352>.

Similar approach could be taken in perl-CPAN which can use various tools for
downloading CPAN distributions. Or by any network capable package supporting
various IO::Socket-like modules.

There is clear use case for rich RPM dependencies. Hope they will save our
souls (and fingers).

-- Petr

[Attachment #5 (application/pgp-signature)]
[Attachment #6 (text/plain)]

--
Fedora Extras Perl SIG
http://www.fedoraproject.org/wiki/Extras/SIGs/Perl
perl-devel mailing list
perl-devel@lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/perl-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic