#2968 fix python version parsing for py 3.10
Merged 2 years ago by tkopecek. Opened 2 years ago by tkopecek.
tkopecek/koji fixpyparse  into  master

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

- PYVER := $(shell $(PYTHON) -c 'import sys; print("%.1s" %(sys.version))')

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

  

  BINFILES = kojid

  LIBEXECFILES = mergerepos
@@ -22,7 +22,7 @@ 

  	mkdir -p $(DESTDIR)/usr/sbin

  	install -p -m 755 $(BINFILES) $(DESTDIR)/usr/sbin

  

- 	@if [ "$(PYVER)" -lt 3 ] ; then \

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

  		mkdir -p $(DESTDIR)/usr/libexec/kojid; \

  		install -p -m 755 $(LIBEXECFILES) $(DESTDIR)/usr/libexec/kojid; \

  	fi

py 3.10 was parsed as py 3.1

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

2 years ago

I did some tests with this pr.
It might be:

PYVER := $(shell $(PYTHON) -c 'import sys; print(".".join(sys.version.split(".")[0]))')
  • '.' should be quoted as "."
  • PYVER should be an integer as a decimal is not accepted by -lt test.

I've remade it to just major version as we're not testing anything else there now.

rebased onto ebb86221cb33c3907e1876a7ba3c2ed1c388d1dc

2 years ago

Metadata Update from @mfilip:
- Pull-request tagged with: testing-done

2 years ago

rebased onto 5f65cf6

2 years ago

Commit abefecc fixes this pull-request

Pull-Request has been merged by tkopecek

2 years ago
Metadata