#!/bin/bash

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

set -x
set -e
set -o pipefail

own_filename="$(basename "$BASH_SOURCE")"
for skip_script in $SKIP_SCRIPTS; do
   if [ "$skip_script" = "$own_filename" ]; then
      true "INFO: Skipping $own_filename, because SKIP_SCRIPTS includes it."
      exit 0
   fi
done
unset skip_script

## Create folder.
mkdir --parents /var/lib/anon-dist/gpl/

## Outputs format "package=1:1.0-1"
damngpl --source /var/lib/dpkg/status | tee /var/lib/anon-dist/gpl/damngpl_source >/dev/null

## Outputs format "package_1.0-1"
damngpl --dget /var/lib/dpkg/status | tee /var/lib/anon-dist/gpl/damngpl_dget >/dev/null

## Outputs snapshot.debian.net deb-src lines
damngpl --snapshot /var/lib/dpkg/status | tee /var/lib/anon-dist/gpl/damngpl_snapshot >/dev/null
