/[qa]/trunk/pts/www/bin/generate_html.sh
ViewVC logotype

Diff of /trunk/pts/www/bin/generate_html.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 345 by hertzog, Mon Aug 12 17:54:30 2002 UTC revision 400 by hertzog, Sun Sep 22 20:23:01 2002 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    
3    # Copyright 2002 Raphaël Hertzog
4    # This file is distributed under the terms of the General Public License
5    # version 2 or (at your option) any later version.
6    
7  verbose=  verbose=
8    
9  if [ -d "incoming" ]; then  if [ -d "incoming" ]; then
# Line 10  else Line 14  else
14      root="/org/packages.qa.debian.org/www"      root="/org/packages.qa.debian.org/www"
15  fi  fi
16    
17  if [ "$1" = "-v" ]; then  if [ "$1" = "-v" -o "$2" = "-v" ]; then
18      verbose=1      verbose=1
19  fi  fi
20    if [ "$1" = "-f" -o "$2" = "-f" ]; then
21        force="yes"
22    fi
23    
24  cd $root/base  cd $root/base
25  date=`LC_ALL=C date -u`  date=`LC_ALL=C date -u`
# Line 24  do Line 31  do
31          hash=${package:0:4}          hash=${package:0:4}
32      fi      fi
33      dir=$hash/$package      dir=$hash/$package
34        htmlfile=$root/web/$dir.html
35        needupdate="no"
36      param="--stringparam dir $dir --stringparam package $package"      param="--stringparam dir $dir --stringparam package $package"
37      for i in other experimental stable testing unstable      # If the file doesn't exist, then require a generation !
38        if [ ! -f $htmlfile ]; then
39            needupdate="yes"
40        fi
41        # Force regeneration
42        if [ "$force" = "yes" ]; then
43            needupdate="yes"
44        fi
45        # Check if force-rebuild exists
46        if [ -e $dir/force-rebuild ]; then
47            needupdate="yes"
48        fi
49        # Create parameters and check if an update is needed
50        for i in news excuse other s-p-u t-p-u stable-security testing-security experimental stable testing unstable
51      do      do
52          if [ -f $dir/$i.xml ]; then          if [ -f "$dir/$i.xml" ]; then
53                # Input is the main xml file used by xsltproc to generate the HTML
54                # page. By default it is unstable.xml but it has many
55                # fallbacks (testing.xml, stable.xml, experimental.xml, ...)
56              input=$dir/$i.xml              input=$dir/$i.xml
57              param="$param --stringparam has$i yes"              param="$param --stringparam has$i yes"
58          fi          fi
59            if [ "$needupdate" = "no" -a "$dir/$i.xml" -nt "$htmlfile" ]; then
60                needupdate="yes"
61            fi
62      done      done
63      if [ ! -d ../web/$dir/static ]; then      if [ ! -d ../web/$dir/static ]; then
64          mkdir -p ../web/$dir/{static,auto,news} || true          mkdir -p ../web/$dir/{static,news} || true
65      fi      fi
66      if [ -n "$verbose" ]; then      if [ -n "$verbose" ]; then
67          echo "Doing $package ..."          echo "Doing $package ..."
68      fi      fi
69      xsltproc -o $root/web/$dir.html --stringparam date "$date" \      if [ "$needupdate" = "yes" ]; then
70          $param ../xsl/pts.xsl $input          xsltproc -o $htmlfile --stringparam date "$date" \
71                $param ../xsl/pts.xsl $input
72            rm -f $dir/force-rebuild || true
73        fi
74  done  done
75    

Legend:
Removed from v.345  
changed lines
  Added in v.400

  ViewVC Help
Powered by ViewVC 1.1.5