Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add CentOS 8 to mangle-shebangs.sh #53

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,12 @@ workflows:
- build-rpm-package:
name: centos7
image: centos:centos7
- build-rpm-package:
name: centos8
image: centos:centos8
- build-rpm-package:
name: amazon-linux-2
image: amazonlinux:2
- build-rpm-package:
name: amazon-linux
image: amazonlinux:1
image: amazonlinux:1
5 changes: 3 additions & 2 deletions mangle-shebangs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
SYSTEM_RELEASE_PATH=/etc/system-release
RHEL8_REGEX="Red Hat Enterprise Linux release 8"
FEDORA_REGEX="Fedora release"
CENTOS8_REGEX="CentOS Linux release 8"

# RHEL8 and Fedora30+ both treat shebangs of the form "#!/usr/bin/env python" as errors
if [ -f $SYSTEM_RELEASE_PATH ] && [[ "$(cat $SYSTEM_RELEASE_PATH)" =~ $RHEL8_REGEX|$FEDORA_REGEX ]]; then
# RHEL8, Fedora30+ and CentOS8 treat shebangs of the form "#!/usr/bin/env python" as errors
if [ -f $SYSTEM_RELEASE_PATH ] && [[ "$(cat $SYSTEM_RELEASE_PATH)" =~ $RHEL8_REGEX|$FEDORA_REGEX|$CENTOS8_REGEX ]]; then
# Replace the first line in .py to "#!/usr/bin/env python2" no
# matter what it was before
sed -i -e '1 s/^.*$/\#!\/usr\/bin\/env python2/' src/watchdog/__init__.py
Expand Down