-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwine-python3.sh
More file actions
37 lines (30 loc) · 1.5 KB
/
wine-python3.sh
File metadata and controls
37 lines (30 loc) · 1.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env sh
set -e
set -x
HELPERSCACHE="/helperscache"
WINEATOMIC="/wine-atomic.sh"
DIRECTINSTALL="${1}"
ARG_CACHEPATH="${2}"
$WINEATOMIC reg add "HKCU\\SYSTEM\\CurrentControlSet\\Control\\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
ARCHITECTURE="$(dpkg --print-architecture)" ; if [ "${ARCHITECTURE}" = "amd64" ] ; then PARTARCH="amd64" ; else if [ "${ARCHITECTURE}" = "arm64" ] ; then PARTARCH="arm64" ; fi ; fi
[ "${PARTARCH}" != "" ]
LSBRELEASE="$(lsb_release -c | cut -f2)"
PYTHONRAWDATA="$(/helpers/wget-with-retries.sh "https://qa.debian.org/madison.php?package=python3&table=debian&s=${LSBRELEASE}&text=on" -)"
PYTHONVERSION="$(echo "${PYTHONRAWDATA}" | awk '{print $3}' | awk -F- '{print $1}' | head -n 1)"
[ "${PYTHONVERSION}" != "" ]
FILENAME="python-$PYTHONVERSION-${PARTARCH}.exe"
DOWNLOADURL="https://www.python.org/ftp/python/$PYTHONVERSION/${FILENAME}"
LOCALCACHEDIRECTORY="${ARG_CACHEPATH}"
if [ -z "${LOCALCACHEDIRECTORY}" ] ; then
LOCALCACHEDIRECTORY="/tmp/pythoncache"
fi
mkdir -p "${LOCALCACHEDIRECTORY}"
LOCALCACHEFILENAME="${LOCALCACHEDIRECTORY}/${FILENAME}"
if [ ! -f "${LOCALCACHEFILENAME}" ] ; then
rm -f "${LOCALCACHEFILENAME}"
mkdir -p "${LOCALCACHEDIRECTORY}"
/helpers/wget-with-retries.sh "${DOWNLOADURL}" "${LOCALCACHEFILENAME}"
fi
[ -f "${LOCALCACHEFILENAME}" ]
$WINEATOMIC "$(winepath ${LOCALCACHEFILENAME})" /quiet InstallAllUsers=1 InstallLauncherAllUsers=1 Include_launcher=1 AssociateFiles=1 PrependPath=1 Include_doc=0 Shortcuts=0
$WINEATOMIC python.exe --version