Skip to content

Commit b0e84b5

Browse files
committed
bin: Use /usr/bin/env python
But for fedora packaging, replace it with explicit python2 path https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
1 parent f0d78ec commit b0e84b5

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

bin/bugzilla

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
#!/usr/bin/python -tt
1+
#!/usr/bin/env python
22
#
33
# bugzilla - a commandline frontend for the python bugzilla module
44
#
5-
# Copyright (C) 2007, 2008, 2009, 2010, 2011 Red Hat Inc.
5+
# Copyright (C) 2007-2017 Red Hat Inc.
66
# Author: Will Woods <wwoods@redhat.com>
7+
# Author: Cole Robinson <crobinso@redhat.com>
78
#
89
# This program is free software; you can redistribute it and/or modify it
910
# under the terms of the GNU General Public License as published by the

python-bugzilla.spec

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ popd
8282

8383
%{__python2} setup.py install -O1 --skip-build --root %{buildroot}
8484

85+
# Replace '#!/usr/bin/env python' with '#!/usr/bin/python2'
86+
# The format is ideal for upstream, but not a distro. See:
87+
# https://fedoraproject.org/wiki/Features/SystemPythonExecutablesUseSystemPython
88+
for f in $(find %{buildroot} -type f -executable -print); do
89+
sed -i "1 s|^#!/usr/bin/env python|#!%{__python2}|" $f || :
90+
done
91+
8592

8693
%check
8794
%{__python2} setup.py test

0 commit comments

Comments
 (0)