-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathupdate
More file actions
executable file
·54 lines (40 loc) · 1.97 KB
/
update
File metadata and controls
executable file
·54 lines (40 loc) · 1.97 KB
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
#!/bin/sh
sudo apt -q update
ALL_PACKAGES=$(apt-cache -q search multiflexi | awk '{print $1}')
# define blacklist of packages to be filtered out
OPTIONAL_PACKAGES="multiflexi-all multiflexi-mysql multiflexi-pgsql multiflexi-sqlite multiflexi-podman"
BLOCKED_PACKAGES="multiflexi-pohoda-client-config php-vitexsoftware-multiflexi-core php-vitexsoftware-multiflexi-core-dev php-vitexsoftware-multiflexi-server php-vitexsoftware-multiflexi-server-dev"
# Remove optional and blocked packages from the list of all packages using grep for POSIX sh compatibility
ALL_PACKAGES_LIST=$(echo "$ALL_PACKAGES" | tr ' ' '\n')
for pkg in $OPTIONAL_PACKAGES $BLOCKED_PACKAGES; do
ALL_PACKAGES_LIST=$(echo "$ALL_PACKAGES_LIST" | grep -vwF "$pkg")
done
ALL_PACKAGES=$(echo "$ALL_PACKAGES_LIST" | tr '\n' ' ')
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
if id "jenkins" >/dev/null 2>&1; then
sudo chown jenkins:jenkins debian/control
fi