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

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

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

revision 1927 by zack, Fri Aug 8 07:17:49 2008 UTC revision 2047 by zack, Fri Nov 28 12:22:04 2008 UTC
# Line 1  Line 1 
1  #!/bin/sh  #!/bin/sh
2    
3  # Copyright 2002 Raphaël Hertzog  # Copyright 2002-2008 Raphaël Hertzog
4    # Copyright 2007-2008 Stefano Zacchiroli <zack@debian.org>
5    
6  # This file is distributed under the terms of the General Public License  # This file is distributed under the terms of the General Public License
7  # version 2 or (at your option) any later version.  # version 2 or (at your option) any later version.
8    
9  #mirror="http://gluck.debian.org/debian"  #mirror="http://gluck.debian.org/debian"
10  mirror="http://ftp.us.debian.org/debian"  mirror="http://ftp.us.debian.org/debian"
11  #mirror="http://ftp.debian.org/debian"  security="http://security.debian.org"
12    volatile="http://volatile.debian.org"
13    
14    #official_distros="oldstable stable testing unstable experimental"
15    official_distros="stable testing unstable experimental"
16    pu_distros="stable-proposed-updates testing-proposed-updates"
17    #security_distros="oldstable stable"
18    security_distros="stable"
19    
20  umask 002  umask 002
21  set -e  set -e
# Line 28  nice_wget() { Line 37  nice_wget() {
37      # the link)      # the link)
38      cp -a $2 $2.new || true      cp -a $2 $2.new || true
39      # Beware that -N conflicts with -O (#88176, #202911)      # Beware that -N conflicts with -O (#88176, #202911)
40      if wget -U pts -q -O $2.new $1 ; then      if wget -U pts -q -O $2.new "$1" ; then
41          mv $2.new $2          mv $2.new $2
42      else      else
43          echo "Downloading $1 failed, $2 is stale now"          echo "Downloading $1 failed, $2 is stale now"
# Line 36  nice_wget() { Line 45  nice_wget() {
45      fi      fi
46  }  }
47    
48    http_head() {
49        # $1: url
50        # return 0 if the URL exists (HEAD was OK), non-0 otherwise
51        curl --head --fail --silent "$1" > /dev/null
52        return $?
53    }
54    
55    nice_redirect_to() {
56      # $1 : target file
57      # $2-... : shell command
58      dest="$1"
59      shift
60      if [ -f "$dest" ] ; then
61        mv "$dest" "$dest.bak"
62      fi
63      $* > "$dest" || (echo "Failure while executing $* . Continuing ..." ; cp "$dest.bak" "$dest")
64    }
65    
66  # Download all Sources.gz  # Download all Sources.gz
67  for comp in main contrib non-free  for comp in main contrib non-free
68  do  do
69      for dist in oldstable stable testing unstable experimental      for dist in $official_distros ; do
70      do        nice_wget $mirror/dists/$dist/$comp/source/Sources.gz \
71          nice_wget $mirror/dists/$dist/$comp/source/Sources.gz \          Sources-${dist}_$comp.gz
72              Sources_${dist}_$comp.gz      done
73        for dist in $pu_distros ; do
74          nice_wget $mirror/dists/$dist/$comp/source/Sources.gz \
75            Sources-${dist}_$comp.gz
76      done      done
77      nice_wget $mirror/dists/stable-proposed-updates/$comp/source/Sources.gz \      for dist in $security_distros ; do
78          Sources-spu_$comp.gz        nice_wget $security/dists/$dist/updates/$comp/source/Sources.gz \
79      nice_wget $mirror/dists/testing-proposed-updates/$comp/source/Sources.gz \          Sources-security-${dist}_$comp.gz
80          Sources-tpu_$comp.gz      done
81      nice_wget http://security.debian.org/dists/oldstable/updates/$comp/source/Sources.gz \      nice_wget $volatile/debian-volatile/dists/stable/volatile/$comp/source/Sources.gz \
         Sources-security-oldstable_$comp.gz  
     nice_wget http://security.debian.org/dists/stable/updates/$comp/source/Sources.gz \  
         Sources-security-stable_$comp.gz  
     #nice_wget http://security.debian.org/dists/testing/updates/$comp/source/Sources.gz \  
         #Sources-security-testing_$comp.gz  
     nice_wget http://volatile.debian.org/debian-volatile/dists/stable/volatile/$comp/source/Sources.gz \  
82          Sources-volatile_$comp.gz          Sources-volatile_$comp.gz
83  done  done
84    
85    # Download mentors.d.n Sources
86    for comp in main contrib non-free
87    do
88      nice_wget http://mentors.debian.net/debian/dists/unstable/$comp/source/Sources.gz \
89        Sources-mentors_$comp.gz
90    done
91    
92  # Download update_excuses.html  # Download update_excuses.html
93  nice_wget http://ftp-master.debian.org/testing/update_excuses.html.gz \  nice_wget http://ftp-master.debian.org/testing/update_excuses.html.gz \
94      update_excuses.html.gz      update_excuses.html.gz
95    
96  # Download PTS subscription count  # Download PTS subscription count
97  nice_wget http://packages.qa.debian.org/data/pts-subscription-count.txt count.txt  nice_wget http://packages.qa.debian.org/data/pts-subscription-count.txt \
98      count.txt
99    
100  # Download override disparities  # Download override disparities
101  nice_wget http://qa.debian.org/data/ftp/override-disparities.unstable \  nice_wget http://qa.debian.org/data/ftp/override-disparities.unstable \
# Line 85  nice_wget http://qa.debian.org/data/bts/ Line 117  nice_wget http://qa.debian.org/data/bts/
117  cut -f1,3 sources >sources.map.new  cut -f1,3 sources >sources.map.new
118  touch -r sources sources.map.new  touch -r sources sources.map.new
119  mv sources.map.new sources.map  mv sources.map.new sources.map
120    nice_redirect_to bugs.help.txt $root/bin/tagged_bugs.py "help"
121    nice_redirect_to bugs.gift.txt \
122      $root/bin/tagged_bugs.py "gift" "debian-qa@lists.debian.org"
123    piuparts_url="http://piuparts.debian.org/results-per-source.txt"
124    # extra care because $piuparts_url doesn't work yet
125    if http_head $piuparts_url ; then
126      nice_wget $piuparts_url piuparts.txt
127    else
128      test -f piuparts.txt || touch piuparts.txt
129    fi
130    
131  # Download debcheck lists  # Download debcheck lists
132  DCROOT=http://qa.debian.org/data/debcheck/result  DCROOT=http://qa.debian.org/data/debcheck/result
# Line 102  nice_wget http://qa.debian.org/data/bts/ Line 144  nice_wget http://qa.debian.org/data/bts/
144  # get patches from ubuntu  # get patches from ubuntu
145  nice_wget http://patches.ubuntu.com/PATCHES patches.ubuntu  nice_wget http://patches.ubuntu.com/PATCHES patches.ubuntu
146  # get packages version in Ubuntu (preprocessed by Lucas on merkel)  # get packages version in Ubuntu (preprocessed by Lucas on merkel)
147  nice_wget http://qa.debian.org/~lucas/ubuntu/sources-versions.txt versions.ubuntu  nice_wget http://qa.debian.org/~lucas/ubuntu/sources-versions.txt \
148      versions.ubuntu
149  # get bugs in Ubuntu (preprocessed by Lucas on merkel)  # get bugs in Ubuntu (preprocessed by Lucas on merkel)
150  nice_wget http://qa.debian.org/~lucas/ubuntu/ubuntu-bugs.txt bugs.ubuntu  nice_wget http://qa.debian.org/~lucas/ubuntu/ubuntu-bugs.txt bugs.ubuntu
151    
# Line 124  nice_wget http://dehs.alioth.debian.org/ Line 167  nice_wget http://dehs.alioth.debian.org/
167  nice_wget http://dehs.alioth.debian.org/no_upstream.txt \  nice_wget http://dehs.alioth.debian.org/no_upstream.txt \
168      dehs_error.txt      dehs_error.txt
169    
170    # retrieve package descriptions from UDD
171    #nice_redirect_to shortdesc.txt $root/bin/retrieve_shortdesc.sh
172    nice_wget http://master.debian.org/~zack/pts/shortdesc.txt shortdesc.txt
173    
174  # What more ?  # What more ?
175    
176  # Decompress all files  # Decompress all files

Legend:
Removed from v.1927  
changed lines
  Added in v.2047

  ViewVC Help
Powered by ViewVC 1.1.5