#!/bin/bash

## Copyright (C) 2012 - 2025 ENCRYPTED SUPPORT LLC <adrelanos@whonix.org>
## See the file COPYING for copying conditions.

set -x
set -o errexit
set -o nounset
set -o pipefail
set -o errtrace
shopt -s inherit_errexit

true "INFO: Currently running script: ${BASH_SOURCE[0]} $*"

dist_build_source_run="true"

MYDIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" && pwd )"
mydir_backup="$MYDIR"
cd -- "$MYDIR"

## XXX: hardcoded path
source "$HOME/derivative-maker/help-steps/pre"
source "$HOME/derivative-maker/help-steps/variables"

cd -- "$mydir_backup"

for derivative_name_item in $derivative_name_list ; do
   derivative_repository_name="$derivative_name_item"
   export derivative_repository_name

   #dm-reprepro-wrapper copymatched bookworm bookworm-proposed-updates "*"
   dm-reprepro-wrapper copymatched trixie trixie-proposed-updates "*"

   true "${cyan}INFO: Done. Migrated proposed-updates repository to stable repository. Do not forget to upload it.${reset}"
done
