summarylogtreecommitdiffstats
path: root/upgrade_helper.sh
blob: 961c3d1efeb465a43c94fb5d54e7af085336506e (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash

echo "update pkgver in PKGBUILD"
read

echo "Downloading files (checks will fail)"
makepkg --verifysource
CARCH=x86 makepkg --verifysource

source PKGBUILD
anaconda_x86_64=Anaconda3-${pkgver}-Linux-x86_64.sh
anaconda_x86=Anaconda3-${pkgver}-Linux-x86.sh
cp $anaconda_x86_64 ${anaconda_x86_64}.old
cp $anaconda_x86 ${anaconda_x86}.old

echo "Modify $anaconda_x86 and $anaconda_x86_64"
read

diff -u ${anaconda_x86_64}.old $anaconda_x86_64 > installer_sh_x86_64.patch
diff -u ${anaconda_x86}.old $anaconda_x86 > installer_sh_x86.patch

mv -f ${anaconda_x86_64}.old $anaconda_x86_64
mv -f ${anaconda_x86}.old $anaconda_x86

echo "Clean installer_sh_x86_64.patch and installer_sh_x86.patch (update header and remove tail)"
read

updpkgsums
sha256sum $anaconda_x86
echo "update sha256sum for $anaconda_x86 in PKGBUILD"
read
BREAK_EARLY=1 makepkg
grep CONDA_INSTALL= installer_sh_x86_64.patch
echo "Edit conda_install patch to have correct conda version in header"
read

cd pkg/anaconda/opt/anaconda/
conda_install=`ls -1 pkgs/conda-3.*/lib/python*/site-packages/conda/install.py`
cp $conda_install ${conda_install}.old
echo "Trying patch as is:"
patch -p1 < ../../../../conda_install.patch

diff -u ${conda_install}.old ${conda_install} > ../../../../conda_install.patch

cd -

echo "Check conda_install.patch and update header"

read
updpkgsums
grep CONDA_INSTALL= installer_sh_x86_64.patch
grep PYTHON= installer_sh_x86_64.patch
echo "Update _pythonver and _condaver in PKGBUILD"
read

echo "upgrading srcinfo"
mksrcinfo
echo "Done"