Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build source index #27

Merged
merged 1 commit into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions create_dist
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ for arch in all amd64 arm64; do
echo " $hash $size main/binary-$arch/Packages.gz" >> "$index_files"
done

dir="$target/dists/$dist/main/source"
mkdir -p "$dir"
(cd "$target" && dpkg-scansources pool) > "$dir/Sources"

size="$(wc -c "$dir/Sources" | awk '{ print $1 }')"
hash="$(sha256sum "$dir/Sources" | head -c 64)"
echo " $hash $size main/source/Sources" >> "$index_files"
gzip < "$dir/Sources" > "$dir/Sources.gz"
rm "$dir/Sources"
size="$(wc -c "$dir/Sources.gz" | awk '{ print $1 }')"
hash="$(sha256sum "$dir/Sources.gz" | head -c 64)"
echo " $hash $size main/source/Sources.gz" >> "$index_files"

date="$(date -R -u)"

cat << EOF | gpg --clearsign > "$target/dists/$dist/InRelease"
Expand Down
19 changes: 19 additions & 0 deletions download_pkgs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ find download -name "*_all.deb" -or -name "*_$arch.deb" | sort | while read -r p
cp --update=none "$pkg" "$target/pool/$hash/"
done

find download -name "*.dsc" | sort | while read -r src; do
hash="$(sha256sum < "$src" | head -c 64)"
mkdir -p "$target/pool/$hash"
cp --update=none "$src" "$target/pool/$hash/$(basename "$src")"
awk '/^Files:$/ { flag = 1; next } !/^ / { flag = 0; } flag { print $3 }' < "$src" | while read f; do
cp --update=none "download/$f" "$target/pool/$hash/$f"
done
done

rm -rf download
sort -o pkgs -u pkgs

Expand All @@ -48,6 +57,7 @@ join -v 1 <(cat arch_import_list recursive_depends | sort | uniq) pkgs | { grep

mkdir apt_download
(cd apt_download && xargs apt-get download) < recursive_needed
(cd apt_download && xargs apt-get source --download-only) < recursive_needed

find apt_download -name "*.deb" | while read -r pkg; do
hash="$(sha256sum < "$pkg" | head -c 64)"
Expand All @@ -56,4 +66,13 @@ find apt_download -name "*.deb" | while read -r pkg; do
rm "$pkg"
done

find apt_download -name "*.dsc" | while read -r src; do
hash="$(sha256sum < "$src" | head -c 64)"
mkdir -p "$target/pool/$hash"
cp --update=none "$src" "$target/pool/$hash/$(basename "$src")"
awk '/^Files:$/ { flag = 1; next } !/^ / { flag = 0; } flag { print $3 }' < "$src" | while read f; do
cp --update=none "apt_download/$f" "$target/pool/$hash/$f"
done
done

rm -rf apt_download