debrepo/scripts/genPkgRel.sh

23 lines
763 B
Bash
Raw Normal View History

2023-04-22 14:06:00 +02:00
#!/bin/sh
LS="$(which ls)" # this prevents bugs when aliasing ls to tools like exa
2023-05-08 11:08:25 +02:00
DIR="$(cd "$(dirname "$0")" && pwd)"
REPODIR="$1"
2023-05-08 11:08:25 +02:00
DISTRO="$3"
if [ !$DISTRO ]; then
DISTRO="stable"
fi
ARCHS="$($LS -l $REPODIR/apt-repo/dists/$DISTRO/main/ | awk '{print $9}' | awk NF | awk -F - '{print $2}')"
2023-04-22 14:06:00 +02:00
# generate Packages file
2023-04-29 11:10:21 +02:00
for ARCH in $ARCHS; do
2023-05-08 11:08:25 +02:00
dpkg-scanpackages --multiversion --arch $ARCH "$REPODIR/apt-repo/pool/" > "$REPODIR/apt-repo/dists/$DISTRO/main/binary-$ARCH/Packages"
2023-04-29 11:10:21 +02:00
# compress Packages file
2023-05-08 11:08:25 +02:00
cat "$REPODIR/apt-repo/dists/$DISTRO/main/binary-$ARCH/Packages" | gzip -9 > "$REPODIR/apt-repo/dists/$DISTRO/main/binary-$ARCH/Packages.gz"
2023-04-29 11:10:21 +02:00
done
2023-04-22 14:06:00 +02:00
# generate Release file
2023-05-08 11:08:25 +02:00
cd "$REPODIR/apt-repo/dists/$DISTRO/"
$DIR/generate-release.sh $DISTRO > "Release"
2023-04-22 14:06:00 +02:00