summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-06-14 13:47:35 +0200
committerErich Eckner <git@eckner.net>2017-06-14 13:47:35 +0200
commitfe9acfd30ea146693ba418837d8a29e876f2fcf5 (patch)
tree38b88e2cb1e5eeb076914a700263fab047794fd9 /bin
parentc2caa7200d040cd3d242587ca241b93fabd91a8b (diff)
downloadbuilder-fe9acfd30ea146693ba418837d8a29e876f2fcf5.tar.xz
bin/db-update: can now move package from testing to stable
Diffstat (limited to 'bin')
-rwxr-xr-xbin/db-update37
1 files changed, 35 insertions, 2 deletions
diff --git a/bin/db-update b/bin/db-update
index 34573bc..7e95460 100755
--- a/bin/db-update
+++ b/bin/db-update
@@ -61,6 +61,14 @@ done
packages_to_stabilize=("${@}")
+for package in "${packages_to_stabilize[@]}"; do
+ # some sanity checks
+ if [ ! -f "${work_dir}/package-states/${package}.testing" ]; then
+ >&2 echo "Package '${package}' is not in testing!"
+ exit 2
+ fi
+done
+
updated_package_database=false
# Create a lock file and a trap.
@@ -223,8 +231,33 @@ for package in ${done_packages}; do
mv "${work_dir}/package-states/${package}."{done,testing}
done
-# TODO:
-# move packages from packages_to_stabilize from *testing/ to the stable repos
+# move packages in packages_to_stabilize from *testing/ to the stable repos
+for package in "${packages_to_stabilize[@]}"; do
+ parts=($(cat "${work_dir}/package-states/${package}.testing"))
+ parts_names=(
+ $(
+ printf '%s\n' "${parts[@]}" | \
+ sed 's|\(-[^-]\+\)\{3\}\.pkg\.tar\.xz$||'
+ )
+ )
+ source="$(official_or_community ${package})testing"
+ destination="${package##*.}"
+ pushd "${master_mirror_directory}/i686/${source}" > /dev/null
+ repo-remove "${source}.db.tar.gz" "${parts_names[@]}"
+ for part in "${parts[@]}"; do
+ mv "${part}"{,.sig} "../${destination}/"
+ updated_package_database=true
+ done
+ popd > /dev/null
+ pushd "${master_mirror_directory}/i686/${destination}" > /dev/null
+ repo-add "${destination}.db.tar.gz" "${parts[@]}"
+ for part in "${parts[@]}"; do
+ remove_old_package_versions "${part}"
+ done
+ popd > /dev/null
+
+ rm "${work_dir}/package-states/${package}.testing"
+done
if ${updated_package_database}; then
date '+%s' > \