]> granicus.if.org Git - graphviz/commitdiff
Fix sh syntax error in debian/rules
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 9 Jun 2020 22:35:29 +0000 (00:35 +0200)
committerMagnus Jacobsson <magnus.jacobsson@netinsight.net>
Mon, 15 Jun 2020 11:52:37 +0000 (13:52 +0200)
Fixes https://gitlab.com/graphviz/graphviz/-/issues/1735 (and fixes https://gitlab.com/graphviz/graphviz/-/issues/1737)).

The error message was: "/bin/sh: 1: Syntax error: "&" unexpected".

The |& syntax is only valid for bash, not for sh.

This was introduced in b861a44f39521be6c5c81f0d7aa39bdedae6be82.

Also fixed install of libgv-python for multiple python versions which
was masked by this problem.

debian/rules

index cc8d0f0789c4a721fff572b4b14e22e95f7ad166..ded9a6d57889907cd9e6c1004090cae7a6fc5a9e 100755 (executable)
@@ -33,7 +33,7 @@ LUA_PACKAGE       = $(CURDIR)/debian/libgv-lua
 
 DEV_PACKAGE       = $(CURDIR)/debian/libgraphviz-dev
 
-PYTHON_VERSIONS   = $(shell python2 --version |& sed 's/.* \(.*\)\..*/\1/'; python3 --version |& sed 's/.* \(.*\)\..*/\1/')
+PYTHON_VERSIONS   = $(shell python2 --version 2>&1 | sed 's/.* \(.*\)\..*/python\1/'; python3 --version 2>&1 | sed 's/.* \(.*\)\..*/python\1/')
 PYTHON_PACKAGE    = $(CURDIR)/debian/libgv-python
 
 RUBY_VERSION      = 1.8
@@ -202,10 +202,11 @@ install: build
        # where python-support will find it. Both being identical, python-support
        # will just do the right thing.
        for i in $(PYTHON_VERSIONS); do \
+               PYTHON_MAJOR_VERSION=`echo $$i | sed 's/\..*//'`; \
                install -d $(PYTHON_PACKAGE)/usr/lib/$$i/site-packages ; \
-               cp $(PYTHON_PACKAGE)/usr/lib/graphviz/python*/gv.py \
+               cp $(PYTHON_PACKAGE)/usr/lib/graphviz/$${PYTHON_MAJOR_VERSION}/gv.py \
                        $(PYTHON_PACKAGE)/usr/lib/$$i/site-packages ; \
-               mv $(PYTHON_PACKAGE)/usr/lib/graphviz/python*/*.so \
+               mv $(PYTHON_PACKAGE)/usr/lib/graphviz/$${PYTHON_MAJOR_VERSION}/*.so \
                        $(PYTHON_PACKAGE)/usr/lib/$$i/site-packages ; \
        done
        rm -rf $(PYTHON_PACKAGE)/usr/lib/graphviz