-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_packages_alien_restricted
executable file
·101 lines (62 loc) · 2.39 KB
/
install_packages_alien_restricted
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
#!/bin/bash
################################################################
# #
# Instalador e atualizador de pacotes do alienbob no Slackware #
# #
# By Mauricio Ferrari #
# #
# #
# Precisa ser root. #
# #
################################################################
[ $UID != 0 ] && { echo -e "\nExecute como Root !\n"; exit 1; }
packages="ffmpeg vlc"
exception="" # Isso aqui é pra mim
dir="_Packages"
file="FILELIST.TXT"
[ -e "../_ALIEN_RESTRICTED" ] && dir="../_ALIEN_RESTRICTED" || { mkdir -p "$dir"; chown 1000:users "$dir"; } # Isso aqui é pra mim
cd "$dir"
: "$(grep "VERSION_ID" /etc/os-release)"; slackver="${_#*=}"
case "$(uname -m)" in
i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
*) export ARCH=$(uname -m) ;;
esac
function down
{
wget -c "$link0/$1"
chown 1000:users $2
}
link0="https://slackware.uk/people/alien/restricted_slackbuilds"
[ ! -e "$file" ] && down "$file" "$file" || {
sam0="$(grep -E "$file" <(links -dump "$link0/CHECKSUMS.md5"))"
sam1="$(md5sum "$file")"
[ ${sam0%[ ]*} != ${sam1%[ ]*} ] && {
rm "$file"
down "$file" "$file"
}
}
cd "/var/log/packages"
lst=$(printf "%s\n" *)
cd -
loop=0
while [ $loop == 0 ]; do
loop=1
intermediario=""
for prg in $packages
{
test -n "$(grep -o "$prg" <<< "$exception")" && continue
pkg="$(grep -Eom1 "pkg[0-9]*[/]$slackver[/]$prg[-]([0-9]+[.])+[0-9]+[-]([aA-zZ]*[0-9]*[_]*)+$ARCH[-][0-9]+alien" "$file")"
test -n "$(grep -Eo "$pkg.dep" "$file")" && {
[ ! -e "${pkg##*[/]}.dep" ] && down "$prg/$pkg.dep" "${pkg##*[/]}.dep"
[ -e "${pkg##*[/]}.dep" ] && {
loop=0
intermediario="$intermediario $(< "${pkg##*[/]}.dep") "
} || continue
}
down "$(grep -Eom1 $prg/$pkg[.]t[a-z]z "$file")" ${pkg##*[/]}.t?z
[ -e ${pkg##*[/]}.t?z ] && /sbin/upgradepkg --install-new --reinstall ${pkg##*[/]}.t?z
}
[ $loop == 0 ] && packages="$intermediario"
done
exit 0