find-debuginfo: Check RPM environment variables are there
authorMark Wielaard <mark@klomp.org>
Mon, 26 Jul 2021 22:01:15 +0000 (00:01 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 26 Jul 2021 22:01:20 +0000 (00:01 +0200)
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

index 828fd09e71ee9bd7e1c5d226f0427fd70eb873d7..971218a6c9c3b127e857c171cc8e32a0db69e94c 100755 (executable)
@@ -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=
This page took 0.059002 seconds and 5 git commands to generate.