#3486 packaging: Block py3 compilation in py2 env
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji packaging  into  master

file modified
+4 -1
@@ -1,3 +1,4 @@ 

+ PYVER_MAJOR := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.split(".")[:1]))')

  PACKAGE = $(shell basename `pwd`)

  PYFILES = $(wildcard *.py)

  PKGDIR = $(shell $(PYTHON) -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")/$(PACKAGE)
@@ -30,5 +31,7 @@ 

  	for p in $(PYFILES) ; do \

  		install -p -m 644 $$p $(DESTDIR)/$(SERVERDIR)/$$p; \

  	done

- 	$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(SERVERDIR)', 1, '$(PYDIR)', 1)"

+ 	@if [ "$(PYVER_MAJOR)" == "3" ] ; then \

+ 		$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(SERVERDIR)', 1, '$(PYDIR)', 1)" ; \

+ 	fi

  

file modified
+6 -4
@@ -40,10 +40,12 @@ 

  

          ifndef KOJI_MINIMAL

  		mkdir -p $(DESTDIR)/$(HUBPLUGINDIR);

- 		install -p -m 644 $(HUBFILES) $(DESTDIR)/$(HUBPLUGINDIR);

- 		$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(HUBPLUGINDIR)', 1, '$(HUBPLUGINDIR)', 1)";

- 		mkdir -p $(DESTDIR)/$(HUBCONFDIR);

- 		install -p -m 644 $(HUBCONFFILES) $(DESTDIR)/$(HUBCONFDIR);

+ 		@if [ "$(PYVER_MAJOR)" == "3" ] ; then \

+ 			install -p -m 644 $(HUBFILES) $(DESTDIR)/$(HUBPLUGINDIR); \

+ 			$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(HUBPLUGINDIR)', 1, '$(HUBPLUGINDIR)', 1)"; \

+ 			mkdir -p $(DESTDIR)/$(HUBCONFDIR); \

+ 			install -p -m 644 $(HUBCONFFILES) $(DESTDIR)/$(HUBCONFDIR); \

+ 		fi

  		mkdir -p $(DESTDIR)/$(BUILDERPLUGINDIR);

  		install -p -m 644 $(BUILDERFILES) $(DESTDIR)/$(BUILDERPLUGINDIR);

  		$(PYTHON) -c "import compileall; compileall.compile_dir('$(DESTDIR)/$(BUILDERPLUGINDIR)', 1, '$(BUILDERPLUGINDIR)', 1)";

Metadata Update from @tkopecek:
- Pull-request tagged with: no_qe

2 years ago

Metadata Update from @tkopecek:
- Pull-request untagged with: no_qe
- Pull-request tagged with: testing-ready

2 years ago

Metadata Update from @tkopecek:
- Pull-request untagged with: testing-ready
- Pull-request tagged with: no_qe

2 years ago

Commit d335ac0 fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago