-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
update-local-repo.sh
executable file
·45 lines (39 loc) · 1.19 KB
/
update-local-repo.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
45
#!/bin/bash
set -e
[ -z "$1" ] && { echo "Usage: $0 <dist>"; exit 1; }
REPO_DIR="$BUILDER_REPO_DIR"
DIST=$1
mkdir -p "$REPO_DIR"
cd "$REPO_DIR"
mkdir -p "dists/$DIST/main/binary-amd64"
if [ "${DIST}" == 'jammy' ] && [ -e "${CHROOT_DIR}/usr/bin/sh" ]; then
case "$BUILDER_REPO_DIR" in
*qubes-packages-mirror-repo*)
sudo chroot "${CHROOT_DIR}" sh -c "cd /tmp/qubes-deb && dpkg-scanpackages --multiversion . > dists/$DIST/main/binary-amd64/Packages"
;;
esac
else
dpkg-scanpackages --multiversion . > "dists/$DIST/main/binary-amd64/Packages"
fi
gzip -9c "dists/$DIST/main/binary-amd64/Packages" > "dists/$DIST/main/binary-amd64/Packages.gz"
cat > "dists/$DIST/Release" <<EOF
Label: Qubes builder repo
Suite: $DIST
Codename: $DIST
Date: $(LC_ALL=C date -u +"%a, %d %b %Y %H:%M:%S %Z")
Architectures: amd64
Components: main
SHA256:
EOF
calc_sha1() {
f="dists/$DIST/$1"
echo -n " "
echo -n "$(sha256sum "$f" | cut -d' ' -f 1)" ""
echo -n "$(stat -c %s "$f")" ""
echo "$1"
}
calc_sha1 main/binary-amd64/Packages >> "dists/$1/Release"
calc_sha1 main/binary-amd64/Packages.gz >> "dists/$1/Release"
if [ "$(id -u)" -eq 0 ]; then
chown -R --reference=. .
fi