#!/bin/bash

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

set -x
set -o pipefail

error_handler() {
   echo "
####################
## ERROR detected. #
####################
"

   exit 1
}

trap "error_handler" ERR

mkdir --parents -- ~/sources

cd -- ~/sources

apt-get \
   "${APTGETOPT[@]}" \
   $apt_unattended_opts \
   update

for i in $(damngpl --source /var/lib/dpkg/status); do
   apt-get \
      "${APTGETOPT[@]}" \
      $apt_unattended_opts \
      --download-only \
      source "$i"
done
