[PATCH] find-debuginfo: Check RPM environment variables are there
Mark Wielaard
mark@klomp.org
Mon Jul 26 22:23:11 GMT 2021
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 <mark@klomp.org>
---
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
More information about the Debugedit
mailing list