From: Magnus Jacobsson Date: Tue, 9 Jun 2020 22:35:29 +0000 (+0200) Subject: Fix sh syntax error in debian/rules X-Git-Tag: 2.44.1~5^2~3^2^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=517177b064a7b18c07205f799beaf66dd5fd97a6;p=graphviz Fix sh syntax error in debian/rules 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. --- diff --git a/debian/rules b/debian/rules index cc8d0f078..ded9a6d57 100755 --- a/debian/rules +++ b/debian/rules @@ -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