]> git.donarmstrong.com Git - debbugs.git/blob - examples/debian/versions/queue-versions
* Add the Debian specific scripts to the debbugs repository so we can
[debbugs.git] / examples / debian / versions / queue-versions
1 #! /bin/sh
2 set -e
3
4 # Called from update-versions (inside the lock) to process all *.versions
5 # files in the queue.
6
7 SOURCE="$1"
8
9 cd "/org/bugs.debian.org/versions/queue/$SOURCE"
10
11 find . -maxdepth 1 -name \*.versions -printf '%P\n' | while read x; do
12     perl -ne '
13         if (/(\w[-+0-9a-z.]+) \(([^\(\) \t]+)\)/) {
14             push @v, "$1/$2";
15         }
16         END { print join(" ", @v), "\n"; }
17     ' "$x" \
18         | /org/bugs.debian.org/versions/bin/merge-one-version "$x" \
19         || continue
20     pkg="${x%%_*}"
21     pkghash="$(echo "$pkg" | cut -b 1)"
22     mkdir -p "/org/bugs.debian.org/versions/archive/$SOURCE/$pkghash/$pkg"
23     mv "$x" "/org/bugs.debian.org/versions/archive/$SOURCE/$pkghash/$pkg/$x"
24 done