]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/mk-extra-overrides.sh
disable a-f
[dak.git] / scripts / debian / mk-extra-overrides.sh
1 #!/bin/sh
2
3 # regexp to test if a file is okay:
4 #  grep -Ev '^[a-z0-9A-Z.+-]+\   Task    [a-z0-9:. ,+-]+$' task*
5
6 x="build-essential tag task"
7 opath="/srv/ftp-master.debian.org/scripts/override"
8 apath="/srv/ftp-master.debian.org/ftp/dists"
9
10 if [ ! -d "$apath" ]; then
11   echo "$0: invalid path to archive" >&2
12   exit 1
13 elif [ ! -L "$apath/testing" ]; then
14   echo "$0: symlink for testing suite does not exist >&2"
15   exit 1
16 fi
17
18 codename_testing="$(basename "$(readlink "$apath/testing")")"
19 if [ -z "$codename_testing" ] || [ ! -d "$apath/$codename_testing" ]; then
20   echo "$0: invalid codename for testing suite ('$codename_testing')" >&2
21   exit 1
22 fi
23
24 for s in "$codename_testing" sid; do
25   for c in main contrib non-free; do
26     echo "Making $opath/override.$s.extra.$c"
27     if [ "$c" = "main" ]; then
28       c2="";
29     else
30       c2=".$c"
31     fi
32     for t in $x; do
33       if [ -e "$t$c2" ]; then cat $t$c2; fi
34       if [ -e "$t.$s$c2" ]; then cat $t.$s$c2; fi
35     done | sort > $opath/override.$s.extra.$c
36   done
37 done
38