From 0b5e9dc81ce719721916995916dd58f49b250188 Mon Sep 17 00:00:00 2001 From: Franz Chih-Ping Hsieh Date: Aug 13 2018 20:50:59 +0000 Subject: PR#946: force using python2 to run script Merges #946 https://pagure.io/koji/pull-request/946 Fixes: #945 https://pagure.io/koji/issue/945 Koji build fail due to ambiguous python shebang. --- diff --git a/builder/kojid b/builder/kojid index eb78d94..44fe917 100755 --- a/builder/kojid +++ b/builder/kojid @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # Koji build daemon # Copyright (c) 2005-2014 Red Hat, Inc. diff --git a/builder/mergerepos b/builder/mergerepos index 714856b..bb3ee6d 100755 --- a/builder/mergerepos +++ b/builder/mergerepos @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by diff --git a/cli/koji b/cli/koji index 77349f3..0402158 100755 --- a/cli/koji +++ b/cli/koji @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # coding=utf-8 # command line interface for the Koji build system diff --git a/devtools/fakehub b/devtools/fakehub index ccb5f73..3b21dfa 100755 --- a/devtools/fakehub +++ b/devtools/fakehub @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 from __future__ import absolute_import from __future__ import print_function diff --git a/devtools/fakeweb b/devtools/fakeweb index 735a97b..469c693 100755 --- a/devtools/fakeweb +++ b/devtools/fakeweb @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 from __future__ import absolute_import from __future__ import print_function diff --git a/koji.spec b/koji.spec index f0b37f1..22cce58 100644 --- a/koji.spec +++ b/koji.spec @@ -277,7 +277,7 @@ make DESTDIR=$RPM_BUILD_ROOT PYTHON=python3 %{?install_opt} install cd ../plugins make DESTDIR=$RPM_BUILD_ROOT PYTHON=python3 %{?install_opt} install # alter python interpreter in koji CLI -sed -i 's/\#\!\/usr\/bin\/python/\#\!\/usr\/bin\/python3/' $RPM_BUILD_ROOT/usr/bin/koji +sed -i 's/\#\!\/usr\/bin\/python2/\#\!\/usr\/bin\/python3/' $RPM_BUILD_ROOT/usr/bin/koji %endif %clean diff --git a/koji/context.py b/koji/context.py index 56a79f7..811c6c1 100755 --- a/koji/context.py +++ b/koji/context.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # Copyright (c) 2005-2014 Red Hat, Inc. # # Koji is free software; you can redistribute it and/or diff --git a/runtests b/runtests index 8d0adf9..0bd8816 100755 --- a/runtests +++ b/runtests @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 from multiprocessing import Pool import subprocess diff --git a/tests/test_lib/test_fixEncoding.py b/tests/test_lib/test_fixEncoding.py index 2f7ca8f..267f53d 100644 --- a/tests/test_lib/test_fixEncoding.py +++ b/tests/test_lib/test_fixEncoding.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # coding=utf-8 """Test the __init__.py module""" diff --git a/tests/test_lib/test_parsers.py b/tests/test_lib/test_parsers.py index d8f8760..fc3b164 100644 --- a/tests/test_lib/test_parsers.py +++ b/tests/test_lib/test_parsers.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 """Test the __init__.py module""" diff --git a/util/koji-gc b/util/koji-gc index fa64f04..e128180 100755 --- a/util/koji-gc +++ b/util/koji-gc @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # koji-gc: a garbage collection tool for Koji # Copyright (c) 2007-2014 Red Hat, Inc. diff --git a/util/koji-shadow b/util/koji-shadow index 1bb18e5..563f8b0 100755 --- a/util/koji-shadow +++ b/util/koji-shadow @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # koji-shadow: a tool to shadow builds between koji instances # Copyright (c) 2007-2016 Red Hat, Inc. diff --git a/util/kojira b/util/kojira index bf19894..5245373 100755 --- a/util/kojira +++ b/util/kojira @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # Koji Repository Administrator (kojira) # Copyright (c) 2005-2014 Red Hat, Inc. diff --git a/vm/kojikamid.py b/vm/kojikamid.py index 1d40e68..271dcaa 100755 --- a/vm/kojikamid.py +++ b/vm/kojikamid.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # Koji daemon that runs in a Windows VM and executes commands associated # with a task. diff --git a/vm/kojivmd b/vm/kojivmd index 8bdbeed..e50aad0 100755 --- a/vm/kojivmd +++ b/vm/kojivmd @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/python2 # Koji virtual machine management daemon # Copyright (c) 2010-2014 Red Hat, Inc.