Skip to content

Commit 3a7ae51

Browse files
committed
Fix Debian packaging when using --byte-code-only
1 parent 0dcbbd3 commit 3a7ae51

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

cpydist/bdist_deb.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2020, Oracle and/or its affiliates.
1+
# Copyright (c) 2020, 2021, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0, as
@@ -255,10 +255,13 @@ def _populate_debian(self):
255255
"".format(copyright_file))
256256
with open(copyright_file, "r") as fp:
257257
# Skip to line just before the text we want to copy
258-
while not fp.readline().startswith("License: Commercial"):
259-
continue
260-
# Read the rest of the text (add a space before each line)
261-
lic_text = fp.read()
258+
while True:
259+
line = fp.readline()
260+
if not line:
261+
break
262+
if line.startswith("License: Commercial"):
263+
# Read the rest of the text
264+
lic_text = fp.read()
262265

263266
with open(control_file, "r") as fp:
264267
control_text = fp.read()

cpydist/data/deb/rules

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
3131

3232
export DH_VERBOSE = 1
33+
export PYBUILD_DISABLE=test
3334
export PYBUILD_DISABLE_python2=1
3435

3536
PY3_BUILD_LIB_OPT = --build-lib=build/python3
@@ -82,9 +83,6 @@ endif
8283
%:
8384
dh $@ --with python3 --buildsystem=pybuild
8485

85-
override_dh_auto_test:
86-
echo "skipping test"
87-
8886
override_dh_auto_install:
8987

9088
set -xe; \
@@ -104,7 +102,9 @@ override_dh_auto_install:
104102
done
105103

106104
override_dh_python3:
107-
dh_python3 --no-ext-rename
105+
ifeq ($(BYTE_CODE_ONLY),)
106+
py3clean .
107+
endif
108108

109109
ifneq ($(BYTE_CODE_ONLY),)
110110
override_dh_pysupport:

0 commit comments

Comments
 (0)