From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (wildebeest.demon.nl [212.238.236.112]) by sourceware.org (Postfix) with ESMTPS id C09D2383D827 for ; Mon, 26 Jul 2021 22:23:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C09D2383D827 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x10.wildebeest.org [172.31.17.146]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id E9349300047B; Tue, 27 Jul 2021 00:23:16 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 946882E80A2B; Tue, 27 Jul 2021 00:23:16 +0200 (CEST) From: Mark Wielaard To: debugedit@sourceware.org Cc: Mark Wielaard Subject: [PATCH] find-debuginfo: Check RPM environment variables are there Date: Tue, 27 Jul 2021 00:23:11 +0200 Message-Id: <20210726222311.16348-1-mark@klomp.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: debugedit@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: debugedit development mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Jul 2021 22:23:21 -0000 find-debuginfo relies on a couple of RPM environment variables. Ideally we provide command line arguments to set them. But they are somewhat tied to how rpm sets things up. So for now just warn and exit if they aren't set. See also https://sourceware.org/bugzilla/show_bug.cgi?id=27637 Signed-off-by: Mark Wielaard --- scripts/find-debuginfo.in | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/scripts/find-debuginfo.in b/scripts/find-debuginfo.in index 828fd09..971218a 100755 --- a/scripts/find-debuginfo.in +++ b/scripts/find-debuginfo.in @@ -146,6 +146,24 @@ n_jobs=1 # exit early on --version or --help done=false +# Currently this scripts depends on some RPM environment variables +# being set. RPM_BUILD_ROOT as the installation root directory. +# RPM_BUILD_DIR as the top build dir (usually one above BUILDDIR). +# And RPM_PACKAGE_NAME, RPM_PACKAGE_VERSION, RPM_PACKAGE_RELEASE, +# RPM_ARCH to create an unique (dir) name. Warn if they aren't set. +if test -z "${RPM_BUILD_ROOT}"; then + echo "RPM_BUILD_ROOT not set" + exit 1; +fi +if test -z "${RPM_BUILD_DIR}"; then + echo "RPM_BUILD_DIR not set" + exit 1; +fi +if test -z "${RPM_PACKAGE_NAME}"; then + echo "RPM_PACKAGE_NAME not set" + exit 1; +fi + BUILDDIR=. out=debugfiles.list srcout= -- 2.32.0