blob: 36dc65c1eb8b7f210831fe547dbc43c70f12e2bc (
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
|
#!/bin/bash
if [ $# -eq 2 ]; then
from="$1"
to="$2"
elif [ $# -ne 0 ]; then
>&2 echo 'usage: report-installed-packages [from to]'
exit 1
fi
content=$(
(
find '/var/lib/pacman/sync' -mindepth 1 -maxdepth 1 \
-name '*testing.db' \
-exec bsdtar -tf {} \; | \
sed -n '
/\/$/{
s|/$||
p
}
'
pacman -Q | \
tr ' ' '-'
) | \
sort | \
uniq -d
)
content=$(
cd '/var/cache/pacman/pkg'
ls | \
sed 's|^\(.*\)-|\1 \0|' | \
sort -k1,1 | \
join -1 1 -2 1 -o 1.2 - <(echo "${content}") | \
xargs -r sha512sum
)
if [ -z "${to}" ] || [ -z "${from}" ]; then
echo "${content}"
elif [ -n "${content}" ]; then
printf '%s\n' \
"From: ${from}" \
"To: ${to}" \
"Subject: $(uname -n) - report about installed i686 packages" \
"" \
"$(
printf '%s\n' "${content}" | \
sed 's|^|stabilize: |'
)" | \
sendmailadvanced
fi
|