From 491b2b4f28f92012f7f2ddf962d9b936de5cf40d Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Mon, 18 May 2020 19:26:20 +0530 Subject: [PATCH 1/4] Fix logic for creating .deb --- tools/packaging/cpt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/packaging/cpt.py b/tools/packaging/cpt.py index 20191faa3..c187c6130 100755 --- a/tools/packaging/cpt.py +++ b/tools/packaging/cpt.py @@ -1075,6 +1075,7 @@ def debianize(): f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+') f.write('\n -- ' + SIGNING_USER + ' ' + formatdate(time.time(), tzinfo()) + '\n') f.close() + STABLE_FLAG = '0' else: TAG = VERSION.replace('v', '') if TAG == '0.1': @@ -1083,7 +1084,7 @@ def debianize(): f.close() STABLE_FLAG = '1' - while TAG != '0.1': + while TAG > '0.1': CMP = TAG TAG = str(float(TAG) - 0.1) if STABLE_FLAG != '1': From 1d34974ed7ab44acc6831700c56c9a5c34025078 Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Tue, 19 May 2020 17:54:39 +0530 Subject: [PATCH 2/4] Fix subprocess check_output invocation Replaced with direct call instead of cpt abstraction --- tools/packaging/cpt.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/packaging/cpt.py b/tools/packaging/cpt.py index c187c6130..ad473b189 100755 --- a/tools/packaging/cpt.py +++ b/tools/packaging/cpt.py @@ -1066,7 +1066,7 @@ def debianize(): if '~dev' in VERSION: TAG = str(float(VERSION[:VERSION.find('~')]) - 0.1) - template = exec_subprocess_check_output('git log v' + TAG + '...HEAD --format=" * %s" | fmt -s', CLING_SRC_DIR) + template = subprocess.check_output('git log v' + TAG + '...HEAD --format=" * %s" | fmt -s', cwd=CLING_SRC_DIR, shell=True).decode("utf-8") f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+') f.write(template) @@ -1092,8 +1092,7 @@ def debianize(): f.write('cling (' + TAG + '-1) unstable; urgency=low\n') f.close() STABLE_FLAG = '1' - template = exec_subprocess_check_output('git log v' + CMP + '...v' + TAG + '--format=" * %s" | fmt -s', - CLING_SRC_DIR) + template = subprocess.check_output('git log v' + CMP + '...v' + TAG + '--format=" * %s" | fmt -s', cwd=CLING_SRC_DIR, shell=True).decode("utf-8") f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+') f.write(template) @@ -1108,10 +1107,10 @@ def debianize(): f.write('\nOld Changelog:\n') f.close() - template = exec_subprocess_check_output('git log v0.1 --format=" * %s%n -- %an <%ae> %cD%n"', CLING_SRC_DIR) + template = subprocess.check_output('git log v0.1 --format=" * %s%n -- %an <%ae> %cD%n"', cwd=CLING_SRC_DIR, shell=True).decode("utf-8") f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+') - f.write(template.encode('utf-8')) + f.write(template) f.close() box_draw("Run debuild to create Debian package") From 0b0988f7342c858203f65e6def880119e4fad740 Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Tue, 19 May 2020 20:01:38 +0530 Subject: [PATCH 3/4] Fix debuild deb creation docs/ exists and the error should not be thrown; but removing the directory name from deb creation should fix the issue for now. --- tools/packaging/cpt.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/packaging/cpt.py b/tools/packaging/cpt.py index ad473b189..a83cd85f4 100755 --- a/tools/packaging/cpt.py +++ b/tools/packaging/cpt.py @@ -943,7 +943,6 @@ def debianize(): f = open(os.path.join(prefix, 'debian', 'cling.install'), 'w') template = ''' bin/* /usr/bin -docs/* /usr/share/doc include/* /usr/include lib/* /usr/lib share/* /usr/share From a6388bbe9bceaf7c7af6273bcfdf1a3697a29e28 Mon Sep 17 00:00:00 2001 From: Pratyush Das Date: Mon, 30 Nov 2020 21:56:32 +0530 Subject: [PATCH 4/4] Do not sign packaged deb file --- tools/packaging/cpt.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/packaging/cpt.py b/tools/packaging/cpt.py index a83cd85f4..a9e23c792 100755 --- a/tools/packaging/cpt.py +++ b/tools/packaging/cpt.py @@ -1113,7 +1113,7 @@ def debianize(): f.close() box_draw("Run debuild to create Debian package") - exec_subprocess_call('debuild', prefix) + exec_subprocess_call('debuild -us -uc', prefix) ###############################################################################