#!/bin/bash

# ABSTRACT: Shows all packages would need to be rebuilt to match a target subslot

source "${LIBDIR}/core-functions.sh" || exit 1

[[ $# == 1 ]]  || die "Expected argument [target-perl-version] in: ${cmdname} [target-perl-version]"
set -euo pipefail

subslot=$1;

shift
require_bin qdepends app-portage/portage-utils
require_bin sort sys-apps/coreutils

dorun installed-deps-atom "^dev-lang/perl:0/${subslot}"

# help: Invocation:
# help:   gentoo-perl installed-deps-perl-subslot-rebuild [perl-subslot-version]
# help:
# help: Example:
# help:   gentoo-perl installed-deps-perl-subslot-rebuild 5.22
# help:
# help: Outputs:
# help:   A list of all packages in Category/Package-Name format
# help:   which have a subslot binding on any perl other than the desired one.
# help:
# help: Note that [perl-subslot-version] is not typically 5.22.3 or similar,
# help: but 5.22 , the ABI version.

