#!/bin/sh # # All you need is love, love, love! # # # Copyright 2006, 2007, 2008, 2009, 2010 Holger Levsen # Licence GPLv2 # ################# ################# This code is horrible. READ AT YOUR OWN RISK! ################# # # # 2006-11-19, version 0.1 # - initial release # 2007-04-22, version 0.2 # - added amd64 # 2007-05-05, version 0.2.1 # - fixed handling of packages which provide arch all and any debs # 2007-05-06, version 0.2.2 # - added some more information # - fix html validation issues # 2007-05-13, version 0.2.3 # - get the correct source version, if more than one version of a package is in our archive # - fix a bug when the versionumber contains a ":" # 2007-07-05, version 0.3 # - show non-free packages # - only show a section if there are issues # 2007-07-05, version 0.4 # - compare with debian security updates # 2007-12-23, version 0.5 # - adapted to new dak version # 2008-02-01, version 0.6 # - added lenny # 2008-11-10, version 0.7 # - correctly detect if a package doesnt have to build on a specific arch # - display number of source packages in main, $suite, ${suite}-test and the percentage thereof # 2009-04-01, version 0.7.1 # - enhance check for non-free packages to also find those which have nonfree in their names as well as make it suite agnostic # 2010-01-19, version 0.7.2 # - include URL to page with evaluated non-free packages # - new buildd URL # # run needs_love with nice and make_summary in background #### print_table() { if [ -n "${!2}" ] ; then echo "

$1

" for i in `seq 3 $#` ; do case "${!i}" in debian) HEADER="debian/${SUITE} main" ;; security) HEADER="security-updates/${SUITE} main" ;; ${SUITE}) HEADER="debian-edu/${SUITE} local" ;; ${SUITE}-test) HEADER="debian-edu/${SUITE}-test local" ;; powerpc) HEADER="debian-edu/$4/powerpc local" ;; amd64) HEADER="debian-edu/$4/amd64 local" ;; i386) HEADER="debian-edu/$4/i386 local" ;; *) HEADER="${!i}"; esac echo "" done echo "" PACKAGES=`for i in ${!2} ; do echo $i ; done|sort -u` for i in $PACKAGES; do echo "" print_td "$i" if [ "$4" ] ; then print_td "`dak ls $i -s $4 |cut -d'|' -f2`" if [ "$5" = "debian" ] ; then NR=0 while [ $NR -le ${#DEBIAN_ETCH_P[*]} ] ; do if [ "${DEBIAN_ETCH_P[$NR]}" = $i ] ; then break fi let "NR += 1" done print_td ${DEBIAN_ETCH_S[$NR]} elif [ "$5" = "security" ] ; then NR=0 while [ $NR -le ${#SECURITY_ETCH_P[*]} ] ; do if [ "${SECURITY_ETCH_P[$NR]}" = $i ] ; then break fi let "NR += 1" done print_td ${SECURITY_ETCH_S[$NR]} elif [ "$5" = "powerpc" ] || [ "$5" = "amd64" ] || [ "$5" = "i386" ] ; then print_td "`dak ls -S -a $5 -s $4 $i |head -1|cut -d'|' -f2`" elif [ -n "$5" ] ; then print_td "`dak ls -s $5 $i |cut -d'|' -f2`" fi fi echo "" done echo "
${HEADER}

" fi } print_td() { echo "$1" } # # # Main # # SUITE=$1 STARTTIME=$(date +%s) TITLE="debian-edu $SUITE archive needs some love" cat < $TITLE
Debian Project

$TITLE
EOF # # this code also needs more love by now :) # TMPDIR=`mktemp -d` || exit cd $TMPDIR ##EDU__PACKAGES="debian-edu-artwork sitesummary gnash" EDU_PACKAGES=`(dak control-suite -l ${SUITE}-test|grep " source"|cut -d' ' -f 1; dak control-suite -l ${SUITE}|grep " source"|cut -d' ' -f 1) |sort -u|xargs` # # get list of packages in debian $SUITE main # rm -f Sources.gz Sources URL=http://ftp.debian.org/debian/dists/$SUITE/main/source/Sources.gz wget $URL > /dev/null 2>&1 gunzip Sources.gz || echo "

Warning:

Couldn't download $URL - Debian related results will be screwed.

" IFS=$'\n' NR=0; MAINNR=0 for i in `egrep '^Package:|^Version:' Sources|cut -b 10-|xargs -n 2` ; do IFS=$' \n\t' PACKAGE=`echo $i|cut -d' ' -f1` for j in $EDU_PACKAGES ; do if [ "$j" = "$PACKAGE" ] ; then DEBIAN_ETCH_P[$NR]=$PACKAGE DEBIAN_ETCH_S[$NR]=`echo $i|cut -d' ' -f2` let "NR += 1" fi done let "MAINNR += 1" IFS=$'\n' done IFS=$' \n\t' rm -f Sources.gz Sources #echo ${DEBIAN_ETCH_P[@]} #for i in `seq 0 ${#DEBIAN_ETCH_P[*]}` ; do echo $i ; # echo "

${DEBIAN_ETCH_P[$i]} ${DEBIAN_ETCH_S[$i]}

" # done #exit 0 # # get list of packages in debian $SUITE security-updates main # rm -f Sources.gz Sources URL=http://security.debian.org/dists/$SUITE/updates/main/source/Sources.gz wget $URL > /dev/null 2>&1 gunzip Sources.gz || echo "

Warning:

Couldn't download $URL - Debian security related results will be screwed.

" IFS=$'\n' NR=0; for i in `egrep '^Package:|^Version:' Sources|cut -b 10-|xargs -n 2` ; do IFS=$' \n\t' PACKAGE=`echo $i|cut -d' ' -f1` for j in $EDU_PACKAGES ; do if [ "$j" = "$PACKAGE" ] ; then SECURITY_ETCH_P[$NR]=$PACKAGE SECURITY_ETCH_S[$NR]=`echo $i|cut -d' ' -f2` let "NR += 1" fi done IFS=$'\n' done IFS=$' \n\t' rm -f Sources.gz Sources SUITENR=0 SUITETESTNR=0 for i in $EDU_PACKAGES ; do NOTINDEBIAN=true DNR=0 while [ $DNR -le ${#DEBIAN_ETCH_P[*]} ] ; do if [ "${DEBIAN_ETCH_P[$DNR]}" = $i ] ; then unset NOTINDEBIAN break fi let "DNR += 1" done NOTINSECURITY=true SNR=0 while [ $SNR -le ${#SECURITY_ETCH_P[*]} ] ; do if [ "${SECURITY_ETCH_P[$SNR]}" = $i ] ; then unset NOTINSECURITY break fi let "SNR += 1" done ETCH_SOURCE=`dak ls -s $SUITE $i |grep source| cut -d'|' -f2|xargs` ETCH_TEST_SOURCE=`dak ls -s ${SUITE}-test $i |grep source|cut -d'|' -f2|xargs` if [ -z "$ETCH_SOURCE" ] ; then NOT_IN_ETCH="$NOT_IN_ETCH $i" elif [ -z "$ETCH_TEST_SOURCE" ] ; then NOT_IN_ETCH_TEST="$NOT_IN_ETCH_TEST $i" elif [ "$ETCH_SOURCE" != "$ETCH_TEST_SOURCE" ] ; then NEEDS_KATHA="$NEEDS_KATHA $i" fi # count packages if [ -n "`dak ls -s $SUITE $i`" ] ; then let "SUITENR += 1" ; fi if [ -n "`dak ls -s ${SUITE}-test $i`" ] ; then let "SUITETESTNR += 1" ; fi ETCH_POWERPC=`dak ls -S -s $SUITE -a powerpc,all $i|grep powerpc|head -1 |cut -d'|' -f2|xargs` ETCH_AMD64=`dak ls -S -s $SUITE -a amd64,all $i|grep amd64|head -1 |cut -d'|' -f2|xargs` ETCH_I386=`dak ls -S -s $SUITE -a i386,all $i|grep i386|head -1 |cut -d'|' -f2|xargs` ETCH_ARCHS=`dak ls -S -s $SUITE $i|egrep 'powerpc|i386|amd64'|head -1 |cut -d'|' -f4` # if this is empty, the package is arch all (only) ETCH_TEST_POWERPC=`dak ls -S -s $SUITE-test -a powerpc,all $i|grep powerpc|head -1 |cut -d'|' -f2|xargs` ETCH_TEST_AMD64=`dak ls -S -s $SUITE-test -a amd64,all $i|grep amd64|head -1 |cut -d'|' -f2|xargs` ETCH_TEST_I386=`dak ls -S -s $SUITE-test -a i386,all $i|grep i386|head -1 |cut -d'|' -f2|xargs` ETCH_TEST_ARCHS=`dak ls -S -s $SUITE-test $i|egrep 'powerpc|i386|amd64'|head -1 |cut -d'|' -f4` if [ -n "$ETCH_ARCHS" ] ; then { I_ARCHS=`zcat /org/ftp.skolelinux.org/ftp/dists/${SUITE}/local/source/Sources.gz | grep-dctrl -F Package --eq $i -s Architecture` if [ -n "$ETCH_SOURCE" ] ; then dpkg --compare-versions $ETCH_SOURCE eq $ETCH_POWERPC > /dev/null 2>&1 || if `echo $I_ARCHS|egrep -q 'any|powerpc'` ; then NEEDS_POWERPC_ETCH="$NEEDS_POWERPC_ETCH $i" ; fi fi if [ -n "$ETCH_SOURCE" ] ; then dpkg --compare-versions $ETCH_SOURCE eq $ETCH_AMD64 > /dev/null 2>&1 || if `echo $I_ARCHS|egrep -q 'any|amd64'` ; then NEEDS_AMD64_ETCH="$NEEDS_AMD64_ETCH $i" ; fi fi if [ -n "$ETCH_SOURCE" ] ; then dpkg --compare-versions $ETCH_SOURCE eq $ETCH_I386 > /dev/null 2>&1 || if `echo $I_ARCHS|egrep -q 'any|i386'` ; then NEEDS_I386_ETCH="$NEEDS_I386_ETCH $i" ; fi fi } fi if [ -n "$ETCH_TEST_ARCHS" ] ; then { I_ARCHS=`zcat /org/ftp.skolelinux.org/ftp/dists/${SUITE}-test/local/source/Sources.gz | grep-dctrl -F Package --eq $i -s Architecture` if [ -n "$ETCH_TEST_SOURCE" ] ; then dpkg --compare-versions $ETCH_TEST_SOURCE eq $ETCH_TEST_POWERPC > /dev/null 2>&1 || if `echo $I_ARCHS|egrep -q 'any|powerpc'` ; then NEEDS_POWERPC_ETCH_TEST="$NEEDS_POWERPC_ETCH_TEST $i" ; fi fi if [ -n "$ETCH_TEST_SOURCE" ] ; then dpkg --compare-versions $ETCH_TEST_SOURCE eq $ETCH_TEST_AMD64 > /dev/null 2>&1 || if `echo $I_ARCHS|egrep -q 'any|amd64'` ; then NEEDS_AMD64_ETCH_TEST="$NEEDS_AMD64_ETCH_TEST $i" ; fi fi if [ -n "$ETCH_TEST_SOURCE" ] ; then dpkg --compare-versions $ETCH_TEST_SOURCE eq $ETCH_TEST_I386 > /dev/null 2>&1 || if `echo $I_ARCHS|egrep -q 'any|i386'` ; then NEEDS_I386_ETCH_TEST="$NEEDS_I386_ETCH_TEST $i" ; fi fi } fi if [ ! "$NOTINDEBIAN" ] && [ -n "$ETCH_SOURCE" ] ; then dpkg --compare-versions ${DEBIAN_ETCH_S[$DNR]} ge $ETCH_SOURCE > /dev/null 2>&1 && REMOVE_ETCH="$REMOVE_ETCH $i" dpkg --compare-versions ${DEBIAN_ETCH_S[$DNR]} ge $ETCH_SOURCE > /dev/null 2>&1 || ETCH_NEWER="$ETCH_NEWER $i" fi if [ ! "$NOTINDEBIAN" ] && [ -n "$ETCH_TEST_SOURCE" ] ; then dpkg --compare-versions ${DEBIAN_ETCH_S[$DNR]} ge $ETCH_TEST_SOURCE > /dev/null 2>&1 && REMOVE_ETCH_TEST="$REMOVE_ETCH_TEST $i" dpkg --compare-versions ${DEBIAN_ETCH_S[$DNR]} ge $ETCH_TEST_SOURCE > /dev/null 2>&1 || ETCH_TEST_NEWER="$ETCH_TEST_NEWER $i" fi [ ! "$NOTINDEBIAN" ] || NOT_IN_DEBIAN="$NOT_IN_DEBIAN $i" if [ ! "$NOTINSECURITY" ] && [ -n "$ETCH_SOURCE" ] ; then dpkg --compare-versions ${SECURITY_ETCH_S[$SNR]} ge $ETCH_SOURCE > /dev/null 2>&1 && SECURITY_NEWER_THAN_ETCH="$SECURITY_NEWER_THAN_ETCH $i" dpkg --compare-versions ${SECURITY_ETCH_S[$SNR]} ge $ETCH_SOURCE > /dev/null 2>&1 || ETCH_NEWER_THAN_SECURITY="$ETCH_NEWER_THAN_SECURITY $i" fi if [ ! "$NOTINSECURITY" ] && [ -n "$ETCH_TEST_SOURCE" ] ; then dpkg --compare-versions ${SECURITY_ETCH_S[$SNR]} ge $ETCH_TEST_SOURCE > /dev/null 2>&1 && SECURITY_NEWER_THAN_ETCH_TEST="$SECURITY_NEWER_THAN_ETCH_TEST $i" dpkg --compare-versions ${SECURITY_ETCH_S[$SNR]} ge $ETCH_TEST_SOURCE > /dev/null 2>&1 || ETCH_TEST_NEWER_THAN_SECURITY="$ETCH_TEST_NEWER_THAN_SECURITY $i" fi done NONFREE_ON_DVD=$(for i in `egrep 'non-free|nonfree' ~builder/src/debian-edu/src/build/CD-administrator/filelist-${SUITE}-dvd.txt 2>/dev/null|grep deb|cut -d '_' -f 1|cut -d '/' -f 2-` ; do basename $i ; done) NONFREE_ON_SOURCE_DVD=$(for i in `egrep 'non-free|nonfree' ~builder/src/debian-edu/src/build/CD-administrator/filelist-${SUITE}-dvd-source.txt 2>/dev/null|grep dsc|cut -d '_' -f 1|cut -d '/' -f 2-` ; do basename $i ; done) NONFREE_ON_TEST_DVD=$(for i in `egrep 'non-free|nonfree' ~builder/src/debian-edu/src/build/CD-administrator/filelist-${SUITE}-test-dvd.txt 2>/dev/null|grep deb|cut -d '_' -f 1|cut -d '/' -f 2-` ; do basename $i ; done) NONFREE_ON_TEST_SOURCE_DVD=$(for i in `egrep 'non-free|nonfree' ~builder/src/debian-edu/src/build/CD-administrator/filelist-${SUITE}-test-dvd-source.txt 2>/dev/null|grep dsc|cut -d '_' -f 1|cut -d '/' -f 2-` ; do basename $i ; done) echo "Scroll down to read some explaination about this page." if [ "$NEEDS_KATHA" ] || [ "$NOT_IN_ETCH" ] || [ "$NOT_IN_ETCH_TEST" ] ; then echo "

Packages in our archive in our ${SUITE}-test distribution compared to our ${SUITE} distribution

" print_table "Packages newer in debian-edu/${SUITE}-test than in debian-edu/${SUITE}" NEEDS_KATHA package ${SUITE}-test ${SUITE} print_table "Packages in debian-edu/${SUITE}-test but not in debian-edu/${SUITE}" NOT_IN_ETCH package ${SUITE}-test print_table "Packages in debian-edu/${SUITE} but not in debian-edu/${SUITE}-test" NOT_IN_ETCH_TEST package ${SUITE} echo "
" fi if [ "$REMOVE_ETCH" ] || [ "$REMOVE_ETCH_TEST" ] || [ "$ETCH_NEWER" ] || [ "$ETCH_TEST_NEWER" ] || [ "$NOT_IN_DEBIAN" ] ; then echo "

Packages in our archive compared to the Debian archive

" print_table "Packages which can be removed from debian-edu/${SUITE}" REMOVE_ETCH package ${SUITE} debian print_table "Packages which can be removed from debian-edu/${SUITE}-test" REMOVE_ETCH_TEST package ${SUITE}-test debian print_table "Packages newer in debian-edu/${SUITE} than in debian/${SUITE}" ETCH_NEWER package ${SUITE} debian print_table "Packages newer in debian-edu/${SUITE}-test than in debian/${SUITE}" ETCH_TEST_NEWER package ${SUITE}-test debian print_table "Packages not in debian-${SUITE} main" NOT_IN_DEBIAN package ${SUITE} ${SUITE}-test echo "

Source packages in Debian $SUITE main: $MAINNR
" echo -n "Source packages in Debian Edu $SUITE local: $SUITENR, number of identical packages in percent: " echo "scale=5 ; ( $MAINNR - $SUITENR ) / $MAINNR * 100 "|bc echo "
" echo -n "Source packages in Debian Edu ${SUITE}-test local: $SUITETESTNR, number of identical packages in percent: " echo "scale=5 ; ( $MAINNR - $SUITETESTNR ) / $MAINNR * 100 "|bc echo "

" echo "
" fi if [ "$SECURITY_NEWER_THAN_ETCH" ] || [ "$ETCH_NEWER_THAN_SECURITY" ] || [ "$SECURITY_NEWER_THAN_ETCH_TEST" ] || [ "$ETCH_TEST_NEWER_THAN_SECURITY" ] ; then echo "

Packages in our archive compared to the Debian security archive

" print_table "Packages which need to be updated in debian-edu/${SUITE}" SECURITY_NEWER_THAN_ETCH package ${SUITE} security print_table "Packages which are newer in our debian-edu/${SUITE}" ETCH_NEWER_THAN_SECURITY package ${SUITE} security print_table "Packages which need to be updated in debian-edu/${SUITE}-test" SECURITY_NEWER_THAN_ETCH_TEST package ${SUITE}-test security print_table "Packages which are newer in our debian-edu/${SUITE}-test" ETCH_TEST_NEWER_THAN_SECURITY package ${SUITE}-test security echo "
" fi if [ "$NEEDS_POWERPC_ETCH_TEST" ] || [ "$NEEDS_POWERPC_ETCH" ] || [ "$NEEDS_AMD64_ETCH_TEST" ] || [ "$NEEDS_AMD64_ETCH" ] || [ "$NEEDS_I386_ETCH_TEST" ] || [ "$NEEDS_I386_ETCH" ] ; then echo "

Architecture specific issues

" print_table "Packages which needs build on debian-edu/${SUITE}-test/powerpc" NEEDS_POWERPC_ETCH_TEST package ${SUITE}-test powerpc print_table "Packages which needs build on debian-edu/${SUITE}/powerpc" NEEDS_POWERPC_ETCH package ${SUITE} powerpc print_table "Packages which needs build on debian-edu/${SUITE}-test/amd64" NEEDS_AMD64_ETCH_TEST package ${SUITE}-test amd64 print_table "Packages which needs build on debian-edu/${SUITE}/amd64" NEEDS_AMD64_ETCH package ${SUITE} amd64 print_table "Packages which needs build on debian-edu/${SUITE}-test/i386" NEEDS_I386_ETCH_TEST package ${SUITE}-test i386 print_table "Packages which needs build on debian-edu/${SUITE}/i386" NEEDS_I386_ETCH package ${SUITE} i386 echo 'Examine packages build status here.' echo "
" fi if [ "$NONFREE_ON_DVD" ] || [ "$NONFREE_ON_SOURCE_DVD" ] || [ "$NONFREE_ON_TEST_DVD" ] || [ "$NONFREE_ON_TEST_SOURCE_DVD" ] ; then echo "

Non-free packages on Debian-Edu install media

" echo "

Evaluations whether these packages can be included on our installation media is available at http://wiki.debian.org/DebianEdu/NonFreePackages.

" print_table "multiarch ${SUITE} DVD" NONFREE_ON_DVD "non-free packages" print_table "source ${SUITE} DVD" NONFREE_ON_SOURCE_DVD "non-free sources" print_table "multiarch ${SUITE}-test DVD" NONFREE_ON_TEST_DVD "non-free packages" print_table "source ${SUITE}-test DVD" NONFREE_ON_TEST_SOURCE_DVD "non-free sources" echo "
" fi DATE=`date -u` ENDTIME=$(date +%s) DIFFTIME=$(( $ENDTIME - $STARTTIME )) cat <Some hints for better understanding the above
  • more than 99% of the packages in Debian-Edu come from Debian, above you find a accurate percentage for the number of source packages (but not for the lines of code...)
  • debian-${SUITE} means Debian ${SUITE} main. contrib and non-free are not taken into consideration
  • debian-edu/${SUITE} means Debian-Edu ${SUITE} local - the packages in our archive in the ${SUITE} distribution
  • debian-edu/${SUITE}-test means Debian-Edu ${SUITE}-test local - the packages in our archive in the ${SUITE}-test distribution
  • packages move manually upon request from our ${SUITE}-test to ${SUITE}, new packages are uploaded to ${SUITE}-test
  • more information about the archive can be found in the ArchivePolicy
  • this script also checks for security updates in Debian (for packages which are different in our archive) and for non-free packages on our installation media - but usually there are no such issues :-)

Generated at $DATE in $DIFFTIME seconds by this GPL licensed bash-script written by Holger Levsen.

Valid HTML 4.01! Valid CSS! EOF