summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Schmaus <flow@gentoo.org>2024-11-20 16:04:36 +0100
committerFlorian Schmaus <flow@gentoo.org>2024-11-20 16:04:36 +0100
commite46f7f9f4ec09e4fb84653187a2846f778441581 (patch)
treea3056c6cd9456de99b03dc9e7797d6c91abab989
parentadd overlay-to-gentoo (diff)
downloadtex-e46f7f9f4ec09e4fb84653187a2846f778441581.tar.gz
tex-e46f7f9f4ec09e4fb84653187a2846f778441581.tar.bz2
tex-e46f7f9f4ec09e4fb84653187a2846f778441581.zip
populate-distdir: add new options
Signed-off-by: Florian Schmaus <flow@gentoo.org>
-rwxr-xr-xpopulate-distdir25
1 files changed, 23 insertions, 2 deletions
diff --git a/populate-distdir b/populate-distdir
index b63abfa..3865ef6 100755
--- a/populate-distdir
+++ b/populate-distdir
@@ -3,8 +3,29 @@ set -euo pipefail
SCRIPT_DIR=$(cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd)
+DISTDIR="$(portageq distdir)"
+EBUILD_ACTION="fetch"
+
+while getopts em OPT; do
+ case $OPT in
+ e)
+ DISTDIR="${SCRIPT_DIR}/distdir"
+ ;;
+ m)
+ EBUILD_ACTION="manifest"
+ ;;
+ *)
+ echo "usage: ${0##*/} [-e] [-m]"
+ echo -e "\t-e -- extra distdir"
+ echo -e "\t-m -- generate manifest (instead of fetching distfiles)"
+ echo -e "\t will populate DISTDIR only with distfiles not yet in manifest"
+ exit 2
+ esac
+done
+shift $(( OPTIND - 1 ))
+OPTIND=1
+
: "${TEX_OVERLAY_PATH:=$(portageq get_repo_path / tex-overlay)}"
-: "${DISTDIR:="${SCRIPT_DIR}/distdir"}"
if [[ ! -d "${DISTDIR}" ]]; then
mkdir "${DISTDIR}"
@@ -17,4 +38,4 @@ export DISTDIR
export USE="doc source"
find "${TEX_OVERLAY_PATH}" -type f -name '*.ebuild' -print0 |\
- xargs --null -I {} ebuild {} fetch
+ xargs --null -I {} ebuild {} "${EBUILD_ACTION}"