#49896 Ticket 49891 - Use "--python3" macro for python scripts
Closed 3 years ago by spichugi. Opened 5 years ago by mreynolds.
mreynolds/389-ds-base ticket49891  into  master

@@ -1,4 +1,4 @@ 

- #!/usr/bin/env python

+ #!/usr/bin/python3

  

  from __future__ import print_function

  

@@ -1,4 +1,4 @@ 

- #!/usr/bin/python

+ #!/usr/bin/python3

  

  # --- BEGIN COPYRIGHT BLOCK ---

  # Copyright (C) 2018 Red Hat, Inc.

file modified
+3
@@ -329,6 +329,9 @@ 

  

  cp %{SOURCE2} README.devel

  

+ # Make sure python3 is used in shebangs

+ sed -r -i '1s|^#!\s*/usr/bin.*python.*|#!%{__python3}|' ldap/admin/src/scripts/{*.py,ds-replcheck,readnsstate}

Is it needed for ds-replcheck if you change shebang to python3 explicitly? And the only other *.py files are:

$ ls -1 ldap/admin/src/scripts/*.py
ldap/admin/src/scripts/ds-logpipe.py
ldap/admin/src/scripts/failedbinds.py
ldap/admin/src/scripts/logregex.py
ldap/admin/src/scripts/ns-slapd-gdb.py

Not needed, just added it for consistency

+ 

  %build

  

  %if %{use_clang}

Description: Make sure all python scripts use the macro "__python3"
for its shebang.

https://pagure.io/389-ds-base/issue/49891

Reviewed by: ?

There are also python scripts that don't have shebang at all:

./ldap/admin/src/scripts/logregex.py
./ldap/admin/src/scripts/failedbinds.py 

Is it needed for ds-replcheck if you change shebang to python3 explicitly? And the only other *.py files are:

$ ls -1 ldap/admin/src/scripts/*.py
ldap/admin/src/scripts/ds-logpipe.py
ldap/admin/src/scripts/failedbinds.py
ldap/admin/src/scripts/logregex.py
ldap/admin/src/scripts/ns-slapd-gdb.py

There are also python scripts that don't have shebang at all:
./ldap/admin/src/scripts/logregex.py
./ldap/admin/src/scripts/failedbinds.py

Right so there is nothing to do :-p

Not needed, just added it for consistency

I'm trying to understand this change. Please correct me if I'm wrong. So you're changing shebang in python scripts to python3 and then replace it in spec file with %{__python3} macro. Is this needed for platform-python?

Sorry Viktor, we actually don't have to do anything. After I opened the ticket I got in touch with the group that originally identified us having to make a change, but turns out we don't. Since I had the ticket open I thought I'd do a little cleanup, but none of this is necessary.

Actually the downstream spec file already had this change, I was just adding it to the upstream specfile

I think this change is needed. For example tests for conflict resolution are failing in nightlies, because ds-replcheck uses python2, but lib389 is for python3 only. So at least we can make things the same in upstream spec file and in downstream (Fedora and RHEL).

I think this change is needed. For example tests for conflict resolution are failing in nightlies, because ds-replcheck uses python2, but lib389 is for python3 only. So at least we can make things the same in upstream spec file and in downstream (Fedora and RHEL).

So it that an ack? :-)

Sorry, yes, it's an ack :)

rebased onto b413ba0

5 years ago

Pull-Request has been merged by mreynolds

5 years ago

389-ds-base is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in 389-ds-base's github repository.

This pull request has been cloned to Github as issue and is available here:
- https://github.com/389ds/389-ds-base/issues/2955

If you want to continue to work on the PR, please navigate to the github issue,
download the patch from the attachments and file a new pull request.

Thank you for understanding. We apologize for all inconvenience.

Pull-Request has been closed by spichugi

3 years ago