perl.prov in RPM 3.0.5 for AIX is broken


 
Thread Tools Search this Thread
Operating Systems AIX perl.prov in RPM 3.0.5 for AIX is broken
# 1  
Old 11-19-2010
perl.prov in RPM 3.0.5 for AIX is broken

Posting to hopefully help the next person googling this issue. The perl.prov script in RPM 3.0.5 [r51] from the AIX Toolbox for Linux is horribly broken. It fails under the following circumstances:
  • If a Perl module has improperly-terminated POD, it will skip over valid definitions. This can start in one file and spill over due to the global nature of the binary flip-flop operator.
  • If a Perl module does this:
    Code:
    package Foo;
    $VERSION = 1.2.3;
    ..
    .. later ..
    ..
    package Bar;
    ..
    .. later ..
    ..
    package Foo;
    ..

    it loses the version number.
  • If a Perl module uses C<our> or a fully-qualified package variable name (e.g. $Foo::Bar::VERSION) to define the version number, it will not detect it.
  • If a Perl module defines the special $RPM_Provides variable, it fails due to a typo (C<spit> should be C<split>).

Furthermore, RPM will not invoke find-provides.perl (an sh wrapper around perl.prov) automatically; %__find_provides needs to be manually overridden in the SPEC file.

I've attached a minimal unified diff to perl.prov to resolve these issues. Apply with GNU patch. Additionally, here is a global macro you can define to automatically call find-provides.perl instead of find-provides if "perl" is in the package name:
Code:
%__find_provides /opt/freeware/lib/rpm/find-provides%{expand:%%( \
  if [[ %{name} = *[Pp][Ee][Rr][Ll]* ]] ; then echo .perl ; fi)}

If you don't have root or aren't willing to directly patch the script, you will need to copy find-requires.perl and perl.prov out of /opt/freeware/lib/rpm and modify the macro and find-requires.perl to reflect the new location. There are some issues with find-requires.perl as well (for starters, AIX xargs doesn't take the -r flag), but we're using cpanspec, which computes the BuildRequires and Requires lines from CPAN, so it's not such a big deal.

I should add that this patch doesn't make perl.prov bulletproof. There are still some situations where improperly terminated POD or weird package/version definitions (e.g. a newline between the package keyword and the package name) can trip it up. Perl is tricky to parse in general and a lot of maintainers have struggled with this particular problem.

Last edited by alakaboo; 11-19-2010 at 03:00 PM.. Reason: added disclaimer at the end, fixed formatting
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. AIX

IBM P730 running AIX 7.1 (8231-E2B) - Fans spinning loud/max rpm?

We have a IBM P730 machine running AIX 7.1 in a properly air cooled server room. Just recently the fans on the unit kicked into overdrive, they are very loud and spinning at max. Typically this happens when the server first boots then they normalize. However for some odd reason, they sound... (2 Replies)
Discussion started by: c3rb3rus
2 Replies

2. AIX

AIX rpm: a question about deps

On Solaris 10 i use pkgutil,very nice,update like "apt-get" On HPUX i use depothelper for resolv depends On AIX there is something similar for use rpm? I try this but is not the same thing. AIX Open Source Packages | FAQs / FAQs (Frequently Asked Questions) (1 Reply)
Discussion started by: Linusolaradm1
1 Replies

3. AIX

Rpm issue with autoconf-2.63-1.AIX6.1.noarch.rpm

dears i am trying to install the autoconf-2.63-1.aix6.1.noarch.rpm but its shows the below error message . P700_dev/svn/dependencies>rpm -i autoconf-2.63-1.aix6.1.noarch.rpm error: failed dependencies: m4 is needed by autoconf-2.63-1 P700_dev/svn/dependencies> (6 Replies)
Discussion started by: thecobra151
6 Replies

4. Shell Programming and Scripting

Joining broken lines with awk or perl

Hi, I have a huge file with sql broken statements like: PP3697HB @@@@0 <<<<<<Record has been deleted as per PP3697HB>>>>>> FROM sys.xtab_ref rc,sys.xtab_sys f,sys.domp ur WHE RE rc.milf = ur.milf AND rc.molf = f.molf AND ur.dept = 'SWIT'AND ur .department = 'IND' AND share = '2' AND... (4 Replies)
Discussion started by: som.nitk
4 Replies

5. AIX

Issue with installing rpm in AIX 6.1

I am trying to install an rpm : libiconv-1.14-1.aix5.1.ppc.rpm which is a dependency to install GIT. While I gave the command I got the foll message: root:user-> $ rpm -i -v libiconv-1.14-1.aix5.1.ppc.rpm libiconv-1.14-1 ar: Cannot open or remove a file containing a running program.... (2 Replies)
Discussion started by: gaugeta
2 Replies

6. AIX

Cannot get shared lock on database for rpm on AIX 6.1

Hello, I was trying to install python on aix and it was taking too long and I closed the terminal. Now when i issue the command rpm -qa instead of getting all the rpms installed I'm getting the following error. root:stud -> $ rpm -qa cannot get shared lock on database rpmQuery: rpmdbOpen()... (2 Replies)
Discussion started by: gaugeta
2 Replies

7. Shell Programming and Scripting

How to make RPM not write to RPM database if RPM fails to deploy?

How to make RPM not write to RPM database if RPM fails to deploy? IE I create an rpm spec file that contains the following if then exit 1 fi My rpm will fail at deployment, but if I do rpm -qa , I can see the rpm in the rpm db (3 Replies)
Discussion started by: 3junior
3 Replies

8. Linux

Uninstalling a broken software rpm in Linux

Hi, I have a installed a package(some X) on my linux machine. But now I want to unistall it but some of the file required for unistalltion are missing. Can someone tell me how to remove that rpm (package) from my machine. I am trying Install it again. But for it, i need to uninstall it... (1 Reply)
Discussion started by: eamani_sun
1 Replies

9. AIX

[AIX 5.2] Problem with rpm

I downloaded gcc-cplusplus-4.0.0-1.aix5.2.ppc.rpm from IBM AIX Toolbox Download Page - Alphabetical Listing but: -bash-3.00# rpm -ivh gcc-cplusplus-4.0.0-1.aix5.2.ppc.rpm error: gcc-cplusplus-4.0.0-1.aix5.2.ppc.rpm cannot be installed I can't understand wht kind of error is it... Can be... (1 Reply)
Discussion started by: untamed
1 Replies
Login or Register to Ask a Question