forked from gapan/iso-creation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
01-downloadpackages.sh
executable file
·116 lines (105 loc) · 2.26 KB
/
01-downloadpackages.sh
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#!/bin/bash
export LANG=en_US
if [ "$UID" != "0" ]; then
echo "You need to be root to run this"
exit 1
fi
if [ -x /usr/bin/salix-update-notifier ]; then
echo "ERROR: salix-update-notifier should not be installed"
exit 1
fi
if [ ! -f USER ]; then
echo "No USER file."
exit 1
fi
user=`cat USER`
unlink lists
rm -f EDITION ARCH VERSION
answer="$(eval dialog \
--title \"Enter Salix version\" \
--stdout \
--inputbox \
\"Enter the salix version you want to create the iso for:\" \
0 0 )"
retval=$?
if [ $retval -eq 1 ] || [ $retval -eq 255 ]; then
exit 0
else
echo "$answer" > VERSION
VER=$answer
fi
answer="$(eval dialog \
--stdout \
--title \"Select edition\" \
--menu \"Select the edition you want to download packages for:\" \
0 0 0 \
'Xfce' 'o' \
'KDE' 'o' \
'MATE' 'o' \
'Ratpoison' 'o' \
'Openbox' 'o' \
'Fluxbox' 'o' \
'LXDE' 'o' \
'Core' 'o' \
'None' 'o' )"
retval=$?
if [ $retval -eq 1 ] || [ $retval -eq 255 ]; then
exit 0
else
echo "$answer" > EDITION
edition=`echo $answer | tr '[:upper:]' '[:lower:]'`
fi
ln -sf lists-$edition lists
answer="$(eval dialog --title \"Select arch\" \
--stdout \
--menu \"Select the target architecture:\" \
0 0 0 \
'i486' 'o' \
'x86_64' 'o')"
retval=$?
if [ $retval -eq 1 ] || [ $retval -eq 255 ]; then
exit 0
else
echo "$answer" > ARCH
arch=$answer
fi
slapt-get -u -c slapt-getrc.$arch
slapt-get --clean
{
AAAPKG=`cat lists/AAA`
KERNELPKG=`cat lists/KERNEL`
if [ $arch == "x86_64" ]; then
COREPKG=`cat lists/CORE lists/EFI`
else
COREPKG=`cat lists/CORE`
fi
if [ -f lists/BASIC ]; then
BASICPKG=`cat lists/BASIC`
else
BASICPKG=""
fi
if [ -f lists/FULL ]; then
FULLPKG=`cat lists/FULL`
else
FULLPKG=""
fi
if [[ "$arch" == "x86_64" ]]; then
if [ -f lists/EFI ]; then
EFIPKG=`cat lists/EFI`
fi
if [ -f lists/EFI-GUI ]; then
EFIGUIPKG=`cat lists/EFI-GUI`
fi
fi
SETTINGSPKG=`cat lists/SETTINGS`
for i in $AAAPKG $KERNELPKG $COREPKG $BASICPKG $FULLPKG $EFIPKG \
$EFIGUIPKG $SETTINGSPKG; do
slapt-get -d --no-dep --reinstall -c slapt-getrc.$arch -i $i
done
} 2>&1 | tee download-$arch.log
# chown everything back
chown -R ${user}:users ./*
grep "connect to server" download-$arch.log
grep "No such" download-$arch.log
grep "Write failed" download-$arch.log
grep "Failed" download-$arch.log