-
Notifications
You must be signed in to change notification settings - Fork 0
/
update
executable file
·69 lines (51 loc) · 1.75 KB
/
update
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
#!/bin/sh
sudo apt -q update
ALL_PACKAGES=$(apt-cache -q search multiflexi | awk '{print $1}')
echo $ALL_PACKAGES
# define blacklist of packages to be grep'ed out
OPTIONAL_PACKAGES="
multiflexi-all
multiflexi-mysql
multiflexi-pgsql
multiflexi-sqlite
multiflexi-podman
"
BLOCKED_PACKAGES="
multiflexi-pohoda-client-config
"
# Remove optional packages from the list of all packages
for i in $OPTIONAL_PACKAGES
do
ALL_PACKAGES=$(echo $ALL_PACKAGES | sed "s/$i//g")
done
# Remove blocked packages from the list of all packages
for i in $BLOCKED_PACKAGES
do
ALL_PACKAGES=$(echo $ALL_PACKAGES | sed "s/$i//g")
done
echo
echo "######################### Packages included ######################################"
echo
echo $ALL_PACKAGES | sed "s/ /\n/g"
echo
echo "##################################################################################"
# Replace spaces with commas in the list of all packages
ALL_PACKAGES=$(echo $ALL_PACKAGES | sed "s/ /,/g")
# Replace Depends: in file debian/control by $ALL_PACKAGES
sed "s/^Depends:.*/Depends: $ALL_PACKAGES/g" debian/control.template > debian/control
# Cut everything after ## Packages included in README.md
sed -i '/## Packages included/,$d' README.md
# Update README.md file with current ALL_PACKAGES contents
echo >> README.md
echo "## Packages included" >> README.md
echo >> README.md
echo "| Name | URL |" >> README.md
echo "|------|-----|" >> README.md
for package in $(echo "$ALL_PACKAGES" | tr ',' '\n'); do
url=$(aptitude show $package | grep -m1 '^Homepage:' | awk '{print $2}')
echo "| $package | $url |" >> README.md
done
echo >> README.md
echo "Please refer to the individual package documentation for more information." >> README.md
sudo chmod 644 debian/control
sudo chown jenkins:jenkins debian/control