debcheck: Get components list from pgapt.conf
authorChristoph Berg <myon@debian.org>
Fri, 8 Jan 2021 16:34:54 +0000 (17:34 +0100)
committerChristoph Berg <myon@debian.org>
Fri, 8 Jan 2021 16:34:54 +0000 (17:34 +0100)
jenkins/builddebcheck-pgapt
jenkins/debcheck-pgapt

index 5a0512011b70ef65f41dff496e139794d0735f5c..b93362dd118d94295c6cd3d01b9d3d700fb0f8b0 100755 (executable)
@@ -55,15 +55,13 @@ case $stage in
   *) error "Bad stage $stage" ;;
 esac
 
-wget --mirror http://$DISTSDIR/$DIST/main/binary-$architecture/Packages.bz2
-bunzip2 -fk $DISTSDIR/$DIST/main/binary-$architecture/Packages.bz2
-
-PKG="$PKG $DISTSDIR/$DIST/main/binary-${architecture}/Packages"
+# download apt.pg.o packages files
+wget --mirror $(for component in $COMPONENTS; do echo http://$DISTSDIR/$DIST/$component/binary-$architecture/Packages.bz2 http://$DISTSDIR/$DIST/$component/source/Sources.bz2; done)
+bunzip2 -fk $(for component in $COMPONENTS; do echo $DISTSDIR/$DIST/$component/binary-$architecture/Packages.bz2 $DISTSDIR/$DIST/$component/source/Sources.bz2; done)
+echo
 
 # packages not depending on backports
-wget --mirror http://$DISTSDIR/$DIST/main/source/Sources.bz2
-bunzip2 -fk $DISTSDIR/$DIST/main/source/Sources.bz2
-
+PKG="$PKG $DISTSDIR/$DIST/main/binary-${architecture}/Packages"
 MAINSRC=$DISTSDIR/$DIST/main/source/Sources
 
 if [ "$HAS_BACKPORTS" ]; then
@@ -110,11 +108,13 @@ if test -s "${BPO:-}"; then
   echo
 fi
 
-for component in $DISTSDIR/$DIST/{?.?,??}/source/Sources.gz; do
-  [ $(zcat $component | wc -c) = 0 ] && continue # skip empty file
-  echo "### Running builddebcheck: $component"
-  zcat $component | grep '^Package:'
-  ( set -x; $BUILDDEBCHECK $PKG $component ) || EXIT=1
+for component in $COMPONENTS; do
+  [ "$component" = "main" ] && continue
+  sources="$DISTSDIR/$DIST/$component/source/Sources"
+  [ -s $sources ] || continue # skip empty file
+  echo "### Running builddebcheck: $sources"
+  grep '^Package:' $sources
+  ( set -x; $BUILDDEBCHECK $PKG $sources ) || EXIT=1
   echo
 done
 
index cf29fed8756761ae7601787698677858957c3a2c..5c84654de53f538ebac39372cb91fb437435edb3 100755 (executable)
@@ -44,8 +44,10 @@ case $stage in
        *) error "Bad stage $stage" ;;
 esac
 
-wget --mirror http://$DISTSDIR/$DIST/main/binary-$architecture/Packages.bz2
-bunzip2 -fk $DISTSDIR/$DIST/main/binary-$architecture/Packages.bz2
+# download apt.pg.o packages files
+wget --mirror $(for component in $COMPONENTS; do echo http://$DISTSDIR/$DIST/$component/binary-$architecture/Packages.bz2; done)
+bunzip2 -fk $(for component in $COMPONENTS; do echo $DISTSDIR/$DIST/$component/binary-$architecture/Packages.bz2; done)
+echo
 
 # list of all packages
 MAINPKG=$(awk '/^Package:/ { print $2 }' $DISTSDIR/$DIST/main/binary-${architecture}/Packages)
@@ -61,13 +63,13 @@ done
 
 # beta
 if [ "${PG_BETA_VERSION:-}" ]; then
+  betapkg=$(fold $(echo "$MAINPKG" | fgrep "$PG_BETA_VERSION"))
+
   echo "### Running debcheck: main, packages matching '$PG_BETA_VERSION'"
-  wget --mirror http://$DISTSDIR/$DIST/$PG_BETA_VERSION/binary-$architecture/Packages.bz2
-  bunzip2 -fk $DISTSDIR/$DIST/$PG_BETA_VERSION/binary-$architecture/Packages.bz2
   ( set -x; $DEBCHECK \
     --bg $DISTSDIR/$DIST/$PG_BETA_VERSION/binary-${architecture}/Packages \
     --fg $DISTSDIR/$DIST/main/binary-${architecture}/Packages \
-    ) || EXIT=$?
+    --checkonly $betapkg ) || EXIT=$?
   echo
 
   # exclude packages from further testing
@@ -76,16 +78,15 @@ fi
 
 # devel
 if [ "${PG_DEVEL_VERSION:-}" ]; then
-  wget --mirror http://$DISTSDIR/$DIST/$PG_DEVEL_VERSION/binary-$architecture/Packages.bz2
-  bunzip2 -fk $DISTSDIR/$DIST/$PG_DEVEL_VERSION/binary-$architecture/Packages.bz2
   # production doesn't have PG-devel, test modules against -testing
   if [ "$stage" = "production" ]; then
     BGDIST="$DIST-testing"
   else
     BGDIST="$DIST"
   fi
+  develpkg=$(fold $(echo "$MAINPKG" | fgrep "$PG_DEVEL_VERSION"))
 
-  if [ "$architecture" = "amd64" ]; then
+  if [ "$architecture" = "amd64" ] && [ "$develpkg" ]; then
     echo "### Running debcheck: main, packages matching '$PG_DEVEL_VERSION'"
     ( set -x; $DEBCHECK \
       --bg $DISTSDIR/$BGDIST/$PG_DEVEL_VERSION/binary-${architecture}/Packages \
@@ -118,7 +119,7 @@ if [ "$HAS_BACKPORTS" ]; then
 fi
 
 # main
-echo "### Running debcheck: main, remaining packages"
+echo "### Running debcheck: main"
 pkg=$(fold $MAINPKG)
 ( set -x; $DEBCHECK \
   --fg $DISTSDIR/$DIST/main/binary-${architecture}/Packages \
@@ -126,15 +127,17 @@ pkg=$(fold $MAINPKG)
 echo
 
 # other components
-#for P in $DISTSDIR/$DIST/{?.?,??}/binary-${architecture}/Packages; do
-#  test -s $P || continue
-#  PKG="${PKG:-} $P"
-#done
-#if [ "${PKG:-}" ]; then
-#  echo "### Running debcheck: other components"
-#  ( set -x; $DEBCHECK \
-#    --bg $DISTSDIR/$DIST/main/binary-${architecture}/Packages \
-#    --fg $PKG ) || EXIT=$?
-#fi
+PKG=""
+for component in $COMPONENTS; do
+  [ "$component" = "main" ] && continue
+  P="$DISTSDIR/$DIST/$component/binary-${architecture}/Packages"
+  PKG="$PKG $P"
+done
+if [ "${PKG:-}" ]; then
+  echo "### Running debcheck: other components"
+  ( set -x; $DEBCHECK \
+    --bg $DISTSDIR/$DIST/main/binary-${architecture}/Packages \
+    --fg $PKG ) || EXIT=$?
+fi
 
 exit ${EXIT:-0}