-
Notifications
You must be signed in to change notification settings - Fork 0
/
extractarm
executable file
·42 lines (38 loc) · 970 Bytes
/
extractarm
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
#!/bin/bash
if [ $# -lt 4 ]; then
echo "$0 arch version package_name (example: $0 aarch64 1.1.1 exlude_name alsa-lib)"
exit 1
fi
arch=$1
shift
version=$1
shift
exclude=$1
shift
REPO=/repo/arm
if [ -e ${HOME}/.config/scripts_opts ]; then
. ${HOME}/.config/scripts_opts
REPO=${LOCAL_REPO}/arm
fi
if [ ${arch} = "all" ]; then
arch="aarch64 aarch32 armv6k armv7a thumb2"
elif [ ${arch} = "armv7-a" ]; then
arch=armv7a
elif [ ${arch} = "armv7-a-hf" ]; then
arch=thumb2
elif [ ${arch} = "armv8-a" -o ${arch} = "armv8a" ]; then
arch=aarch64
elif [ ${arch} = "armv8l" -o ${arch} = "aarch32" ]; then
arch=armv8l
fi
for a in ${arch}
do
for pkg in $@
do
if [ ${exclude} != none ]; then
find ${REPO}/${a} -name "*${pkg}*" | grep ${version} | grep -v ${exclude} | xargs rpmextarm ${pkg}
else
find ${REPO}/${a} -name "*${pkg}*" | grep ${version} | xargs rpmextarm ${pkg}
fi
done
done