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 1859278

Summary: Warnings from automatic shebang munging macro
Product: Red Hat Enterprise Linux 8 Reporter: mreynolds
Component: 389-ds-baseAssignee: mreynolds
Status: CLOSED NOTABUG QA Contact: RHDS QE <ds-qe-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.0CC: pasik, sgouvern, spichugi, tbordaz, vashirov
Target Milestone: rcKeywords: Triaged
Target Release: 8.4Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: sync-to-jira
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-10 13:26:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description mreynolds 2020-07-21 15:46:53 UTC
This bug is created as a clone of upstream ticket:
https://pagure.io/389-ds-base/issue/49677

#### Issue Description
https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/message/2PD5RNJRKPN2DVTNGJSBHR5RUSVZSDZI/

In F28 automatic shebang munging macro generates the following warnings/errors:
```
/export/ds/rpmbuild/BUILDROOT/389-ds-base-1.4.0.9-20180512git5d700cc45.fc28.x86_64/usr/lib64/dirsrv/python/failedbinds.py
/export/ds/rpmbuild/BUILDROOT/389-ds-base-1.4.0.9-20180512git5d700cc45.fc28.x86_64/usr/lib64/dirsrv/python/logregex.py
DEPRECATION WARNING: python2 invoked with /usr/bin/python.
    Use /usr/bin/python3 or /usr/bin/python2
    /usr/bin/python will be removed or switched to Python 3 in the future.
    If you cannot make the switch now, please follow instructions at https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out
DEPRECATION WARNING: python2 invoked with /usr/bin/python.
    Use /usr/bin/python3 or /usr/bin/python2
    /usr/bin/python will be removed or switched to Python 3 in the future.
    If you cannot make the switch now, please follow instructions at https://fedoraproject.org/wiki/Changes/Avoid_usr_bin_python_in_RPM_Build#Quick_Opt-Out
+ /usr/lib/rpm/brp-python-hardlink
+ /usr/lib/rpm/redhat/brp-mangle-shebangs '' ''
mangling shebang in /usr/sbin/bak2db.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/ns-inactivate.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/verify-db.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/migrate-ds.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/fixup-memberof.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/ns-accountstatus.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/fixup-linkedattrs.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/setup-ds.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/ns-activate.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/schema-reload.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/remove-ds.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/ns-newpwpolicy.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/db2index.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/db2bak.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/ldif2db.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/usn-tombstone-cleanup.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/cleanallruv.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/db2ldif.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/sbin/syntax-validate.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/bin/cl-dump.pl from /usr/bin/env perl to #!/usr/bin/perl
*** WARNING: mangling shebang in /usr/bin/ds-replcheck from #!/usr/bin/python to #!/usr/bin/python2. This will become an ERROR, fix it manually!
mangling shebang in /usr/bin/repl-monitor.pl from /usr/bin/env perl to #!/usr/bin/perl
*** WARNING: mangling shebang in /usr/bin/ds-logpipe.py from #!/usr/bin/env python to #!/usr/bin/python2. This will become an ERROR, fix it manually!
mangling shebang in /usr/bin/logconv.pl from /usr/bin/env perl to #!/usr/bin/perl
mangling shebang in /usr/bin/dbgen.pl from /usr/bin/env perl to #!/usr/bin/perl
```

#### Package Version and Platform
1.4.x

Scripts using 
1. `#!/usr/bin/env INTERPRETER` should be changed to `#!/usr/bin/INTERPRETER`
2. `#!/usr/bin/python` should be changed to `#!/usr/bin/python3` (and updated to be py3 compatible)

Python scripts 
```
./ldap/admin/src/scripts/logregex.py
./ldap/admin/src/scripts/failedbinds.py 
```
are without shebang, they should be changed to explicitly have one.

Comment 8 sgouvern 2021-05-10 13:26:48 UTC
Warnings occured on fedora, related to python 2 -> python 3 migration
fixes have been done and latest builds do not show any problematic warning / error any more
-> closing