dcavalca / rpms / grub2

Forked from rpms/grub2 3 years ago
Clone

Blame SOURCES/0217-Force-everything-to-use-python3.patch

8631a2
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
8631a2
From: Peter Jones <pjones@redhat.com>
8631a2
Date: Tue, 10 Jul 2018 16:54:02 -0400
8631a2
Subject: [PATCH] Force everything to use python3
8631a2
8631a2
But this still means you need to do PYTHON=python=3 ./autogen.sh if you
8631a2
run the world's worst tooling before you patch.
8631a2
8631a2
Signed-off-by: Peter Jones <pjones@redhat.com>
8631a2
---
8631a2
 conf/Makefile.common | 4 ++--
8631a2
 gentpl.py            | 2 +-
8631a2
 2 files changed, 3 insertions(+), 3 deletions(-)
8631a2
8631a2
diff --git a/conf/Makefile.common b/conf/Makefile.common
8631a2
index c75848f5c06..1ecb921db65 100644
8631a2
--- a/conf/Makefile.common
8631a2
+++ b/conf/Makefile.common
8631a2
@@ -128,11 +128,11 @@ BUILT_SOURCES =
8631a2
 
8631a2
 .PRECIOUS: $(top_srcdir)/Makefile.util.am
8631a2
 $(top_srcdir)/Makefile.util.am: $(top_srcdir)/gentpl.py $(top_srcdir)/Makefile.util.def $(top_srcdir)/Makefile.utilgcry.def
8631a2
-	python $^ > $@.new || (rm -f $@.new; exit 1)
8631a2
+	python3 $^ > $@.new || (rm -f $@.new; exit 1)
8631a2
 	mv $@.new $@
8631a2
 
8631a2
 .PRECIOUS: $(top_srcdir)/grub-core/Makefile.core.am
8631a2
 $(top_srcdir)/grub-core/Makefile.core.am: $(top_srcdir)/gentpl.py $(top_srcdir)/grub-core/Makefile.core.def $(top_srcdir)/grub-core/Makefile.gcry.def
8631a2
 	if [ "x$$GRUB_CONTRIB" != x ]; then echo "You need to run ./autogen.sh manually." >&2; exit 1; fi
8631a2
-	python $^ > $@.new || (rm -f $@.new; exit 1)
8631a2
+	python3 $^ > $@.new || (rm -f $@.new; exit 1)
8631a2
 	mv $@.new $@
8631a2
diff --git a/gentpl.py b/gentpl.py
8631a2
index baac6a2af69..6409736e81c 100644
8631a2
--- a/gentpl.py
8631a2
+++ b/gentpl.py
8631a2
@@ -1,4 +1,4 @@
8631a2
-#! /usr/bin/python
8631a2
+#! /usr/bin/env python3
8631a2
 #  GRUB  --  GRand Unified Bootloader
8631a2
 #  Copyright (C) 2010,2011,2012,2013  Free Software Foundation, Inc.
8631a2
 #