Blame SOURCES/0001-Add-inital-redhat-build-support.patch

866c13
From 63f8528699e608ef46d256fd8105b338049336e3 Mon Sep 17 00:00:00 2001
8023bf
From: Miroslav Rezanina <mrezanin@redhat.com>
8023bf
Date: Thu, 6 Oct 2016 12:25:35 +0200
8023bf
Subject: Add inital redhat build support
8023bf
866c13
Rebase notes (2.2.32):
8023bf
- Fix license text
8023bf
8023bf
Rebase notes (2.2.26):
8023bf
- update to RHEL 8 build
8023bf
- Do not use INSTALED_FILES for %files
8023bf
8023bf
Rebase notes (2.2.10):
8023bf
- switched to sha256
8023bf
- added .gitpublish profile
8023bf
866c13
Rebase notes (2.2.46):
866c13
- added waagent-extn.logrotate
866c13
866c13
Merged patches (2.2.45):
c53240
- df29beb Switch from platform-python to python36
c53240
- 6749108 Stop packaging legacy waagent2.0
c53240
8023bf
Merged patches (2.2.32):
8023bf
- ce36fd9 Use Python3
8023bf
- 952c830 Remove FIPS setting from the default config
8023bf
- cc9df73 Switch hardcoded python3 shebangs into the %%{__python3} macro
8023bf
- 66b6f8c Use correct macro for waagent.service
8023bf
- 1b15ada Switch to platform-python in systemd unit file
8023bf
- 59f682b Use sys.executable to find system python
8023bf
8023bf
(cherry picked from commit 19d4f82cd5345fdc52b357afcf3b5aa4bc4ce4d9)
8023bf
(cherry picked from commit 1676db295321adbd571f04773782eed5b0817d64)
8023bf
---
8023bf
 .gitpublish                               |   8 +
8023bf
 azurelinuxagent/ga/update.py              |  12 +-
8023bf
 bin/waagent                               |   2 +-
8023bf
 bin/waagent2.0                            |   2 +-
8023bf
 init/arch/waagent.service                 |   2 +-
8023bf
 init/clearlinux/waagent.service           |   2 +-
8023bf
 init/suse/waagent                         |   2 +-
8023bf
 init/waagent.service                      |   2 +-
8023bf
 makepkg.py                                |   2 +-
8023bf
 redhat/.gitignore                         |   1 +
8023bf
 redhat/Makefile                           |  72 +++++++
8023bf
 redhat/Makefile.common                    |  37 ++++
866c13
 redhat/WALinuxAgent.spec.template         | 186 +++++++++++++++++
8023bf
 redhat/rpmbuild/BUILD/.gitignore          |   2 +
8023bf
 redhat/rpmbuild/RPMS/.gitignore           |   2 +
8023bf
 redhat/rpmbuild/SOURCES/.gitignore        |   2 +
8023bf
 redhat/rpmbuild/SPECS/.gitignore          |   2 +
8023bf
 redhat/rpmbuild/SRPMS/.gitignore          |   2 +
8023bf
 redhat/scripts/frh.py                     |  27 +++
8023bf
 redhat/scripts/git-backport-diff          | 327 ++++++++++++++++++++++++++++++
8023bf
 redhat/scripts/git-compile-check          | 215 ++++++++++++++++++++
8023bf
 redhat/scripts/process-patches.sh         |  79 ++++++++
8023bf
 redhat/scripts/tarball_checksum.sh        |   3 +
8023bf
 setup.py                                  |   2 +-
8023bf
 tests/data/ext/sample_ext-1.3.0/sample.py |   2 +-
866c13
 25 files changed, 981 insertions(+), 14 deletions(-)
8023bf
 create mode 100644 .gitpublish
8023bf
 create mode 100644 redhat/.gitignore
8023bf
 create mode 100644 redhat/Makefile
8023bf
 create mode 100644 redhat/Makefile.common
8023bf
 create mode 100644 redhat/WALinuxAgent.spec.template
8023bf
 create mode 100644 redhat/rpmbuild/BUILD/.gitignore
8023bf
 create mode 100644 redhat/rpmbuild/RPMS/.gitignore
8023bf
 create mode 100644 redhat/rpmbuild/SOURCES/.gitignore
8023bf
 create mode 100644 redhat/rpmbuild/SPECS/.gitignore
8023bf
 create mode 100644 redhat/rpmbuild/SRPMS/.gitignore
8023bf
 create mode 100755 redhat/scripts/frh.py
8023bf
 create mode 100755 redhat/scripts/git-backport-diff
8023bf
 create mode 100755 redhat/scripts/git-compile-check
8023bf
 create mode 100755 redhat/scripts/process-patches.sh
8023bf
 create mode 100755 redhat/scripts/tarball_checksum.sh
8023bf
8023bf
diff --git a/azurelinuxagent/ga/update.py b/azurelinuxagent/ga/update.py
866c13
index c882bc1..8367274 100644
8023bf
--- a/azurelinuxagent/ga/update.py
8023bf
+++ b/azurelinuxagent/ga/update.py
866c13
@@ -93,8 +93,11 @@ def get_update_handler():
8023bf
 
8023bf
 
8023bf
 def get_python_cmd():
8023bf
-    major_version = platform.python_version_tuple()[0]
8023bf
-    return "python" if int(major_version) <= 2 else "python{0}".format(major_version)
8023bf
+    if sys.executable:
8023bf
+        return sys.executable
8023bf
+    else:
8023bf
+        major_version = platform.python_version_tuple()[0]
8023bf
+        return "python" if int(major_version) <= 2 else "python{0}".format(major_version)
8023bf
 
8023bf
 
8023bf
 class UpdateHandler(object):
866c13
@@ -151,9 +154,8 @@ class UpdateHandler(object):
8023bf
 
8023bf
             # Launch the correct Python version for python-based agents
8023bf
             cmds = textutil.safe_shlex_split(agent_cmd)
8023bf
-            if cmds[0].lower() == "python":
8023bf
-                cmds[0] = get_python_cmd()
8023bf
-                agent_cmd = " ".join(cmds)
8023bf
+            cmds[0] = get_python_cmd()
8023bf
+            agent_cmd = " ".join(cmds)
8023bf
 
8023bf
             self._evaluate_agent_health(latest_agent)
8023bf
 
8023bf
diff --git a/bin/waagent b/bin/waagent
c53240
index 4039e03..13d8d37 100755
8023bf
--- a/bin/waagent
8023bf
+++ b/bin/waagent
8023bf
@@ -1,4 +1,4 @@
8023bf
-#!/usr/bin/env python
c53240
+#!/usr/bin/python3.6
8023bf
 #
8023bf
 # Azure Linux Agent
8023bf
 #
8023bf
diff --git a/bin/waagent2.0 b/bin/waagent2.0
8023bf
index 25aa0ce..a868211 100644
8023bf
--- a/bin/waagent2.0
8023bf
+++ b/bin/waagent2.0
8023bf
@@ -1,4 +1,4 @@
8023bf
-#!/usr/bin/env python
8023bf
+#!/usr/bin/env python3
8023bf
 #
8023bf
 # Azure Linux Agent
8023bf
 #
8023bf
diff --git a/init/arch/waagent.service b/init/arch/waagent.service
8023bf
index d426eb2..ff1ebab 100644
8023bf
--- a/init/arch/waagent.service
8023bf
+++ b/init/arch/waagent.service
8023bf
@@ -8,7 +8,7 @@ ConditionPathExists=/etc/waagent.conf
8023bf
 
8023bf
 [Service]
8023bf
 Type=simple
8023bf
-ExecStart=/usr/bin/python -u /usr/bin/waagent -daemon
8023bf
+ExecStart=/usr/bin/python3 -u /usr/bin/waagent -daemon
8023bf
 Restart=always
8023bf
 RestartSec=5
8023bf
 
8023bf
diff --git a/init/clearlinux/waagent.service b/init/clearlinux/waagent.service
8023bf
index 9afee45..c29fc1b 100644
8023bf
--- a/init/clearlinux/waagent.service
8023bf
+++ b/init/clearlinux/waagent.service
8023bf
@@ -8,7 +8,7 @@ ConditionPathExists=/usr/share/defaults/waagent/waagent.conf
8023bf
 
8023bf
 [Service]
8023bf
 Type=simple
8023bf
-ExecStart=/usr/bin/python -u /usr/bin/waagent -daemon
8023bf
+ExecStart=/usr/bin/python3 -u /usr/bin/waagent -daemon
8023bf
 Restart=always
8023bf
 RestartSec=5
8023bf
 
8023bf
diff --git a/init/suse/waagent b/init/suse/waagent
8023bf
index b77b0fa..317e89e 100755
8023bf
--- a/init/suse/waagent
8023bf
+++ b/init/suse/waagent
8023bf
@@ -34,7 +34,7 @@
8023bf
 # Description: Start the MicrosoftAzureLinuxAgent
8023bf
 ### END INIT INFO
8023bf
 
8023bf
-PYTHON=/usr/bin/python
8023bf
+PYTHON=/usr/bin/python3
8023bf
 WAZD_BIN=/usr/sbin/waagent
8023bf
 WAZD_CONF=/etc/waagent.conf
8023bf
 WAZD_PIDFILE=/var/run/waagent.pid
8023bf
diff --git a/init/waagent.service b/init/waagent.service
c53240
index e91f143..99f3183 100644
8023bf
--- a/init/waagent.service
8023bf
+++ b/init/waagent.service
8023bf
@@ -8,7 +8,7 @@ ConditionPathExists=/etc/waagent.conf
8023bf
 
8023bf
 [Service]
8023bf
 Type=simple
8023bf
-ExecStart=/usr/bin/python -u /usr/sbin/waagent -daemon
c53240
+ExecStart=/usr/bin/python3.6 -u /usr/sbin/waagent -daemon
8023bf
 Restart=always
8023bf
 RestartSec=5
8023bf
 
8023bf
diff --git a/makepkg.py b/makepkg.py
8023bf
index 52e0eae..51c263c 100755
8023bf
--- a/makepkg.py
8023bf
+++ b/makepkg.py
8023bf
@@ -1,4 +1,4 @@
8023bf
-#!/usr/bin/env python
8023bf
+#!/usr/bin/env python3
8023bf
 
8023bf
 import glob
8023bf
 import os
8023bf
diff --git a/setup.py b/setup.py
866c13
index 372807f..f0798ff 100755
8023bf
--- a/setup.py
8023bf
+++ b/setup.py
8023bf
@@ -1,4 +1,4 @@
8023bf
-#!/usr/bin/env python
8023bf
+#!/usr/bin/env python3
8023bf
 #
8023bf
 # Microsoft Azure Linux Agent setup.py
8023bf
 #
8023bf
diff --git a/tests/data/ext/sample_ext-1.3.0/sample.py b/tests/data/ext/sample_ext-1.3.0/sample.py
8023bf
index 74bd839..bf6ed99 100755
8023bf
--- a/tests/data/ext/sample_ext-1.3.0/sample.py
8023bf
+++ b/tests/data/ext/sample_ext-1.3.0/sample.py
8023bf
@@ -1,4 +1,4 @@
8023bf
-#!/usr/bin/env python
8023bf
+#!/usr/bin/env python3
8023bf
 
8023bf
 import os
8023bf
 
8023bf
-- 
8023bf
1.8.3.1
8023bf