Skip to content

Commit b13d7d2

Browse files
[debian/rules] Fail on script error during package build (sonic-net#1050)
It is required to have -e in .SHELLFLAGS to fail on such errors. Also, fixed install pathes for python bindings and disabled python2 bindings when DEB_BUILD_PROFILES=nopython2 is passed. Signed-off-by: Stepan Blyschak [[email protected]](mailto:[email protected])
1 parent 48cccb4 commit b13d7d2

File tree

5 files changed

+15
-4
lines changed

5 files changed

+15
-4
lines changed

.azure-pipelines/build-template.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ jobs:
114114
set -ex
115115
rm ../*.deb || true
116116
./autogen.sh
117-
fakeroot debian/rules DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' CFLAGS="" CXXFLAGS="" binary-syncd-vs
117+
DEB_BUILD_OPTIONS=nocheck fakeroot debian/rules DEB_CONFIGURE_EXTRA_FLAGS='--enable-code-coverage' CFLAGS="" CXXFLAGS="" binary-syncd-vs
118118
mv ../*.deb .
119119
displayName: "Compile sonic sairedis with coverage enabled"
120120
- script: |

debian/control

+1
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ Description: debugging symbols for libsaimetadata
117117

118118
Package: python-pysairedis
119119
Architecture: any
120+
Build-Profiles: <!nopython2>
120121
Depends: ${shlibs:Depends}, ${misc:Pre-Depends}
121122
Section: libs
122123
Description: This package contains Switch State Service sairedis Python2 library.

debian/python-pysairedis.install

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
usr/lib/python2.7/dist-packages/pysairedis/*
1+
usr/lib/python2.7/dist-packages/sairedis/*

debian/python3-pysairedis.install

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
usr/lib/python3/dist-packages/pysairedis/*
1+
usr/lib/python3/dist-packages/sairedis/*

debian/rules

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.ONESHELL:
77
SHELL = /bin/bash
8-
.SHELLFLAGS += -x
8+
.SHELLFLAGS += -ex
99

1010
# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
1111
DPKG_EXPORT_BUILDFLAGS = 1
@@ -29,6 +29,16 @@ endif
2929
# package maintainers to append LDFLAGS
3030
#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
3131

32+
DOPACKAGES = $(shell dh_listpackages)
33+
34+
# For Debian jessie, stretch, and buster, and Ubuntu bionic and focal, build
35+
# Python 2 bindings. This is controlled by the build profile being used.
36+
ifneq (,$(filter python-pysairedis,$(DOPACKAGES)))
37+
configure_opts += --enable-python2
38+
else
39+
configure_opts += --disable-python2
40+
endif
41+
3242
clean:
3343
dh $@ --with autotools-dev
3444

0 commit comments

Comments
 (0)