1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
|
#! /bin/bash
# Daily cronjob script for auto-generating parts of the Quinn Diff webpages.
# Copyright (C) 1997, 1998 James Troup <james@nocrew.org>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
set -e
by_priority()
{
echo "quinn.sh run @ $(date)" > qd-output/$1/by_priority-$2.txt.new
./scripts/quinn-diff_sort_by_priority >> qd-output/$1/by_priority-$2.txt.new
mv qd-output/$1/by_priority-$2.txt.new qd-output/$1/by_priority-$2.txt
chmod 644 qd-output/$1/by_priority-$2.txt
}
by_section()
{
echo "quinn.sh run @ $(date)" > qd-output/$1/by_section-$2.txt.new
./scripts/quinn-diff_sort_by_section >> qd-output/$1/by_section-$2.txt.new
mv qd-output/$1/by_section-$2.txt.new qd-output/$1/by_section-$2.txt
chmod 644 qd-output/$1/by_section-$2.txt
}
by_priority_split()
{
echo "quinn.sh run @ $(date)" > qd-output/$1/by_priority_split-$2.txt.new
./scripts/quinn-diff_split_by_status $1 >> qd-output/$1/by_priority_split-$2.txt.new
mv qd-output/$1/by_priority_split-$2.txt.new qd-output/$1/by_priority_split-$2.txt
chmod 644 qd-output/$1/by_priority_split-$2.txt
}
by_section_html()
{
sections="admin base comm devel doc editors electronics games graphics hamradio interpreters libs mail math misc net news oldlibs otherosfs shells sound tex text utils web x11"
test -d qd-output/$1/by_section-$2 || mkdir qd-output/$1/by_section-$2
quinn-diff > quinn_blah
for k in $sections; do
#echo "[Processing "$k"]";
rm -f qd-output/$1/by_section-$2/$k.html
cat > qd-output/$1/by_section-$2/$k.html <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Quinn Diff output for Debian GNU/Linux $1 ($k)</TITLE>
<LINK REV=MADE HREF="mailto:james@nocrew.org">
</HEAD>
<BODY>
<P ALIGN=CENTER><H1>Quinn Diff output for Debian/$1 $k/</H1></P>
EOF
egrep "^$k\/" quinn_blah | sed -e "s#^$k/##" -e "s#_# #" | awk '{ printf "<P>"
printf $0" "
printf "</P>\n"
}' > blah
NUM_MISSING=$(grep ":uncompiled" blah | wc --lines)
NUM_OLD=$(grep ":out-of-date" blah | wc --lines)
cat blah >> qd-output/$1/by_section-$2/$k.html
echo "<BR><P>There are"$NUM_MISSING" missing packages and"$NUM_OLD" out of date packages</P>" >> qd-output/$1/by_section-$2/$k.html
cat >> qd-output/$1/by_section-$2/$k.html <<EOF
<HR>
<BR>
Last modified: $(date "+%A, %d %B %Y")<BR>
Please send questions and comments to <A HREF="mailto:james@nocrew.org">james@nocrew.org</A><BR>
Copyright (C) 1998 James Troup <james@nocrew.org>.<BR>
Copying, with or without modification, and distribution is permitted in any medium, provided this notice is preserved.<BR>
</BODY>
</HTML>
EOF
chmod 644 qd-output/$1/by_section-$2/$k.html
done
rm -f quinn_blah blah
}
echo "junk.sh run @ $(date)"
test -d scripts || exit 1;
STABLE_ARCHS="m68k"
FROZEN_ARCHS="m68k" # alpha
UNSTABLE_ARCHS="m68k alpha powerpc sparc arm hurd-i386"
for i in frozen unstable; do
echo "Pocessing $i distribution...."
./scripts/snarf_Packages-primary -d $i -a i386
./scripts/snarf_Packages-source -d $i
if [ $i = stable ]; then
ARCHS="$STABLE_ARCHS"
elif [ $i = frozen ]; then
ARCHS="$FROZEN_ARCHS"
elif [ $i = unstable ]; then
ARCHS="$UNSTABLE_ARCHS"
fi
for j in $ARCHS; do
echo " Processing $j..."
./scripts/snarf_Packages-secondary -a $j -d $i
by_priority $i $j
by_priority_split $i $j
by_section $i $j
by_section_html $i $j;
done
done
touch index.phtml
make
rm -f Packages-primary Packages-secondary Packages-source
|