-
Notifications
You must be signed in to change notification settings - Fork 3
/
update-package-info.sh
executable file
·45 lines (33 loc) · 1.1 KB
/
update-package-info.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash
set -e
SELF_DIR="$(dirname $(readlink -f $0))"
source "$SELF_DIR/config.sh"
function update_thread() {
local repo_name_and_folder="$1"
local channel_path="dists/$repo_name_and_folder"
local i
echo " * Scanning $channel_path"
dpkg-scanpackages -m $channel_path > $channel_path/Packages
xz -9c $channel_path/Packages > $channel_path/Packages.xz
echo " * Update thread for $repo_name_and_folder done"
}
declare -A CODE_NAMES
for REPO_NAME in ${!REPOS[@]}; do
code_name="$(dirname $REPO_NAME)"
CODE_NAMES[$code_name]="1"
for folder in `ls dists/$REPO_NAME`; do
if [[ -d "dists/$REPO_NAME/$folder" ]]; then
echo " * Update thread for $REPO_NAME/$folder started"
update_thread "$REPO_NAME/$folder" &
fi
done
done
PROC_NAME="$(ps $$ | grep $$ | cut -d' ' -f13)"
trap "echo ' * Killing'; pkill $PROC_NAME" INT
wait
for CODE_NAME in ${!CODE_NAMES[@]}; do
echo " * Building code name $CODE_NAME"
(cd dists/stable && ./gen-files.sh)
done
find dists -type f -name "*.deb" > filelist.local
cat filelist.local > filelist