-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtesting2x
More file actions
executable file
·79 lines (61 loc) · 2.06 KB
/
testing2x
File metadata and controls
executable file
·79 lines (61 loc) · 2.06 KB
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#!/bin/bash
. "$(dirname $0)/config"
. "$(dirname $0)/db-functions"
if [ $# -lt 1 ]; then
msg "usage: ${0##*/} <pkgname> ..."
exit 1
fi
# Lock everything to reduce the possibility of interfering task between the different repo-updates
script_lock
for repo in ${TESTING_REPO} ${STABLE_REPOS[@]}; do
for pkgarch in ${ARCHES[@]}; do
repo_lock ${repo} ${pkgarch} || exit 1
repo_lock ${repo}-${DEBUGSUFFIX} ${pkgarch} || exit 1
done
done
declare -a removed_pkgs
for pkgname in "$@"; do
msg "Moving $pkgname"
for pkgarch in ${ARCHES[@]}; do
repo_from=""
repo_to=""
found_source=false
found_target=false
path="${HISTORYREPO}/${TESTING_REPO}/${pkgarch}/${pkgname}"
if [ -e "${path}" ]; then
found_source=true
repo_from="${TESTING_REPO}"
fi
${found_source} || continue
repo_to=$(find_repo_for_package ${pkgname} ${pkgarch}) && found_target=true
if ! ${found_target}; then
warning "${pkgname} not found in any of these repos: ${STABLE_REPOS[@]}. skipping"
continue
fi
removed_pkgs+=($(find_removed_split_packages ${repo_from} ${repo_to} ${pkgarch} ${pkgname}))
msg2 "$pkgarch $repo_from -> $repo_to"
arch_db_move "$repo_from" "$repo_to" "$pkgarch" "$pkgname"
if [[ -f "$HISTORYREPO/$repo_to-$DEBUGSUFFIX/$pkgarch/$pkgname-$DEBUGSUFFIX" ]]; then
arch_db_move "$repo_from-$DEBUGSUFFIX" "$repo_to-$DEBUGSUFFIX" "$pkgarch" "$pkgname-$DEBUGSUFFIX"
fi
done
${found_source} || warning "${pkgname} not found in [${TESTING_REPO}]. skipping"
done
for pkg in "$(dedup_array "${removed_pkgs[@]}")"; do
msg "Removing $pkg"
for pkgarch in "${ARCHES[@]}"; do
repo=$(find_repo_for_package $pkg $pkgarch) || continue
arch_db_remove "$repo" "$pkgarch" "$pkg"
if [[ -f "$HISTORYREPO/$repo-$DEBUGSUFFIX/$pkgarch/$pkg-$DEBUGSUFFIX" ]]; then
arch_db_remove "$repo-$DEBUGSUFFIX" "$pkgarch" "$pkg-$DEBUGSUFFIX"
fi
done
done
arch_history_commit "testing2x: $*"
for repo in ${TESTING_REPO} ${STABLE_REPOS[@]}; do
for pkgarch in ${ARCHES[@]}; do
repo_unlock ${repo} ${pkgarch}
repo_unlock ${repo}-${DEBUGSUFFIX} ${pkgarch}
done
done
script_unlock