Sfoglia il codice sorgente

test: framework: Ensure copied status files have trailing lines

If we copied one of the existing status files, we might not have
a trailing newline, so let's add one.

Gbp-Dch: ignore
Julian Andres Klode 10 anni fa
parent
commit
c382e0dff1
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      test/integration/framework

+ 4 - 0
test/integration/framework

@@ -525,6 +525,10 @@ configdpkg() {
 		local STATUSFILE="status-${BASENAME#*-}"
 		local STATUSFILE="status-${BASENAME#*-}"
 		if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then
 		if [ -f "${TESTDIRECTORY}/${STATUSFILE}" ]; then
 			cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status
 			cp "${TESTDIRECTORY}/${STATUSFILE}" rootdir/var/lib/dpkg/status
+			# Add an empty line to the end if there is none
+			if tail -1 rootdir/var/lib/dpkg/status | grep -q .; then
+				echo >> rootdir/var/lib/dpkg/status
+			fi
 		else
 		else
 			echo -n > rootdir/var/lib/dpkg/status
 			echo -n > rootdir/var/lib/dpkg/status
 		fi
 		fi