Warn and create empty debugsource package if there are no sources.
authorMark Wielaard <mark@klomp.org>
Fri, 28 Jul 2017 13:29:52 +0000 (15:29 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Thu, 10 Aug 2017 08:03:00 +0000 (11:03 +0300)
Signed-off-by: Mark Wielaard <mark@klomp.org>
scripts/find-debuginfo.sh

index d8725ad008df0fe29fbb659930d66755ebee2c57..9b3815addb2e1f17900708b00f6f25953a87c077 100755 (executable)
@@ -573,6 +573,19 @@ if [ -n "$srcout" ]; then
      find src/debug -mindepth 1 -maxdepth 1
     ) | sed 's,^,/usr/,' >> "$srcout"
   fi
+  if [ ! -s "$srcout" ]; then
+    echo >&2 "*** WARNING: No source files found.  Creating empty debugsource package"
+    # Create the empty directory.
+    # See also debugedit invocation. Directories must match up.
+    debug_base_name="$RPM_BUILD_DIR"
+    debug_dest_name="/usr/src/debug"
+    if [ ! -z "$unique_debug_src_base" ]; then
+      debug_base_name="$BUILDDIR"
+      debug_dest_name="/usr/src/debug/${unique_debug_src_base}"
+    fi
+    mkdir -p "${RPM_BUILD_ROOT}${debug_dest_name}"
+    echo "$debug_dest_name" > "$srcout"
+  fi
 fi
 
 # Append to $1 only the lines from stdin not already in the file.
This page took 0.057981 seconds and 5 git commands to generate.