From 0bc98d2bf8c2016d180c1b4a4854f7150f7042bf Mon Sep 17 00:00:00 2001 From: Silvan Date: Mon, 9 Oct 2023 19:56:45 +0200 Subject: [PATCH] autodist-inpsect: new tool added --- Makefile | 1 + autodist-inspect | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 autodist-inspect diff --git a/Makefile b/Makefile index 692dbbd..9f54666 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,7 @@ install-programs: @$(INSTALL_SCRIPT) autoport-launcher $(DESTDIR)$(bindir)/autoport-launcher @$(INSTALL_SCRIPT) autoport-chroot $(DESTDIR)$(sbindir)/autoport-chroot @$(INSTALL_SCRIPT) automaint $(DESTDIR)$(sbindir)/automaint + @$(INSTALL_SCRIPT) autodist-inspect $(DESTDIR)$(bindir)/autodist-inspect @$(INSTALL_SCRIPT) autodist-repository $(DESTDIR)$(sbindir)/autodist-repository @$(INSTALL_SCRIPT) autodist-upstream-updates $(DESTDIR)$(sbindir)/autodist-upstream-updates @$(INSTALL_SCRIPT) autoport-fix-environment $(DESTDIR)$(bindir)/autoport-fix-environment diff --git a/autodist-inspect b/autodist-inspect new file mode 100755 index 0000000..24ad096 --- /dev/null +++ b/autodist-inspect @@ -0,0 +1,33 @@ +#!/bin/bash +[ -e /etc/autodist/config ] || { + echo "ERROR: missing configuration file /etc/autodist/config." + exit 1 +} + +. /etc/autodist/config + +shopt -s nocaseglob +checkpkg=$1 + +if [ ! "$checkpkg" ]; then + echo "Usage: +$0 query" + exit 1 +fi + +[ "$LOCAL_REPS_BASE_DIR" -a -e "$LOCAL_REPS_BASE_DIR" ] || { + echo "ERROR: LOCAL_REPS_BASE_DIR needs to be defined and local repositories to exists." + exit 1 +} + +echo "=== distromatic sources: ===" +head -n2 ${LOCAL_REPS_BASE_DIR}/distromatic/base/sources +grep -i $checkpkg ${LOCAL_REPS_BASE_DIR}/distromatic/base/sources +#tail -n+2 ${PREFIX}/distromatic/base/deps-* | grep -i $checkpkg +echo -e "\n=== distdb: ===" +grep -i $checkpkg ${LOCAL_REPS_BASE_DIR}/base/distdb +for repo in base devel-makedist devel-autodist devel-misc; do + echo -e "\n=== ${repo}: ===" + ls ${LOCAL_REPS_BASE_DIR}/${repo}/SRPMS.base/*$checkpkg* 2>/dev/null + ls ${LOCAL_REPS_BASE_DIR}/${repo}/RPMS.*/*$checkpkg* 2>/dev/null +done