Skip to content

Commit

Permalink
Added fixes for debian packaging
Browse files Browse the repository at this point in the history
Fixes for debian packaging credit to dimitry-ishenko and reik on the
issue tracker
  • Loading branch information
saisoma123 authored and jenkins committed Jan 2, 2025
1 parent bbd1c0a commit ee36b3a
Showing 1 changed file with 22 additions and 11 deletions.
33 changes: 22 additions & 11 deletions tools/packaging/cpt.py
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,8 @@ def tarball_deb():


def debianize():
SIGNING_USER = exec_subprocess_check_output('gpg --fingerprint | grep uid | sed s/"uid *"//g',
CLING_SRC_DIR).strip()
SIGNING_USER = exec_subprocess_check_output('sh -c "gpg --fingerprint | grep uid | sed \'s/uid *//g\'"',
CLING_SRC_DIR).strip()

box_draw("Set up the debian directory")
print("Create directory: debian")
Expand Down Expand Up @@ -1057,10 +1057,8 @@ 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
'''
f.write(template.strip())
f.close()
Expand Down Expand Up @@ -1177,10 +1175,11 @@ def debianize():
''' % (VERSION, VERSION)
f.write(template.lstrip())
f.close()


STABLE_FLAG = ''
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 = exec_subprocess_check_output('sh -c "git log v' + TAG + '...HEAD --format=\' * %s\' | fmt -s"', CLING_SRC_DIR)

f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+')
f.write(template)
Expand All @@ -1199,14 +1198,14 @@ def debianize():

while TAG != '0.1':
CMP = TAG
TAG = str(float(TAG) - 0.1)
TAG = str(round(float(TAG) - 0.1, 1))
if STABLE_FLAG != '1':
f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+')
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 = exec_subprocess_check_output('sh -c "git log v' + CMP + '...v' + TAG + ' --format=\' * %s\' | fmt -s"',
CLING_SRC_DIR)

f = open(os.path.join(prefix, 'debian', 'changelog'), 'a+')
f.write(template)
Expand All @@ -1224,11 +1223,11 @@ def debianize():
template = exec_subprocess_check_output('git log v0.1 --format=" * %s%n -- %an <%ae> %cD%n"', CLING_SRC_DIR)

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")
exec_subprocess_call('debuild', prefix)
exec_subprocess_call('debuild -us -uc', prefix)


###############################################################################
Expand Down Expand Up @@ -2303,6 +2302,18 @@ def custom_input(prompt, always_yes=False):
travis_fold_end("git-clone")

revision = set_version()

progress_dir = exec_subprocess_check_output('find . -name ProgressBar.py', srcdir)
if progress_dir[-1:] == "\n":
progress_dir = progress_dir[:-1]
with open(os.path.join(srcdir, progress_dir), 'r+') as file:
file.write("from importlib import reload")
newline=[]
for word in file.readlines():
newline.append(word.replace("sys.setdefaultencoding('utf8')","# sys.setdefaultencoding('utf8')"))
for line in newline:
file.writelines(line)

if args['current_dev'] == 'tar':
if OS == 'Windows':
get_win_dep()
Expand Down

0 comments on commit ee36b3a

Please sign in to comment.