Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1324032

Summary: /usr/lib/rpm/rpmdeps not matching Perl scripts properly
Product: Red Hat Enterprise Linux 7 Reporter: Karel Srot <ksrot>
Component: rpmAssignee: Florian Festi <ffesti>
Status: CLOSED DUPLICATE QA Contact: Karel Srot <ksrot>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.2CC: ffesti, jzeleny
Target Milestone: beta   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1324003 Environment:
Last Closed: 2016-08-02 05:58:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Karel Srot 2016-04-05 11:47:35 UTC
Same problem is also in the internal (default) requires generator:

# echo test.pl | /usr/lib/rpm/rpmdeps
# 

When checking rpm sources...

# grep -R "script)" *
autodeps/linux.req:exelist=`echo $filelist | xargs -r file | egrep -v ":.* (commands|script) " | \
autodeps/linux.req:	egrep ":.* (commands|script) " | cut -d: -f1`
autodeps/freebsd.req:scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 `
autodeps/freebsdelf.req:scriptlist=`if test "x$filelist" != x; then echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1; fi`
autodeps/darwin.req:scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 `
autodeps/openbsd.req:scriptlist=`echo $filelist | xargs file | egrep ":.* (commands|script) " | cut -d: -f1 `
build/parseScript.c:    tfe->script = (script && *script != '\0') ? xstrdup(script) : NULL;
build/pack.c:	if (p->script) {
build/pack.c:	    headerPutString(pkg->header, RPMTAG_TRIGGERSCRIPTS, p->script);
build/spec.c:	o->script = _free(o->script);
lib/psm.c:    if (script) {
lib/psm.c:	xx = Fwrite(script, sizeof(script[0]), strlen(script), fd);
lib/psm.c:    if (script) {
lib/psm.c:    if (rpmtdCount(&script) == 0 && rpmtdCount(&prog) == 0)
lib/psm.c:		   rpmtdGetString(&script), psm->scriptArg, -1);
lib/psm.c:    rpmtdFreeData(&script);
ltmain.sh:             have already dealt with, above (inluding dump-script), then
rpmio/rpmlua.c:    if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {
rpmio/rpmlua.c:    if (luaL_loadbuffer(L, script, strlen(script), name) != 0) {


+++ This bug was initially created as a clone of Bug #1324003 +++

Description of problem:

/usr/lib/rpm/redhat/find-requires contain at two places following grep pattern:

  ":.* (commands|script) "

The problem is that file is identifying Perl scrips as follows:

  test.pl: Perl script, ASCII text executable

Therefore /usr/lib/rpm/find-requires from rpm rather uses

  ":.* (commands|script)[, ]"


Beside this problem there is also the same problem as described in bug 1275551.


Version-Release number of selected component (if applicable):
redhat-rpm-config-9.1.0-68.el7.noarch

How reproducible:
alwyas

Steps to Reproduce:

# cat > test.pl <<EOF
#!/usr/bin/perl

use AAA;
use BBB;

# use CCC is a comment and should not be part of requires
sub get_help
{
        return <<EOT;
This text is a help an if it contains something like
use DDD , it should not be part of requires
or like
        use EEE , it should not be part of requires
EOT
}
EOF

# chmod a+x test.pl
# echo test.pl | /usr/lib/rpm/redhat/find-requires
objdump: test.pl: File format not recognized


Expected results:

/usr/bin/perl
perl(AAA)
perl(BBB)

See also bug 1275551.

Comment 3 Karel Srot 2016-04-06 08:19:50 UTC
I guess there is no problem with missing requires in the end... I forgot to pass the parameter to rpmdeps.

# echo $PWD/test.pl | /usr/lib/rpm/rpmdeps -R
/usr/bin/perl
perl(AAA)
perl(BBB)
perl(DDD)
perl(EEE)

So the only problem that remains are incorrect (additional) requires.

Anyway, I am confused that it works, I can see in the source code that the regexp is not correct. Strange. Probably I am looking at the wrong piece of code.

Comment 6 Karel Srot 2016-04-06 08:52:48 UTC
(In reply to Karel Srot from comment #3)
> Anyway, I am confused that it works, I can see in the source code that the
> regexp is not correct. Strange. Probably I am looking at the wrong piece of
> code.

Of course I was looking at the wrong piece as the internal (C) generator is used by default. :-)

Comment 7 Karel Srot 2016-04-06 09:34:58 UTC
I have tested few more Perl samples from previously reported bugs and there is also an issue that more or less matches problems reported in bug 1268021:

  file enc2xs, there is a missing requires perl(File::Find)
  file ParseXS.pm, there is a missing requires perl(strict)

To summarize it, so far the issues found are missing requires ^^ and additional (unwanted) requires perl(DDD) perl(EEE) from the bug 1275551.

Comment 8 Karel Srot 2016-04-06 10:14:15 UTC
One more finding. Perl sample from bug 1024517
  file DependencyInfo.pm, there is an additional requires perl(warnings).

Comment 9 Karel Srot 2016-04-06 11:54:43 UTC
This has been filed against redhat-rpm-config by mistake, should be rpm.

Comment 11 Karel Srot 2016-08-02 05:58:05 UTC
It turned out this is a duplicate of bug 1275551.

*** This bug has been marked as a duplicate of bug 1275551 ***