summaryrefslogtreecommitdiffstats
path: root/testing2x
blob: 812edd33ad8547d4882d98c280fc78f922e44f73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash

. "$(dirname $0)/db-functions"

source_makepkg

case "$0" in
  *64)
    arch="x86_64"
    ;;
  *)
    arch="i686"
    ;;
esac
WORKDIR="$TMPDIR/testing2x.$UID"

cleanup() {
  rm -rf "${WORKDIR}"
  [ -n "$1" ] && exit $1
}

ctrl_c() {
  echo "Interrupted" >&2
  cleanup 0
}

trap ctrl_c 2
trap cleanup 0

cd "${WORKDIR}"
/usr/bin/svn checkout -N $SVN_PATH checkout
cd checkout

for pkg in $*; do
  moved=0
  /usr/bin/svn up -q ${pkg}
  if [ -f "${pkg}/repos/testing-${arch}/${BUILDSCRIPT}" ]; then
    for repo in core extra; do
      if [ -f "${pkg}/repos/${repo}-${arch}/${BUILDSCRIPT}" ]; then
        echo "===> Moving package '${pkg}': testing-${arch} -> ${repo}-${arch}"
        $(dirname $0)/db-move "${pkg}" "testing" "${repo}" "${arch}"
        moved=1
        break
      fi
    done
    if [ ${moved} -eq 0 ]; then
      echo "===> Warning: ${pkg} is only in testing-${arch}, cannot determine where to move it"
    fi
  else
    echo "===> Warning: ${pkg} is not in testing-${arch}"
  fi
done

cleanup