-
Notifications
You must be signed in to change notification settings - Fork 83
/
utils.sh
executable file
·28 lines (25 loc) · 1.03 KB
/
utils.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
#!/bin/bash
# Description: generate debian packages list, using moinmoin wiki markup for https://wiki.debian.org/Multimedia
# Requirements: bash sed grep cut. Debian Unstable sources list enabled (main contrib non-free sections).
set -o errexit
set -o nounset
set -o pipefail
function _getdescription() {
package="$1"
LANG=C apt-cache show "$package" | grep -E "^Description:" | cut -d" " -f1 --complement
}
moinmoin_markup=$(sed -n '/<!-- BEGIN SOFTWARE LIST -->/,/<!-- END SOFTWARE LIST -->/p' README.md | \
grep -E "#|◼|^$" | \
sed -e 's/#/=/g' | \
sed -e "s/\*\*/\'\'/g" | \
sed 's/^\(=*\)\(.*\)/\1\2 \1/' | \
sed 's|.*https://packages.debian.org/sid/\(.*\))).*|\1|g' | \
sed 's/^\([a-zA-Z]\)/ \* DebPkg:\1/')
echo "$moinmoin_markup" | while read line; do
if [[ "$line" =~ DebPkg ]]; then
package=${line#*:}
echo " * DebPkg:$package - $(_getdescription $package)"
else
echo "$line"
fi
done