mirror of
				https://github.com/iiab/iiab.git
				synced 2025-03-09 15:40:17 +00:00 
			
		
		
		
	Merge pull request #3715 from holta/py2
Touch-ups for: scripts/install_python2_kalite-venv_u2404.sh
This commit is contained in:
		
						commit
						e990395fc6
					
				
					 2 changed files with 53 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -48,6 +48,7 @@
 | 
			
		|||
    virtualenv_command: virtualenv    # Traditionally /usr/bin/virtual/env -- but install_python2.sh (for Ubuntu 23.10+) sets up /usr/local/bin/virtualenv
 | 
			
		||||
    virtualenv_python: python2.7
 | 
			
		||||
    extra_args: "--no-use-pep517 --no-cache-dir --no-python-version-warning"
 | 
			
		||||
  when: not (is_ubuntu_2404 is defined and is_ubuntu_2404)
 | 
			
		||||
  #when: not (is_debian_9 or is_debian_10 or is_ubuntu_16 or is_ubuntu_17 or is_ubuntu_18 or is_ubuntu_19)
 | 
			
		||||
  # long form of (is_debian_11+ or is_ubuntu_20+)
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -60,6 +61,11 @@
 | 
			
		|||
    virtualenv_command: virtualenv
 | 
			
		||||
    virtualenv_python: python2.7
 | 
			
		||||
    extra_args: "--no-cache-dir"
 | 
			
		||||
  when: not (is_ubuntu_2404 is defined and is_ubuntu_2404)
 | 
			
		||||
 | 
			
		||||
- name: Run scripts/install_python2_kalite-venv_u2404.sh if Ubuntu 24.04
 | 
			
		||||
  command: bash "{{ iiab_dir }}/scripts/install_python2_kalite-venv_u2404.sh"
 | 
			
		||||
  when: is_ubuntu_2404 is defined and is_ubuntu_2404
 | 
			
		||||
 | 
			
		||||
- name: "Install from templates: venv wrapper /usr/bin/kalite, unit file /etc/systemd/system/kalite-serve.service"
 | 
			
		||||
  template:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										47
									
								
								scripts/install_python2_kalite-venv_u2404.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										47
									
								
								scripts/install_python2_kalite-venv_u2404.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,47 @@
 | 
			
		|||
#!/bin/bash
 | 
			
		||||
export DEBIAN_FRONTEND=noninteractive
 | 
			
		||||
 | 
			
		||||
cat << EOF > /etc/apt/sources.list.d/python2.list
 | 
			
		||||
deb [trusted=yes] http://archive.ubuntu.com/ubuntu jammy main universe
 | 
			
		||||
deb [trusted=yes] http://archive.ubuntu.com/ubuntu jammy-updates main universe
 | 
			
		||||
EOF
 | 
			
		||||
 | 
			
		||||
apt update
 | 
			
		||||
 | 
			
		||||
apt -y --allow-downgrades install python3.11=3.11.0~rc1-1~22.04 python3.11-minimal=3.11.0~rc1-1~22.04 libpython3.11-stdlib=3.11.0~rc1-1~22.04 libpython3.11-minimal=3.11.0~rc1-1~22.04
 | 
			
		||||
apt-mark hold python3.11 python3.11-minimal libpython3.11-stdlib libpython3.11-minimal
 | 
			
		||||
 | 
			
		||||
apt -y --allow-downgrades install python3-platformdirs=2.5.1-1
 | 
			
		||||
apt-mark hold python3-platformdirs
 | 
			
		||||
 | 
			
		||||
apt -y install python2
 | 
			
		||||
apt -y install python2-pip-whl python2-setuptools-whl
 | 
			
		||||
 | 
			
		||||
apt -y --allow-downgrades install python3-pip-whl=22.0.2+dfsg-1
 | 
			
		||||
apt-mark hold python3-pip-whl
 | 
			
		||||
 | 
			
		||||
apt -y --no-install-recommends install python3-pip=22.0.2+dfsg-1
 | 
			
		||||
apt-mark hold python3-pip
 | 
			
		||||
 | 
			
		||||
apt -y --allow-downgrades install python3-virtualenv=20.13.0+ds-2
 | 
			
		||||
apt-mark hold python3-virtualenv
 | 
			
		||||
 | 
			
		||||
apt -y --allow-downgrades install virtualenv=20.13.0+ds-2
 | 
			
		||||
apt-mark hold virtualenv
 | 
			
		||||
 | 
			
		||||
virtualenv --always-copy --pip 20.3.4 --setuptools 44.1.1 --no-wheel -p python2.7 /usr/local/kalite/venv
 | 
			
		||||
 | 
			
		||||
cd /usr/local/kalite/venv
 | 
			
		||||
source bin/activate
 | 
			
		||||
bin/pip install ka-lite-static --no-python-version-warning --no-cache-dir
 | 
			
		||||
deactivate
 | 
			
		||||
 | 
			
		||||
#apt -y remove `apt list *python2* | grep installed | awk -F / '{ print $1 }'`
 | 
			
		||||
apt-mark unhold `apt-mark showhold`
 | 
			
		||||
 | 
			
		||||
rm /etc/apt/sources.list.d/python2.list
 | 
			
		||||
 | 
			
		||||
apt -y remove libmpdec3 python3-pip python3-wheel
 | 
			
		||||
 | 
			
		||||
apt update
 | 
			
		||||
apt -y upgrade
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue