Commit 05db9170 authored by Holger Levsen's avatar Holger Levsen

reproducible Debian: sha1 checker: deal with packages with more than one version

Signed-off-by: Holger Levsen's avatarHolger Levsen <holger@layer-acht.org>
parent 50272048
...@@ -60,10 +60,10 @@ mkdir -p $SHA1DIR ...@@ -60,10 +60,10 @@ mkdir -p $SHA1DIR
PACKAGES=$(mktemp --tmpdir=$TMPDIR sha1-pkgs-XXXXXXX) PACKAGES=$(mktemp --tmpdir=$TMPDIR sha1-pkgs-XXXXXXX)
schroot --directory $SHA1DIR -c chroot:jenkins-reproducible-${RELEASE}-diffoscope cat /var/lib/apt/lists/cdn-fastly.deb.debian.org_debian_dists_${RELEASE}_main_binary-amd64_Packages > $PACKAGES schroot --directory $SHA1DIR -c chroot:jenkins-reproducible-${RELEASE}-diffoscope cat /var/lib/apt/lists/cdn-fastly.deb.debian.org_debian_dists_${RELEASE}_main_binary-amd64_Packages > $PACKAGES
case "$MODE" in case "$MODE" in
random) SORT="sort -R";; random) SORT="sort -u -R";;
reverse) SORT="sort -r" ;; reverse) SORT="sort -u -r" ;;
forward) SORT="sort" ;; forward) SORT="sort -u" ;;
*) SORT="sort" ; MODE="results" ; RESULTS=$(mktemp --tmpdir=$TMPDIR sha1-results-XXXXXXX) ; find $SHA1DIR -name "*REPRODUCIBLE.buster" > $RESULTS ;; *) SORT="sort -u" ; MODE="results" ; RESULTS=$(mktemp --tmpdir=$TMPDIR sha1-results-XXXXXXX) ; find $SHA1DIR -name "*REPRODUCIBLE.buster" > $RESULTS ;;
esac esac
packages="$(grep ^Package: $PACKAGES| awk '{print $2}' | $SORT | xargs echo)" packages="$(grep ^Package: $PACKAGES| awk '{print $2}' | $SORT | xargs echo)"
...@@ -159,10 +159,10 @@ for package in $packages ; do ...@@ -159,10 +159,10 @@ for package in $packages ; do
else else
touch $LOCK touch $LOCK
fi fi
version=$(grep-dctrl -X -P ${package} -s version -n $PACKAGES) version=$(grep-dctrl -X -P ${package} -s Version -n $PACKAGES | head -1)
arch=$(grep-dctrl -X -P ${package} -s Architecture -n $PACKAGES) arch=$(grep-dctrl -X -P ${package} -s Architecture -n $PACKAGES | head -1)
package_file="${package}_$(echo $version | sed 's#:#%3a#')_${arch}.deb" package_file="${package}_$(echo $version | sed 's#:#%3a#')_${arch}.deb"
pool_dir="$SHA1DIR/$(dirname $(grep-dctrl -X -P ${package} -s Filename -n $PACKAGES))" pool_dir="$SHA1DIR/$(dirname $(grep-dctrl -X -P ${package} -s Filename -n $PACKAGES | head -1))"
mkdir -p $pool_dir mkdir -p $pool_dir
cd $pool_dir cd $pool_dir
if [ ! -e ${package_file}.sha1output ] ; then if [ ! -e ${package_file}.sha1output ] ; then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment