| 1 |
#!/bin/sh
|
| 2 |
|
| 3 |
# Miriam Ruiz <little_miry@yahoo.es>, Version 0.8, 2008.02.15
|
| 4 |
# You can do whatever you want with this script, it's in the public domain
|
| 5 |
|
| 6 |
# Various tweaks for the pkg-fonts Alioth team (Debian Fonts Task Force)
|
| 7 |
# By Nicolas Spalinger <nicolas.spalinger@sil.org>
|
| 8 |
# http://alioth.debian.org/projects/pkg-fonts/
|
| 9 |
# Thanks a lot to Paul Wise for his help
|
| 10 |
|
| 11 |
# You need: aptitude, wget, fontconfig, lcdf-typetools, fontforge, libfont-ttf-perl, freetype2-demos, fontaine
|
| 12 |
# you need to put the appropriate sources.list for sid in the same folder
|
| 13 |
|
| 14 |
# Ideas for the future of the script
|
| 15 |
# - stats on the fonts
|
| 16 |
# - stats per license
|
| 17 |
# - other formats: mf, ofm, ovf, pk, tfm, vf, pcf, compressed formats
|
| 18 |
# - richer demo string with more extended characters (pangrams)
|
| 19 |
# - pcfp (maybe pango-view) for pangrams
|
| 20 |
# - css for the pages
|
| 21 |
# - fontaine for license analysis and coverage
|
| 22 |
# - flagging fonts with extended font sources and their specific format
|
| 23 |
# - run the tools from Fedora's fontpackages: http://fedoraproject.org/wiki/Improving_existing_font_packages
|
| 24 |
# - ots for font checking http://code.google.com/p/ots/
|
| 25 |
|
| 26 |
export LANG="C"
|
| 27 |
export ARCH="i386"
|
| 28 |
export DIST="sid"
|
| 29 |
export DATE="`/bin/date --utc '+%0Y.%0m.%0d %0k:%0M'`"
|
| 30 |
|
| 31 |
|
| 32 |
echo "Deleting previous review data... "
|
| 33 |
rm -rf web tmp data
|
| 34 |
rm -rf pkg.list pkg_*.list
|
| 35 |
|
| 36 |
echo "Generating list of packages with fonts from ${DIST} on ${ARCH} / ${DATE} UTC"
|
| 37 |
|
| 38 |
# Thanks to Tincho for this information
|
| 39 |
# http://beta.howtorecognise.mine.nu/blog/How_to_have_a_private_APT_configuration.html
|
| 40 |
mkdir -p lists/partial
|
| 41 |
aptitude update -q=0 -y \
|
| 42 |
-o "Dir::Etc::SourceList=`pwd`/sources.list" \
|
| 43 |
-o "Dir::Etc::SourceParts=`pwd`/sources.list.d" \
|
| 44 |
-o "Dir::Etc::Trusted=/usr/share/keyrings/debian-archive-keyring.gpg" \
|
| 45 |
-o "Dir::State::Lists=`pwd`/lists" \
|
| 46 |
-o "Debug::NoLocking=1" -o "Debug::pkgDPkgPM=1"
|
| 47 |
|
| 48 |
# Clean out old packages
|
| 49 |
mkdir -p pkgs/partial
|
| 50 |
aptitude autoclean -q=0 -y \
|
| 51 |
-o "Dir::Etc::SourceList=`pwd`/sources.list" \
|
| 52 |
-o "Dir::Etc::SourceParts=`pwd`/sources.list.d" \
|
| 53 |
-o "Dir::Etc::Trusted=/usr/share/keyrings/debian-archive-keyring.gpg" \
|
| 54 |
-o "Dir::State::Lists=`pwd`/lists" \
|
| 55 |
-o "Debug::NoLocking=1" -o "Debug::pkgDPkgPM=1" \
|
| 56 |
-o "Dir::Cache::Archives=`pwd`/pkgs"
|
| 57 |
|
| 58 |
if [ ! -e Contents-${ARCH}.gz ]; then
|
| 59 |
wget http://ftp.debian.org/debian/dists/${DIST}/Contents-${ARCH}.gz -O Contents-${ARCH}.gz
|
| 60 |
fi
|
| 61 |
|
| 62 |
# FIXME: this does not take into account paths with spaces in them
|
| 63 |
if [ ! -e pkg_ttf.list ]; then
|
| 64 |
zcat Contents-${ARCH}.gz | awk '/\.[tT][tT][fF][\t ]/{print $2}' | sed 's/,/\n/g' | grep -v non-free | sed 's/.*\///g' | sort --unique > pkg_ttf.list
|
| 65 |
fi
|
| 66 |
if [ ! -e pkg_otf.list ]; then
|
| 67 |
zcat Contents-${ARCH}.gz | awk '/\.[oO][tT][fF][\t ]/{print $2}' | sed 's/,/\n/g' | grep -v non-free | sed 's/.*\///g' | sort --unique > pkg_otf.list
|
| 68 |
fi
|
| 69 |
if [ ! -e pkg_pfb.list ]; then
|
| 70 |
zcat Contents-${ARCH}.gz | awk '/\.[tT][tT][cC][\t ]/{print $2}' | sed 's/,/\n/g' | grep -v non-free | sed 's/.*\///g' | sort --unique > pkg_ttc.list
|
| 71 |
fi
|
| 72 |
if [ ! -e pkg_pfa.list ]; then
|
| 73 |
zcat Contents-${ARCH}.gz | awk '/\.[pP][fF][aA][\t ]/{print $2}' | sed 's/,/\n/g' | grep -v non-free | sed 's/.*\///g' | sort --unique > pkg_pfa.list
|
| 74 |
fi
|
| 75 |
if [ ! -e pkg_pfb.list ]; then
|
| 76 |
zcat Contents-${ARCH}.gz | awk '/\.[pP][fF][bB][\t ]/{print $2}' | sed 's/,/\n/g' | grep -v non-free | sed 's/.*\///g' | sort --unique > pkg_pfb.list
|
| 77 |
fi
|
| 78 |
|
| 79 |
|
| 80 |
if [ ! -e pkg.list ]; then
|
| 81 |
cat pkg_*.list | sort --unique > pkg.list
|
| 82 |
fi
|
| 83 |
|
| 84 |
if [ ! -e pkgs ]; then
|
| 85 |
echo "** Filling pkgs/ with packages"
|
| 86 |
mkdir -p pkgs
|
| 87 |
cd pkgs
|
| 88 |
aptitude download $(cat ../pkg.list) -q=0 --show-versions -y \
|
| 89 |
-o "Dir::Etc::SourceList=`pwd`/../sources.list" \
|
| 90 |
-o "Dir::State::Lists=`pwd`/../lists" \
|
| 91 |
-o "Debug::NoLocking=1" -o "Debug::pkgDPkgPM=1"
|
| 92 |
cd ..
|
| 93 |
fi
|
| 94 |
|
| 95 |
for i in $(cat pkg.list); do
|
| 96 |
if [ ! -e pkgs/${i}_*.deb ]; then
|
| 97 |
echo "** Package $i is missing, downloading it"
|
| 98 |
cd pkgs
|
| 99 |
aptitude download "$i" -q=0 --show-versions -y \
|
| 100 |
-o "Dir::Etc::SourceList=`pwd`/../sources.list" \
|
| 101 |
-o "Dir::State::Lists=`pwd`/../lists" \
|
| 102 |
-o "Debug::NoLocking=1" -o "Debug::pkgDPkgPM=1"
|
| 103 |
cd ..
|
| 104 |
fi
|
| 105 |
done
|
| 106 |
|
| 107 |
|
| 108 |
mkdir -p tmp
|
| 109 |
mkdir -p web
|
| 110 |
mkdir -p data
|
| 111 |
|
| 112 |
printf "<html> <header> <title> Debian font review: ${DIST} on ${ARCH} - ${DATE} UTC </title>" >> web/index.html
|
| 113 |
printf "<h1> Debian font review </h1> \n\n" >> web/index.html
|
| 114 |
printf "<i> By the <a href=\"http://pkg-fonts.alioth.debian.org\">Debian Font task force</a> \n\n\n </i> <br/>" >> web/index.html
|
| 115 |
printf "Current archive snapshot: ${DIST} on ${ARCH} at ${DATE} <br /> <br/> \n" >> web/index.html
|
| 116 |
printf "The whole Debian archive is regularly analysed and a detailed font review is produced: \n\n <br />" >> web/index.html
|
| 117 |
printf "a report page is generated for each package which contains one or more font files to provide reviewers (yes that could be you!) with image specimens; clicking on this specimen will bring you to the report page for that specific font containing other useful information like if it's available in more than one package and also font metadata including detailed licensing and author information, smart font features, along with Unicode coverage by blocks, fontlint reports, orthography information and other things. " >> web/index.html
|
| 118 |
printf "You can also look at a <a href=\"debian-font-review.html\">very big page with specimens and author links </a> for each font, " >> web/index.html
|
| 119 |
printf "or the <a href=\"debian-font-review.txt\"> simpler text summary with licensing information</a>. (the report takes a little while to run, so if the page isn't complete yet please come back later).\n\n <br /> <br />" >> web/index.html
|
| 120 |
printf "Please use the information extracted from the various packages in this review to help us fix font-related bugs in Debian: restricted or duplicated fonts in packages, licensing clarifications, advocacy to upstream (resources to make this easier: the <a href="http://wiki.debian.org/Fonts"> bug report template</a> and the <a href="http://www.unifont.org/go_for_ofl/">community-supported Go for OFL! campaign</a>), etc. Please check the font-specific <a href="http://lintian.debian.org">lintian reports</a> too! Thank you for your contribution! \n\n <br /> <br />" >> web/index.html
|
| 121 |
|
| 122 |
|
| 123 |
|
| 124 |
for i in pkgs/*.deb; do
|
| 125 |
pkgid=$(echo $i | sed 's!^pkgs/!!' | sed 's!.deb!!')
|
| 126 |
pkgname=$(dpkg-deb --field $i Package)
|
| 127 |
srcpkgname=$(dpkg-deb --field $i Source | sed 's/ .*//g')
|
| 128 |
if [ "x$srcpkgname" = x ] ; then srcpkgname="$pkgname"; fi
|
| 129 |
echo "Package: $pkgname ($pkgid.deb)"
|
| 130 |
rm -rf tmp
|
| 131 |
mkdir -p tmp
|
| 132 |
dpkg -x $i tmp
|
| 133 |
|
| 134 |
for ext in ttf otf ttc pfa pfb ; do
|
| 135 |
|
| 136 |
for f in $(find tmp -iname "*.${ext}" -a -not -type l); do
|
| 137 |
|
| 138 |
if [ "$pkgfile" = "" ]; then
|
| 139 |
pkgfile="pkg-$pkgname.html"
|
| 140 |
pkgtitle=yes
|
| 141 |
printf "<html>\n<header>\n<title>$pkgid - ${DIST} on ${ARCH} / ${DATE} </title>\n</header>\n<body>\n\n " > web/$pkgfile
|
| 142 |
printf "<a href="$pkgfile"> Report for the $pkgname package </a> <br />\n\n" >> web/index.html
|
| 143 |
fi
|
| 144 |
|
| 145 |
if [ "$srcpkgfile" = "" ]; then
|
| 146 |
srcpkgfile="src-$srcpkgname.html"
|
| 147 |
if [ ! -e web/$srcpkgfile ] ; then
|
| 148 |
printf "<html>\n<header>\n<title>$srcpkgname - ${DIST} on ${ARCH} / ${DATE} </title>\n</header>\n<body>\n\n " > web/$srcpkgfile
|
| 149 |
fi
|
| 150 |
fi
|
| 151 |
|
| 152 |
if [ -f $f ]; then
|
| 153 |
fontpath=$(echo $f | sed 's!^tmp/!!')
|
| 154 |
fontname=$(echo $f | sed 's%.*/\([^/]\+\)$%\1%g' | sed "s/\.${ext}//")
|
| 155 |
md5=$(md5sum $f | awk '{print $1}')
|
| 156 |
sha1=$(sha1sum $f | awk '{print $1}')
|
| 157 |
webpath=$fontpath.png
|
| 158 |
echo " Font filename: $fontname"
|
| 159 |
echo " FONT: $fontpath"
|
| 160 |
echo " MD5: $md5"
|
| 161 |
echo " SHA1: $sha1"
|
| 162 |
echo " SIZE: $(stat -c %s $f)"
|
| 163 |
|
| 164 |
test -e "web/${md5}.png" || rm -rf "web/$md5.png"
|
| 165 |
|
| 166 |
echo " PNG: $webpath"
|
| 167 |
|
| 168 |
test -e "web/${md5}.png" || fontimage "$f" --o "web/${md5}.png"
|
| 169 |
|
| 170 |
if [ x$pkgtitle = xyes ] ; then printf "<h1>Report for the $pkgname package</h1>" >> web/$srcpkgfile ; pkgtitle=no; fi
|
| 171 |
printf "<h2>Report for the ""$fontname"" font</h2>" >> web/$srcpkgfile
|
| 172 |
printf "<h1>Report for the ""$fontname"" font</h1>" >> web/$pkgfile
|
| 173 |
printf "Full path to the font file: <i>/$fontpath </i> <br /> <br />\n" | tee -a web/$srcpkgfile >> web/$pkgfile
|
| 174 |
printf " " | tee -a web/$srcpkgfile >> web/$pkgfile
|
| 175 |
printf " Click on the image specimen for more details about the font: if it is present in more than one package, the binary fields metadata, an overview of the smart font features and the Unicode coverage as well as orthography information. <br /> <br /> " | tee -a web/$srcpkgfile >> web/$pkgfile
|
| 176 |
printf " " | tee -a web/$srcpkgfile >> web/$pkgfile
|
| 177 |
printf "<a href=\"fnt-$md5.html\"><img title=\"Click on the image specimen for more details about the font: if it is present in more than one package, the binary fields metadata, an overview of the smart font features and the Unicode coverage as well as orthography information.\" border=\"0\" src=\"$md5.png\" /></a><br /><br /><br />\n" | tee -a web/$srcpkgfile >> web/$pkgfile
|
| 178 |
echo "$fontname:$pkgname:$fontpath:$md5:$sha1:$ext" >> "data/$md5".data
|
| 179 |
|
| 180 |
if [ "$ext" = "ttf" ]; then
|
| 181 |
echo "<pre>" >> "data/$md5".info
|
| 182 |
otfinfo -i "$f" | sed "s/^.*.${ext}: //g" > "data/$md5".info
|
| 183 |
echo "</pre>" >> "data/$md5".info
|
| 184 |
|
| 185 |
echo "<pre>" >> "data/$md5".info
|
| 186 |
echo "ttfcoverage output (<a href="http://www.unicode.org">Unicode</a> coverage by blocks): " >> "data/$md5".info
|
| 187 |
ttfcoverage "$f" | tee >> "data/$md5".info
|
| 188 |
echo "</pre>" >> "data/$md5".info
|
| 189 |
|
| 190 |
echo "<pre>" >> "data/$md5".info
|
| 191 |
echo "<a href="http://unifont.org/fontaine/">fontaine</a> output: " >> "data/$md5".info
|
| 192 |
fontaine -T "$f" | sed "s/^.*.${ext}: //g" | tee >> "data/$md5".info
|
| 193 |
echo "</pre> " >> "data/$md5".info
|
| 194 |
|
| 195 |
echo "<pre>" >> "data/$md5".info
|
| 196 |
echo "fontconfig representation: " >> "data/$md5".info
|
| 197 |
fc-query "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 198 |
echo "</pre>" >> "data/$md5".info
|
| 199 |
|
| 200 |
echo "<pre>" >> "data/$md5".info
|
| 201 |
echo "fontlint output (<a href="http://fontforge.sf.net">FontForge</a> validation tool): " >> "data/$md5".info
|
| 202 |
fontlint "$f" 2>&1 | sed "s/Failed//g" | tee >> "data/$md5".info
|
| 203 |
echo "</pre>" >> "data/$md5".info
|
| 204 |
|
| 205 |
echo "<pre>" >> "data/$md5".info
|
| 206 |
echo "fontembedding output " >> "data/$md5".info
|
| 207 |
fontembedding "$f" | tee >> "data/$md5".info
|
| 208 |
echo "</pre>" >> "data/$md5".info
|
| 209 |
|
| 210 |
# Disabled due to http://bugs.debian.org/520879
|
| 211 |
#echo "ftvalid output (<a href="http://freetype.org">Freetype</a> validation tool): " >> "data/$md5".info
|
| 212 |
#ftvalid -v 2 "$f" | tee >> "data/$md5".info
|
| 213 |
|
| 214 |
fi # ttf
|
| 215 |
|
| 216 |
if [ "$ext" = "otf" ]; then
|
| 217 |
|
| 218 |
if [ ! -e "data/$md5".info ]; then
|
| 219 |
echo " " >> "data/$md5".info
|
| 220 |
echo "<pre> " >> "data/$md5".info
|
| 221 |
otfinfo -i "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 222 |
echo " " >> "data/$md5".info
|
| 223 |
echo "Supported scripts:" >> "data/$md5".info
|
| 224 |
otfinfo -s "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 225 |
echo " " >> "data/$md5".info
|
| 226 |
echo "GSUB/GPOS features:" >> "data/$md5".info
|
| 227 |
otfinfo -f "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 228 |
echo " " >> "data/$md5".info
|
| 229 |
echo "Optical size information:" >> "data/$md5".info
|
| 230 |
otfinfo -z "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 231 |
echo " " >> "data/$md5".info
|
| 232 |
echo "OpenType tables:" >> "data/$md5".info
|
| 233 |
otfinfo -t "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 234 |
echo "</pre> " >> "data/$md5".info
|
| 235 |
fi
|
| 236 |
|
| 237 |
echo "<pre>" >> "data/$md5".info
|
| 238 |
echo "ttfcoverage output (<a href="http://www.unicode.org">Unicode</a> coverage by blocks): " >> "data/$md5".info
|
| 239 |
ttfcoverage "$f" | tee >> "data/$md5".info
|
| 240 |
echo "</pre>" >> "data/$md5".info
|
| 241 |
|
| 242 |
echo "<pre>" >> "data/$md5".info
|
| 243 |
echo "<a href="http://unifont.org/fontaine/">fontaine</a> output: " >> "data/$md5".info
|
| 244 |
fontaine -T "$f" | sed "s/^.*.${ext}: //g" | tee >> "data/$md5".info
|
| 245 |
echo "</pre> " >> "data/$md5".info
|
| 246 |
|
| 247 |
echo "<pre>" >> "data/$md5".info
|
| 248 |
echo "Fontconfig representation: " >> "data/$md5".info
|
| 249 |
fc-query "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 250 |
echo "</pre>" >> "data/$md5".info
|
| 251 |
|
| 252 |
echo "<pre>" >> "data/$md5".info
|
| 253 |
echo "fontlint output (<a href="http://fontforge.sf.net">FontForge</a> validation tool): " >> "data/$md5".info
|
| 254 |
fontlint "$f" 2>&1 | sed "s/Failed//g" | tee >> "data/$md5".info
|
| 255 |
echo "</pre>" >> "data/$md5".info
|
| 256 |
|
| 257 |
echo "<pre>" >> "data/$md5".info
|
| 258 |
echo "fontembedding output " >> "data/$md5".info
|
| 259 |
fontembedding "$f" | tee >> "data/$md5".info
|
| 260 |
echo "</pre>" >> "data/$md5".info
|
| 261 |
|
| 262 |
# Disabled due to http://bugs.debian.org/520879
|
| 263 |
#echo "ftvalid output (<a href="http://freetype.org">Freetype</a> validation tool): " >> "data/$md5".info
|
| 264 |
#ftvalid -v 2 "$f" | tee >> "data/$md5".info
|
| 265 |
fi # otf
|
| 266 |
|
| 267 |
if [ "$ext" = "ttc" ]; then
|
| 268 |
if [ ! -e "data/$md5".info ]; then
|
| 269 |
|
| 270 |
echo "<pre>" >> "data/$md5".info
|
| 271 |
echo "Fontconfig representation: " >> "data/$md5".info
|
| 272 |
fc-query "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 273 |
echo "</pre> " >> "data/$md5".info
|
| 274 |
|
| 275 |
echo "<pre>" >> "data/$md5".info
|
| 276 |
echo "<a href="http://unifont.org/fontaine/">fontaine</a> output: " >> "data/$md5".info
|
| 277 |
fontaine -T "$f" | sed "s/^.*.${ext}: //g" | tee >> "data/$md5".info
|
| 278 |
echo "</pre> " >> "data/$md5".info
|
| 279 |
|
| 280 |
echo "<pre> " >> "data/$md5".info
|
| 281 |
echo "fontlint output (<a href="http://fontforge.sf.net">FontForge</a> validation tool): " >> "data/$md5".info
|
| 282 |
fontlint "$f" 2>&1 | sed "s/Failed//g" | tee >> "data/$md5".info
|
| 283 |
echo "</pre> " >> "data/$md5".info
|
| 284 |
|
| 285 |
echo "<pre>" >> "data/$md5".info
|
| 286 |
echo "fontembedding output " >> "data/$md5".info
|
| 287 |
fontembedding "$f" | tee >> "data/$md5".info
|
| 288 |
echo "</pre>" >> "data/$md5".info
|
| 289 |
|
| 290 |
fi
|
| 291 |
fi # ttc
|
| 292 |
|
| 293 |
if [ "$ext" = "pfa" ]; then
|
| 294 |
if [ ! -e "data/$md5".info ]; then
|
| 295 |
|
| 296 |
echo "<pre>" >> "data/$md5".info
|
| 297 |
echo "fontconfig representation: " >> "data/$md5".info
|
| 298 |
fc-query "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 299 |
echo "</pre>" >> "data/$md5".info
|
| 300 |
|
| 301 |
echo "<pre>" >> "data/$md5".info
|
| 302 |
echo "fontlint output (<a href="http://fontforge.sf.net">fontForge</a> validation tool): " >> "data/$md5".info
|
| 303 |
fontlint "$f" 2>&1 | sed "s/Failed//g" | tee >> "data/$md5".info
|
| 304 |
echo "</pre>" >> "data/$md5".info
|
| 305 |
fi
|
| 306 |
|
| 307 |
|
| 308 |
fi # pfa
|
| 309 |
|
| 310 |
if [ "$ext" = "pfb" ]; then
|
| 311 |
if [ ! -e "data/$md5".info ]; then
|
| 312 |
|
| 313 |
echo "<pre>" >> "data/$md5".info
|
| 314 |
echo "fontconfig representation: " >> "data/$md5".info
|
| 315 |
fc-query "$f" | sed "s/^.*.${ext}: //g" >> "data/$md5".info
|
| 316 |
echo "</pre>" >> "data/$md5".info
|
| 317 |
fi
|
| 318 |
fi # pfb
|
| 319 |
|
| 320 |
grep "Full name" "data/$md5".info >> "data/$md5".license
|
| 321 |
grep "Version" "data/$md5".info >> "data/$md5".license
|
| 322 |
grep "Copyright" "data/$md5".info >> "data/$md5".license
|
| 323 |
grep "Designer" "data/$md5".info >> "data/$md5".license
|
| 324 |
grep "Designer URL" "data/$md5".info >> "data/$md5".license
|
| 325 |
grep "Manufacturer" "data/$md5".info >> "data/$md5".license
|
| 326 |
grep "Vendor URL" "data/$md5".info >> "data/$md5".license
|
| 327 |
grep "License*" "data/$md5".info >> "data/$md5".license
|
| 328 |
|
| 329 |
touch "data/$md5".info
|
| 330 |
|
| 331 |
SRCPACKAGES="$SRCPACKAGES $srcpkgname"
|
| 332 |
|
| 333 |
fi
|
| 334 |
echo ""
|
| 335 |
|
| 336 |
done # for f in packages that have *.${ext} real files
|
| 337 |
|
| 338 |
done # for ext in ttf otf ttc pfa pfb
|
| 339 |
|
| 340 |
if [ ! "$pkgfile" = "" ]; then
|
| 341 |
printf "</body>\n</html>\n" >> "web/$pkgfile"
|
| 342 |
pkgfile=""
|
| 343 |
pkgtitle=no
|
| 344 |
else
|
| 345 |
echo " Skipping package $pkgname: Only symbolic links"
|
| 346 |
echo ""
|
| 347 |
fi
|
| 348 |
|
| 349 |
if [ ! "$srcpkgfile" = "" ]; then
|
| 350 |
printf "</body>\n</html>\n" >> "web/$srcpkgfile"
|
| 351 |
srcpkgfile=""
|
| 352 |
else
|
| 353 |
echo " Skipping source package $srcpkgname: Only symbolic links"
|
| 354 |
echo ""
|
| 355 |
fi
|
| 356 |
|
| 357 |
done # for i in pkgs/*.deb
|
| 358 |
|
| 359 |
printf "</body>\n</html>\n" >> web/index.html
|
| 360 |
|
| 361 |
# Generate a page with all the fonts
|
| 362 |
|
| 363 |
rm -rf tmp
|
| 364 |
mkdir -p tmp
|
| 365 |
|
| 366 |
for i in data/*.data; do
|
| 367 |
fontid=$(echo $i | sed 's!^data/!!' | sed 's!.data!!')
|
| 368 |
fontname=$(cat $i | awk -F: '{print $1}' | sort | uniq -c | sort -n | tail -1 | awk '{print $2}')
|
| 369 |
ext=$(cat $i | awk -F: '{print $6}' | sort | uniq -c | sort -n | tail -1 | awk '{print $2}')
|
| 370 |
echo "$fontid: $fontname ($ext)"
|
| 371 |
printf "Font name: $fontname<br />\n" > "tmp/$fontname.inc"
|
| 372 |
if test -e "web/$fontid.png"; then
|
| 373 |
printf "<img src=\"$fontid.png\" border=\"0\"/><br />\n" >> "tmp/$fontname.inc"
|
| 374 |
else
|
| 375 |
printf "[NO IMAGE]<br />\n" >> "tmp/$fontname.inc"
|
| 376 |
fi
|
| 377 |
cat $i | awk -F: '{print " " $2 ": " $3}'
|
| 378 |
printf "In packages:\n<ul>\n" >> "tmp/$fontname.inc"
|
| 379 |
cat $i | awk -F: '{print " <li><a href=\"pkg-" $2 ".html\">" $2 "</a>: /"$3 " - <a href=http://packages.debian.org/sid/" $2 " > PTS for unstable </a> - <a href=http://packages.qa.debian.org/" $2 " > developer information </a> </li>"}' >> tmp/$fontname.inc
|
| 380 |
printf "</ul>\n" >> "tmp/$fontname.inc"
|
| 381 |
|
| 382 |
|
| 383 |
fontfile="fnt-$fontid.html"
|
| 384 |
printf "<html>\n<header>\n<title>$fontname - ${DIST} on ${ARCH} / ${DATE} UTC</title>\n</header>\n<body>\n" > web/$fontfile
|
| 385 |
if test -e "web/$fontid.png"; then
|
| 386 |
printf "<h2> Report for ""$fontname"" </h2>\n\n" >> web/$fontfile
|
| 387 |
printf "<img src=\"$fontid.png\" border=\"0\" /><br /> <br />\n" >> web/$fontfile
|
| 388 |
else
|
| 389 |
printf "[NO IMAGE]<br /> <br />\n" >> web/$fontfile
|
| 390 |
fi
|
| 391 |
printf "In packages:\n<ul>\n" >> web/$fontfile
|
| 392 |
cat $i | awk -F: '{print " <li><a href=\"pkg-" $2 ".html\">" $2 "</a>: /"$3 " - <a href=http://packages.debian.org/sid/" $2 " > PTS for unstable </a> - <a href=http://packages.qa.debian.org/" $2 " > developer information </a> </li>"}' >> web/$fontfile
|
| 393 |
|
| 394 |
printf "</ul>\n" >> web/$fontfile
|
| 395 |
if [ -e data/$fontid.info ]; then
|
| 396 |
printf "<br />\n<pre>\n" >> web/$fontfile
|
| 397 |
cat "data/${fontid}.info" >> web/$fontfile
|
| 398 |
printf "</pre><br />\n" >> web/$fontfile
|
| 399 |
fi
|
| 400 |
|
| 401 |
printf "</body>\n</html>\n" >> web/$fontfile
|
| 402 |
|
| 403 |
printf "Font $fontname:\n" >> web/debian-font-review.txt
|
| 404 |
cat $i | awk -F: '{print " Package: " $2 ", File: " $3 "\n MD5: " $4 ", SHA1: " $5 ""}' >> web/debian-font-review.txt
|
| 405 |
|
| 406 |
if [ -e data/$fontid.license ]; then
|
| 407 |
cat "data/${fontid}.license" >> web/debian-font-review.txt
|
| 408 |
echo " " >> web/debian-font-review.txt
|
| 409 |
fi
|
| 410 |
|
| 411 |
if [ -e data/$fontid.license ]; then
|
| 412 |
printf "\n<pre>\n" >> tmp/$fontname.inc
|
| 413 |
cat "data/${fontid}.license" >> tmp/$fontname.inc
|
| 414 |
printf "</pre>\n" >> tmp/$fontname.inc
|
| 415 |
fi
|
| 416 |
|
| 417 |
done
|
| 418 |
|
| 419 |
|
| 420 |
printf "<html>\n<header>\n<title>Debian Fonts Review - ${DIST} on ${ARCH} / ${DATE} UTC </title>\n</header>\n<body>\n" > web/debian-font-review.html
|
| 421 |
|
| 422 |
prev=""
|
| 423 |
for i in $(find tmp/ -name '*.inc' | sort); do
|
| 424 |
if [ "$prev" != "" ]; then
|
| 425 |
printf "<br /><br /><br /> <br />\n" >> web/debian-font-review.html
|
| 426 |
fi
|
| 427 |
cat $i >> web/debian-font-review.html
|
| 428 |
prev=$i
|
| 429 |
done;
|
| 430 |
|
| 431 |
printf "</body>\n</html>\n" >> web/debian-font-review.html
|
| 432 |
|
| 433 |
echo -n > web/debian-font-review.yaml
|
| 434 |
|
| 435 |
for s in $(echo $SRCPACKAGES | tr ' ' '\n' | sort -u); do
|
| 436 |
echo "$s:" >> web/debian-font-review.yaml
|
| 437 |
echo " url: http://pkg-fonts.alioth.debian.org/review/src-$s.html" >> web/debian-font-review.yaml
|
| 438 |
echo >> web/debian-font-review.yaml
|
| 439 |
# FIXME: implement issues section for the PTS
|
| 440 |
done
|