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

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